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 31f6fdbe authored by rikt's avatar rikt

Fix issues with popup in live

parent e571a204
...@@ -1221,3 +1221,12 @@ ...@@ -1221,3 +1221,12 @@
.threeDS2Modal .action-close {display:none; } .threeDS2Modal .action-close {display:none; }
.threeDS2Modal #threeDS2Container {
height: 100vh;
}
.adyen-checkout__threeds2, .adyen-checkout__threeds2__challenge {
height:100%;
}
...@@ -246,24 +246,40 @@ define( ...@@ -246,24 +246,40 @@ define(
self.threeDS2ChallengeComponent = self.checkout self.threeDS2ChallengeComponent = self.checkout
.create('threeDS2Challenge', { .create('threeDS2Challenge', {
challengeToken: token, challengeToken: token,
size: '05',
onComplete: function (result) { onComplete: function (result) {
popupModal.modal("closeModal"); self.closeModal(popupModal);
fullScreenLoader.startLoader(); fullScreenLoader.startLoader();
threeds2.processThreeDS2(result.data).done(function (responseJSON) { threeds2.processThreeDS2(result.data).done(function (responseJSON) {
self.validateThreeDS2OrPlaceOrder(responseJSON); self.validateThreeDS2OrPlaceOrder(responseJSON);
}).error(function () { }).error(function () {
popupModal.modal("closeModal");
self.isPlaceOrderActionAllowed(true); self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader(); fullScreenLoader.stopLoader();
}); });
}, },
onError: function (error) { onError: function (error) {
self.closeModal(popupModal);
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
} }
}); });
self.threeDS2ChallengeComponent.mount(threeDS2Node); self.threeDS2ChallengeComponent.mount(threeDS2Node);
} }
}, },
/**
* This method is a workaround to close the modal in the right way and reconstruct the threeDS2Modal.
* This will solve issues when you cancel the 3DS2 challenge and retry the payment
*/
closeModal: function (popupModal) {
popupModal.modal("closeModal");
$('.threeDS2Modal').remove();
$('.modals-overlay').remove();
// reconstruct the threeDS2Modal container again otherwise component can not find the threeDS2Modal
$('#threeDS2Wrapper').append("<div id=\"threeDS2Modal\">" +
"<div id=\"threeDS2Container\"></div>" +
"</div>");
},
/** /**
* Builds the payment details part of the payment information reqeust * Builds the payment details part of the payment information reqeust
* *
...@@ -369,7 +385,9 @@ define( ...@@ -369,7 +385,9 @@ define(
if (self.redirectAfterPlaceOrder) { if (self.redirectAfterPlaceOrder) {
// use custom redirect Link for supporting 3D secure // use custom redirect Link for supporting 3D secure
window.location.replace(url.build(window.checkoutConfig.payment[quote.paymentMethod().method].redirectUrl)); window.location.replace(url.build(
window.checkoutConfig.payment[quote.paymentMethod().method].redirectUrl)
);
} }
} }
); );
......
...@@ -77,9 +77,12 @@ ...@@ -77,9 +77,12 @@
<div afterRender="renderSecureFields()" data-bind="attr: { id: 'cardContainer'}"></div> <div afterRender="renderSecureFields()" data-bind="attr: { id: 'cardContainer'}"></div>
</div> </div>
<div id="threeDS2Wrapper">
<div id="threeDS2Modal"> <div id="threeDS2Modal">
<div id="threeDS2Container"></div> <div id="threeDS2Container"></div>
</div> </div>
</div>
<!-- ko if: (hasInstallments())--> <!-- ko if: (hasInstallments())-->
......
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