From 26070f883fe940652dd738bd12e1eadecf04f09a Mon Sep 17 00:00:00 2001 From: Vincent Boulanger Date: Mon, 4 Dec 2023 17:59:43 +0100 Subject: [PATCH] MAGE-536: Fix AmzPay button event --- js/payone/core/amazonpay.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/payone/core/amazonpay.js b/js/payone/core/amazonpay.js index f1d2497c..ebdfdf5d 100644 --- a/js/payone/core/amazonpay.js +++ b/js/payone/core/amazonpay.js @@ -199,7 +199,11 @@ 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(); @@ -207,7 +211,12 @@ window.onDocumentReady = function () { PayoneCheckout.amazonSellerId, PayoneCheckout.amazonOrderReferenceId, function(confirmationFlow) { - placeOrder(event.currentTarget, confirmationFlow); + if (event.currentTarget != null) { + placeOrder(event.currentTarget, confirmationFlow); + } else { + placeOrder(event.target, confirmationFlow); + } + } ); };