Address some comments around guarding againt iframe loading issues
This commit is contained in:
parent
10f4469ebb
commit
301f8f0c5b
1 changed files with 12 additions and 5 deletions
|
|
@ -535,7 +535,9 @@ export default {
|
|||
displayAmount: this.getDisplayAmountDue(),
|
||||
payInAdvanceLineItems: '',
|
||||
shouldBlockInteraction: false,
|
||||
afterpayModalOpen: false
|
||||
afterpayModalOpen: false,
|
||||
iframeLoaded: false,
|
||||
iframeResizerLoaded: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -776,6 +778,7 @@ export default {
|
|||
} else {
|
||||
iframe.contentWindow.postMessage('CreditCardChosen', '*');
|
||||
}
|
||||
this.iframeLoaded = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -855,23 +858,27 @@ export default {
|
|||
},
|
||||
submitPaymentAction() {
|
||||
const iframe = this.$refs.paymentFrame;
|
||||
if (iframe && iframe.contentWindow) {
|
||||
if (iframe && iframe.contentWindow && this.iframeLoaded) {
|
||||
iframe.contentWindow.postMessage('submitPayment', '*');
|
||||
}
|
||||
},
|
||||
switchToAfterPay() {
|
||||
const iframe = this.$refs.paymentFrame;
|
||||
if (iframe && iframe.contentWindow) {
|
||||
if (iframe && iframe.contentWindow && this.iframeLoaded) {
|
||||
this.afterpayModalOpen = true;
|
||||
this.lockIFrameSize(iframe);
|
||||
iframe.contentWindow.postMessage('afterpay-switch', '*');
|
||||
}
|
||||
},
|
||||
lockIFrameSize(iframe) {
|
||||
iframe.iFrameResizer.removeListeners();
|
||||
if (iframe && iframe.iFrameResizer) {
|
||||
iframe.iFrameResizer.removeListeners();
|
||||
}
|
||||
},
|
||||
allowIFrameResize(iframe) {
|
||||
iframeResize({ checkOrigin: false }, iframe);
|
||||
if (iframe) {
|
||||
iframeResize({ checkOrigin: false }, iframe);
|
||||
}
|
||||
},
|
||||
showIssLoadingModal
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue