Update saved card error handling
This commit is contained in:
parent
11d2f2e974
commit
a8603a01ea
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "postalpoint_square_plugin",
|
"name": "postalpoint_square_plugin",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "postalpoint_square_plugin",
|
"name": "postalpoint_square_plugin",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"main": "plugin.js",
|
"main": "plugin.js",
|
||||||
"author": "PostalPortal LLC",
|
"author": "PostalPortal LLC",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
|
|||||||
@ -481,7 +481,7 @@ exports.init = function () {
|
|||||||
|
|
||||||
if (typeof paymentResponse.errors != "undefined") {
|
if (typeof paymentResponse.errors != "undefined") {
|
||||||
global.apis.pos.addOnscreenPaymentLog("Error processing saved payment: " + paymentResponse.errors[0].code);
|
global.apis.pos.addOnscreenPaymentLog("Error processing saved payment: " + paymentResponse.errors[0].code);
|
||||||
global.apis.alert(paymentResponse.errors[0].code, "Saved payment error");
|
throw new Error("Saved payment error: " + paymentResponse.errors[0].code);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (paymentResponse.payment.status == "COMPLETED") {
|
if (paymentResponse.payment.status == "COMPLETED") {
|
||||||
@ -489,11 +489,11 @@ exports.init = function () {
|
|||||||
return true;
|
return true;
|
||||||
} else if (paymentResponse.payment.status == "CANCELED") {
|
} else if (paymentResponse.payment.status == "CANCELED") {
|
||||||
global.apis.pos.addOnscreenPaymentLog("The saved card payment was canceled.");
|
global.apis.pos.addOnscreenPaymentLog("The saved card payment was canceled.");
|
||||||
global.apis.alert("The saved card payment was canceled before it finished.", "Payment canceled");
|
throw new Error("Payment canceled: The saved card payment was canceled before it finished.");
|
||||||
return false;
|
return false;
|
||||||
} else if (paymentResponse.payment.status == "FAILED") {
|
} else if (paymentResponse.payment.status == "FAILED") {
|
||||||
global.apis.pos.addOnscreenPaymentLog("The saved card payment failed.");
|
global.apis.pos.addOnscreenPaymentLog("The saved card payment failed.");
|
||||||
global.apis.alert("The saved card payment failed.", "Payment failed");
|
throw new Error("The saved card payment failed.")
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user