Merge pull request #1557 from Safelite/feature/csr-1784

Track reactive isPaypal field instead of non-reactive
This commit is contained in:
chloeherdsafelite 2023-11-21 13:30:00 -05:00 committed by GitHub
commit 61e8578bd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@
<form
ref="hopForm"
id="card-data"
:target="paypalPayment ? '_top' : 'card-frame'"
:target="isPaypal ? '_top' : 'card-frame'"
method="POST"
:action="checkoutUrl">
<input type="hidden" name="paymentType" :value="paymentType" />
@ -229,7 +229,6 @@ export default {
totalAmount: this.getAmountDue(),
displayAmount: this.getDisplayAmountDue(),
piaLineItems: "",
paypalPayment: this.isPaypal(),
lineItems: [],
availableVaps: [],
};
@ -388,13 +387,13 @@ export default {
return `${protocol}//${hostname}:${port}/fmg/css/hop-styling.css`;
},
getHeaderLine1() {
if (!this.isPaypal()) {
if (!this.isPaypal) {
return this.getCmsContent("PIAHeaderLine1", "Text");
}
return "";
},
getHeaderLine2() {
if (!this.isPaypal()) {
if (!this.isPaypal) {
return this.getCmsContent("PIAHeaderLine2", "Text");
}
return "";
@ -405,6 +404,12 @@ export default {
damageInfo() {
return this.$store.getters.damage;
},
isPaypal() {
if (this.paymentType == "pp") {
return true;
}
return false;
},
},
methods: {
arePagePrerequisitesValid() {
@ -544,12 +549,6 @@ export default {
getDisplayAmountDue() {
return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
},
isPaypal() {
if (this.getPaymentType() == "pp") {
return true;
}
return false;
},
backButtonAction() {
// The only way I could figure out how to get navigation to work on a page with the iframe.
// This is also how a cancel from Paypal would work. Just a redirect to the payment-method page.
@ -585,7 +584,7 @@ export default {
});
},
async fetchSignatureInfo(signatureInfo) {
if (this.isPaypal()) {
if (this.isPaypal) {
this.$refs.loadingModal.showModal();
}