CSR-1391 paypal target updates

This commit is contained in:
Matt Caimi 2023-10-05 14:16:33 -04:00
parent 7afbc56a3a
commit 222bc81d49

View file

@ -32,7 +32,7 @@
<form <form
ref="myForm" ref="myForm"
id="card-data" id="card-data"
:target="isPaypal ? '_top' : 'card-frame'" :target="paypalPayment ? '_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" />
@ -219,11 +219,9 @@ export default {
lineItems: "Labor|189.99|1||Repair supplies|7.99|1", lineItems: "Labor|189.99|1||Repair supplies|7.99|1",
sgHeaderline1: this.getHeaderLine1(), sgHeaderline1: this.getHeaderLine1(),
sgHeaderline2: this.getHeaderLine2(), sgHeaderline2: this.getHeaderLine2(),
paypalPayment: this.isPaypal(),
}; };
}, },
async mounted() {
this.fetchSignatureInfo();
},
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
// Call APIs // Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
@ -239,8 +237,9 @@ export default {
const resultMap = await settleAllPromises(promiseResultMap); const resultMap = await settleAllPromises(promiseResultMap);
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next(async vm => {
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
vm.fetchSignatureInfo();
}); });
}, },
methods: { methods: {
@ -299,7 +298,9 @@ export default {
}, },
forwardButtonAction() {}, forwardButtonAction() {},
async fetchSignatureInfo() { async fetchSignatureInfo() {
this.$refs.loadingModal.showModal(); if (this.isPaypal()) {
this.$refs.loadingModal.showModal();
}
const signatureInfo = await this.dispatchStoreAction(storeActions.GET_SIGNATURE); const signatureInfo = await this.dispatchStoreAction(storeActions.GET_SIGNATURE);
this.authToken = signatureInfo.data.token; this.authToken = signatureInfo.data.token;
this.authSignature = signatureInfo.data.signature; this.authSignature = signatureInfo.data.signature;