Skip to content

Commit

Permalink
Add onErrorPaymentOrder callback (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolenorman authored Oct 29, 2024
1 parent a34c503 commit 1cc6ae8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion view/frontend/web/js/model/spi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ define([
'Bold_CheckoutPaymentBooster/js/model/spi/callbacks/on-require-order-data-callback',
'Bold_CheckoutPaymentBooster/js/model/spi/callbacks/on-approve-payment-order-callback',
'Bold_CheckoutPaymentBooster/js/model/spi/callbacks/on-sca-payment-order-callback',
'Magento_Ui/js/model/messageList'
], function (
quote,
fullScreenLoader,
Expand All @@ -17,7 +18,8 @@ define([
onUpdatePaymentOrderCallback,
onRequireOrderDataCallback,
onApprovePaymentOrderCallback,
onScaPaymentOrderCallback
onScaPaymentOrderCallback,
messageList
) {
'use strict';

Expand Down Expand Up @@ -113,6 +115,10 @@ define([
throw e;
}
},
'onErrorPaymentOrder': function (errors) {
console.error('An unexpected PayPal error occurred', errors);
messageList.addErrorMessage({message: 'Warning: An unexpected error occurred. Please try again.'});
},
}
};
const paymentsInstance = new window.bold.Payments(initialData);
Expand Down

0 comments on commit 1cc6ae8

Please sign in to comment.