We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit fc5ce129 authored by attilak's avatar attilak

- Fix cancel for order

 - Fix scrolling issue after failed 3ds2 validation
parent 01997eee
...@@ -145,12 +145,13 @@ class AdyenThreeDS2Process implements AdyenThreeDS2ProcessInterface ...@@ -145,12 +145,13 @@ class AdyenThreeDS2Process implements AdyenThreeDS2ProcessInterface
if($result['resultCode'] != 'Authorised') { if($result['resultCode'] != 'Authorised') {
$this->checkoutSession->restoreQuote(); $this->checkoutSession->restoreQuote();
if ($order->canCancel()) { // Always cancel the order if the paymenth has failed
$order->cancel(); if (!$order->canCancel()) {
} else { $order->setState(\Magento\Sales\Model\Order::STATE_NEW);
$this->adyenLogger->addDebug('Order ' . $order->getId() . ' can not be canceled');
} }
$order->cancel()->save();
throw new \Magento\Framework\Exception\LocalizedException(__('The payment is REFUSED.')); throw new \Magento\Framework\Exception\LocalizedException(__('The payment is REFUSED.'));
} }
......
...@@ -200,6 +200,7 @@ define( ...@@ -200,6 +200,7 @@ define(
.create('threeDS2DeviceFingerprint', { .create('threeDS2DeviceFingerprint', {
fingerprintToken: token, fingerprintToken: token,
onComplete: function (result) { onComplete: function (result) {
self.threeDS2IdentifyComponent.unmount();
threeds2.processThreeDS2(result.data).done(function (responseJSON) { threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON) self.validateThreeDS2OrPlaceOrder(responseJSON)
}).fail(function (result) { }).fail(function (result) {
...@@ -235,6 +236,7 @@ define( ...@@ -235,6 +236,7 @@ define(
challengeToken: token, challengeToken: token,
size: '05', size: '05',
onComplete: function (result) { onComplete: function (result) {
self.threeDS2ChallengeComponent.unmount();
self.closeModal(popupModal); self.closeModal(popupModal);
fullScreenLoader.startLoader(); fullScreenLoader.startLoader();
...@@ -247,7 +249,6 @@ define( ...@@ -247,7 +249,6 @@ define(
}); });
}, },
onError: function (error) { onError: function (error) {
self.closeModal(popupModal);
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
} }
}); });
...@@ -262,6 +263,7 @@ define( ...@@ -262,6 +263,7 @@ define(
popupModal.modal("closeModal"); popupModal.modal("closeModal");
$('.threeDS2Modal').remove(); $('.threeDS2Modal').remove();
$('.modals-overlay').remove(); $('.modals-overlay').remove();
$('body').removeClass('_has-modal');
// reconstruct the threeDS2Modal container again otherwise component can not find the threeDS2Modal // reconstruct the threeDS2Modal container again otherwise component can not find the threeDS2Modal
$('#threeDS2Wrapper').append("<div id=\"threeDS2Modal\">" + $('#threeDS2Wrapper').append("<div id=\"threeDS2Modal\">" +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment