From 190cd8298309da3d9e111623a52d15594922be22 Mon Sep 17 00:00:00 2001 From: Marija Date: Mon, 15 Jan 2024 10:27:18 +0100 Subject: [PATCH] Fix checkout flow for Pending result code ADPM-42 --- .../frontend/js/jquery.adyen-payment-additional-action.js | 8 +++++++- Resources/views/frontend/checkout/finish.tpl | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Resources/frontend/js/jquery.adyen-payment-additional-action.js b/Resources/frontend/js/jquery.adyen-payment-additional-action.js index cb923df2..c3a881bb 100644 --- a/Resources/frontend/js/jquery.adyen-payment-additional-action.js +++ b/Resources/frontend/js/jquery.adyen-payment-additional-action.js @@ -9,7 +9,8 @@ checkoutConfigUrl: '', additionalDataUrl: '', additionalActionSelector: '#adyen-additional-action', - checkoutShippingPaymentUrl: '/checkout/shippingPayment/sTarget/checkout' + checkoutShippingPaymentUrl: '/checkout/shippingPayment/sTarget/checkout', + skipRedirect: '' }, init: function () { @@ -44,6 +45,11 @@ url: me.opts.additionalDataUrl + '/isXHR/1', data: additionalData, success: function (response) { + if (me.opts.skipRedirect) { + return; + } + + window.location.href = response.nextStepUrl; }, error: function () { window.location.href = me.opts.checkoutShippingPaymentUrl; diff --git a/Resources/views/frontend/checkout/finish.tpl b/Resources/views/frontend/checkout/finish.tpl index 24d2282a..bcf238dc 100644 --- a/Resources/views/frontend/checkout/finish.tpl +++ b/Resources/views/frontend/checkout/finish.tpl @@ -17,6 +17,7 @@ }" data-checkoutShippingPaymentUrl="{url controller='checkout' action='shippingPayment' sTarget='checkout'}" data-additionalActionSelector="#adyen-additional-action" + data-skipRedirect="1" > {if $sErrorMessages}