From 9f97b916cd791fd1c57b5fb95f11994c52e3fb69 Mon Sep 17 00:00:00 2001 From: Shani <31096696+shanikantsingh@users.noreply.github.com> Date: Thu, 7 Sep 2023 20:20:10 +0530 Subject: [PATCH] fix: paypal on cancel flow (#965) * fix: paypal on cancel flow * fix: paypal on cancel flow --- .../cartridge/js/pages/checkout/adyen-checkout.js | 6 ++++-- .../cartridge/js/pages/checkout/adyen-checkout.js | 4 +++- 2 files changed, 7 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 79e63f7ae..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 @@ -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;