We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday 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
if($result['resultCode'] != 'Authorised') {
$this->checkoutSession->restoreQuote();
if ($order->canCancel()) {
$order->cancel();
} else {
$this->adyenLogger->addDebug('Order ' . $order->getId() . ' can not be canceled');
// Always cancel the order if the paymenth has failed
if (!$order->canCancel()) {
$order->setState(\Magento\Sales\Model\Order::STATE_NEW);
}
$order->cancel()->save();
throw new \Magento\Framework\Exception\LocalizedException(__('The payment is REFUSED.'));
}
......
......@@ -200,6 +200,7 @@ define(
.create('threeDS2DeviceFingerprint', {
fingerprintToken: token,
onComplete: function (result) {
self.threeDS2IdentifyComponent.unmount();
threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON)
}).fail(function (result) {
......@@ -235,6 +236,7 @@ define(
challengeToken: token,
size: '05',
onComplete: function (result) {
self.threeDS2ChallengeComponent.unmount();
self.closeModal(popupModal);
fullScreenLoader.startLoader();
......@@ -247,7 +249,6 @@ define(
});
},
onError: function (error) {
self.closeModal(popupModal);
console.log(JSON.stringify(error));
}
});
......@@ -262,6 +263,7 @@ define(
popupModal.modal("closeModal");
$('.threeDS2Modal').remove();
$('.modals-overlay').remove();
$('body').removeClass('_has-modal');
// reconstruct the threeDS2Modal container again otherwise component can not find the 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