Skip to content

Commit

Permalink
Fix checkout flow for Pending result code
Browse files Browse the repository at this point in the history
ADPM-42
  • Loading branch information
MarijaIv committed Jan 15, 2024
1 parent 642bb54 commit 190cd82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
checkoutConfigUrl: '',
additionalDataUrl: '',
additionalActionSelector: '#adyen-additional-action',
checkoutShippingPaymentUrl: '/checkout/shippingPayment/sTarget/checkout'
checkoutShippingPaymentUrl: '/checkout/shippingPayment/sTarget/checkout',
skipRedirect: ''
},

init: function () {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Resources/views/frontend/checkout/finish.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
}"
data-checkoutShippingPaymentUrl="{url controller='checkout' action='shippingPayment' sTarget='checkout'}"
data-additionalActionSelector="#adyen-additional-action"
data-skipRedirect="1"
></div>
<script id="adyen-additional-action" type="application/json">{$adyenAction}</script>
{if $sErrorMessages}
Expand Down

0 comments on commit 190cd82

Please sign in to comment.