@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.143 to 1.0.145
@@ -39,2 +39,4 @@ "use strict"; | ||
let returnMessage; | ||
let voidTransactionResults; | ||
let cancelOrderResults; | ||
const { id } = order; | ||
@@ -47,3 +49,3 @@ const transactions = await getTransactions(shopifyClient, id); | ||
if (transaction) { | ||
const voidTransactionResults = await voidTransaction(shopifyClient, transaction); | ||
voidTransactionResults = await voidTransaction(shopifyClient, transaction); | ||
if (voidTransactionResults instanceof Error) { | ||
@@ -53,14 +55,15 @@ returnMessage = voidTransactionResults; | ||
else { | ||
const cancelOrder = await cancelUnpaidOrder(shopifyClient, id); | ||
if (cancelOrder instanceof Error) { | ||
returnMessage = cancelOrder; | ||
} | ||
else { | ||
returnMessage = 'Authorization transaction voided and order canceled.'; | ||
} | ||
returnMessage = `Transaction voided successfully ${JSON.stringify(voidTransactionResults)}`; | ||
} | ||
} | ||
else { | ||
returnMessage = 'No authorization transaction was found'; | ||
returnMessage = 'No authorization transaction was found.'; | ||
} | ||
cancelOrderResults = await cancelUnpaidOrder(shopifyClient, id); | ||
if (cancelOrderResults instanceof Error) { | ||
returnMessage = `${returnMessage} --- ${cancelOrderResults}`; | ||
} | ||
else { | ||
returnMessage = `${returnMessage} --- Order canceled successfully ${JSON.stringify(cancelOrderResults)}`; | ||
} | ||
return returnMessage; | ||
@@ -67,0 +70,0 @@ }; |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.143", | ||
"version": "1.0.145", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
"sinon": "^7.3.2", | ||
"ts-node": "^8.2.0", | ||
"ts-node": "^8.3.0", | ||
"tslint": "^5.17.0", | ||
@@ -37,4 +37,4 @@ "typescript": "^3.5.2" | ||
"ns8-switchboard-interfaces": "^1.0.71", | ||
"shopify-api-node": "2.19.3" | ||
"shopify-api-node": "2.20.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71487
846
+ Addedshopify-api-node@2.20.1(transitive)
- Removedshopify-api-node@2.19.3(transitive)
Updatedshopify-api-node@2.20.1