Track reactive isPaypal field instead of non-reactive

This commit is contained in:
Chloe Herd 2023-11-21 12:38:14 -05:00
parent 7f17912f29
commit a357da3d90

View file

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