Merge pull request #2548 from Safelite/feature/CASH-580

CASH-580: Defect fixes and improvements
This commit is contained in:
Chris 2025-05-22 09:36:19 -04:00 committed by GitHub
commit 1f59e6f023
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,7 @@
<div class="payment-method-question"> <div class="payment-method-question">
<buttonQuestion <buttonQuestion
v-if="!isAfterpay" v-if="showSwitchPaymentMethod"
groupName="payment-method" groupName="payment-method"
buttonTypeString="payment-method-list-button" buttonTypeString="payment-method-list-button"
:buttonTypeObject="paymentMethodListButton" :buttonTypeObject="paymentMethodListButton"
@ -292,6 +292,7 @@ export default {
availableVaps: [], availableVaps: [],
shouldBlockInteraction: false, shouldBlockInteraction: false,
paymentMethodListButton: paymentMethodListButton, paymentMethodListButton: paymentMethodListButton,
showSwitchPaymentMethod: !this.isAfterpay(),
}; };
}, },
props: { props: {
@ -514,12 +515,6 @@ export default {
} }
return false; return false;
}, },
isAfterpay() {
if (this.paymentType == "ap") {
return true;
}
return false;
},
shouldDisplayPiaCCAlert() { shouldDisplayPiaCCAlert() {
return this.shouldDisplayPiaAlert(paymentMethods.CREDIT_CARD); return this.shouldDisplayPiaAlert(paymentMethods.CREDIT_CARD);
}, },
@ -828,6 +823,12 @@ export default {
this.backButtonAction(); this.backButtonAction();
} }
if (event.data.indexOf("afterpayOpened") > -1) {
console.log(new Date() + ": Payment method afterpay selected");
this.updatePaymentMethod(paymentMethods.AFTERPAY);
this.showSwitchPaymentMethod = false;
}
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.updatePaymentMethod(paymentMethods.CREDIT_CARD); this.updatePaymentMethod(paymentMethods.CREDIT_CARD);
@ -865,11 +866,6 @@ export default {
} }
}, },
switchToAfterpay() { switchToAfterpay() {
this.dispatchStoreAction(
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
paymentMethods.AFTERPAY,
false
);
const iframe = this.$refs.paymentFrame; const iframe = this.$refs.paymentFrame;
if (iframe) { if (iframe) {
iframe.contentWindow.postMessage("afterpay", "*"); iframe.contentWindow.postMessage("afterpay", "*");
@ -892,6 +888,12 @@ export default {
shouldDisplayPiaAlert(payMethod) { shouldDisplayPiaAlert(payMethod) {
return this.$route?.query?.piaErrorType === payMethod; return this.$route?.query?.piaErrorType === payMethod;
}, },
isAfterpay() {
if (this.paymentType == "ap") {
return true;
}
return false;
},
}, },
components: { components: {
funnelHeader, funnelHeader,
@ -915,6 +917,10 @@ export default {
background-color: red; background-color: red;
} }
.payment-method-question {
padding: 0 1.5rem;
}
.ui-block { .ui-block {
position: fixed; position: fixed;
top: 0; top: 0;