From 9cc9a8b15404b4993e2242a673d99862160e7221 Mon Sep 17 00:00:00 2001 From: Shani Date: Thu, 7 Sep 2023 18:52:31 +0530 Subject: [PATCH 1/2] fix: paypal on cancel flow --- .../cartridge/js/pages/checkout/adyen-checkout.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js b/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js index 79e63f7ae..62f8318ed 100644 --- a/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js +++ b/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js @@ -101,7 +101,9 @@ async function initializeBillingEvents() { }, onError: (/* error, component */) => { paypalTerminatedEarly = false; - $('#dwfrm_billing').trigger('submit'); + paymentFromComponent({ + cancelTransaction: true, + merchantReference: document.querySelector('#merchantReference').value, }); }, onAdditionalDetails: (state /* , component */) => { paypalTerminatedEarly = false; From 3d292695e25d82f59d649c9607af70464994298f Mon Sep 17 00:00:00 2001 From: Shani Date: Thu, 7 Sep 2023 19:26:03 +0530 Subject: [PATCH 2/2] fix: paypal on cancel flow --- .../cartridge/js/pages/checkout/adyen-checkout.js | 6 ++++-- .../cartridge/js/pages/checkout/adyen-checkout.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js index f1c21b532..d6333758a 100644 --- a/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js +++ b/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js @@ -117,7 +117,9 @@ function _initializeBillingEvents() { onError: function onError( /* error, component */ ) { paypalTerminatedEarly = false; - $('#dwfrm_billing').trigger('submit'); + paymentFromComponent({ + cancelTransaction: true, + merchantReference: document.querySelector('#merchantReference').value}); }, onAdditionalDetails: function onAdditionalDetails(state /* , component */) { paypalTerminatedEarly = false; @@ -687,4 +689,4 @@ exports.initAccount = function () { }; exports.renderGenericComponent = function () { renderGenericComponent(); -}; \ No newline at end of file +}; diff --git a/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js b/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js index 62f8318ed..b57604d7d 100644 --- a/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js +++ b/src/cartridges/int_adyen_controllers/cartridge/js/pages/checkout/adyen-checkout.js @@ -103,7 +103,7 @@ async function initializeBillingEvents() { paypalTerminatedEarly = false; paymentFromComponent({ cancelTransaction: true, - merchantReference: document.querySelector('#merchantReference').value, }); + merchantReference: document.querySelector('#merchantReference').value}); }, onAdditionalDetails: (state /* , component */) => { paypalTerminatedEarly = false;