Skip to content

Commit

Permalink
MAGE-536: Fix AmzPay button event
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Boulanger committed Dec 4, 2023
1 parent e2d80b5 commit 26070f8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions js/payone/core/amazonpay.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,24 @@ window.onDocumentReady = function () {

$('confirmSelection').onclick = function (event) {
event.preventDefault();
window.onCheckoutProgress(event.currentTarget);
if (event.currentTarget != null) {
window.onCheckoutProgress(event.currentTarget);
} else {
window.onCheckoutProgress(event.target);
}
};
$('placeOrder').onclick = function (event) {
event.preventDefault();
OffAmazonPayments.initConfirmationFlow(
PayoneCheckout.amazonSellerId,
PayoneCheckout.amazonOrderReferenceId,
function(confirmationFlow) {
placeOrder(event.currentTarget, confirmationFlow);
if (event.currentTarget != null) {
placeOrder(event.currentTarget, confirmationFlow);
} else {
placeOrder(event.target, confirmationFlow);
}

}
);
};
Expand Down

0 comments on commit 26070f8

Please sign in to comment.