commit
7b3430fe1e
1 changed files with 22 additions and 20 deletions
|
|
@ -694,41 +694,43 @@ export default {
|
|||
if (event.data.indexOf("afterpayClosed") > -1) {
|
||||
this.backButtonAction();
|
||||
}
|
||||
|
||||
if (event.data.indexOf("creditCardSubmit") > -1) {
|
||||
console.log(new Date() + ": Payment method credit card selected");
|
||||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.CREDIT_CARD,
|
||||
false
|
||||
);
|
||||
this.updatePaymentMethod(paymentMethods.CREDIT_CARD);
|
||||
this.setUIBlock(true);
|
||||
}
|
||||
|
||||
if (event.data.indexOf("afterpayPaymentReceived") > -1) {
|
||||
console.log(new Date() + ": Payment method afterpay selected");
|
||||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.AFTERPAY,
|
||||
false
|
||||
);
|
||||
this.updatePaymentMethod(paymentMethods.AFTERPAY);
|
||||
}
|
||||
|
||||
if (event.data.indexOf("applepayOpened") > -1) {
|
||||
console.log(new Date() + ": Payment method applepay selected");
|
||||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.APPLE_PAY,
|
||||
false
|
||||
);
|
||||
this.updatePaymentMethod(paymentMethods.APPLE_PAY);
|
||||
}
|
||||
|
||||
if (event.data.indexOf("showLoaderForPaypal") > -1) {
|
||||
console.log(new Date() + ": Payment method paypal selected");
|
||||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.PAYPAL,
|
||||
false
|
||||
);
|
||||
this.updatePaymentMethod(paymentMethods.PAYPAL);
|
||||
}
|
||||
}
|
||||
},
|
||||
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() {
|
||||
window.addEventListener("message", (event) =>
|
||||
this.handleIFrameContentWindowMessage(event)
|
||||
|
|
|
|||
Loading…
Reference in a new issue