commit
7b3430fe1e
1 changed files with 22 additions and 20 deletions
|
|
@ -694,41 +694,43 @@ export default {
|
||||||
if (event.data.indexOf("afterpayClosed") > -1) {
|
if (event.data.indexOf("afterpayClosed") > -1) {
|
||||||
this.backButtonAction();
|
this.backButtonAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data.indexOf("creditCardSubmit") > -1) {
|
if (event.data.indexOf("creditCardSubmit") > -1) {
|
||||||
console.log(new Date() + ": Payment method credit card selected");
|
console.log(new Date() + ": Payment method credit card selected");
|
||||||
this.dispatchStoreAction(
|
this.updatePaymentMethod(paymentMethods.CREDIT_CARD);
|
||||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
|
||||||
paymentMethods.CREDIT_CARD,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
this.setUIBlock(true);
|
this.setUIBlock(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data.indexOf("afterpayPaymentReceived") > -1) {
|
if (event.data.indexOf("afterpayPaymentReceived") > -1) {
|
||||||
console.log(new Date() + ": Payment method afterpay selected");
|
console.log(new Date() + ": Payment method afterpay selected");
|
||||||
this.dispatchStoreAction(
|
this.updatePaymentMethod(paymentMethods.AFTERPAY);
|
||||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
|
||||||
paymentMethods.AFTERPAY,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data.indexOf("applepayOpened") > -1) {
|
if (event.data.indexOf("applepayOpened") > -1) {
|
||||||
console.log(new Date() + ": Payment method applepay selected");
|
console.log(new Date() + ": Payment method applepay selected");
|
||||||
this.dispatchStoreAction(
|
this.updatePaymentMethod(paymentMethods.APPLE_PAY);
|
||||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
|
||||||
paymentMethods.APPLE_PAY,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data.indexOf("showLoaderForPaypal") > -1) {
|
if (event.data.indexOf("showLoaderForPaypal") > -1) {
|
||||||
console.log(new Date() + ": Payment method paypal selected");
|
console.log(new Date() + ": Payment method paypal selected");
|
||||||
this.dispatchStoreAction(
|
this.updatePaymentMethod(paymentMethods.PAYPAL);
|
||||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
|
||||||
paymentMethods.PAYPAL,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updatePaymentMethod(paymentMethod) {
|
||||||
|
// if the payment method is not set yet, then set it based on what HOP sends us
|
||||||
|
if (
|
||||||
|
store.getters.order.payment.piaType == paymentMethods.PAY_NOW ||
|
||||||
|
store.getters.order.payment.piaType == paymentMethods.NONE
|
||||||
|
) {
|
||||||
|
console.log(new Date() + " UPDATE PaymentMethod from HOP:" + paymentMethod);
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||||
|
paymentMethod,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
setIFrameListener() {
|
setIFrameListener() {
|
||||||
window.addEventListener("message", (event) =>
|
window.addEventListener("message", (event) =>
|
||||||
this.handleIFrameContentWindowMessage(event)
|
this.handleIFrameContentWindowMessage(event)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue