From 1061ba8c3435274bd0daa14e6aeacc8f37e6fd6e Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Fri, 27 Oct 2023 10:45:21 -0400 Subject: [PATCH 1/2] CSR-1391 switch payment functionality --- src/layouts/payment/payment.vue | 72 ++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 15 deletions(-) diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 8c4a28e7f..dd3442bb8 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -20,6 +20,39 @@ scrolling="no"> +
Switch payment to:
+
+ +
+
or
+
+ +
+
or
+
+ +
{ + this.$refs.hopForm.submit(); + + const iframe = this.$refs.paymentFrame; + if (iframe) { + iframe.onload = () => { + if (iframe.contentWindow) { + if (this.paymentType == "cc") { + iframe.contentWindow.postMessage("CreditCardChosen", "*"); + } else if (this.paymentType == "ap") { + iframe.contentWindow.postMessage("afterpay", "*"); + } + } + }; + } + }); + }, async fetchSignatureInfo(signatureInfo) { if (this.isPaypal()) { this.$refs.loadingModal.showModal(); @@ -412,20 +467,7 @@ export default { this.authSignature = signatureInfo.signature; this.authSignatureStart = signatureInfo.startDate; - this.$nextTick(() => { - this.$refs.myForm.submit(); - - if (this.paymentType == "ap") { - const iframe = this.$refs.paymentFrame; - if (iframe) { - iframe.onload = () => { - if (iframe.contentWindow) { - iframe.contentWindow.postMessage("afterpay", "*"); - } - }; - } - } - }); + this.submitHopForm(); }, }, components: { From 248d666d9e96eb94d033fd78395ca4931f1e9516 Mon Sep 17 00:00:00 2001 From: Matt Caimi Date: Fri, 27 Oct 2023 13:43:43 -0400 Subject: [PATCH 2/2] CSR-1391 moved switch payment label to cms still need to refine the styling for this switch payment section, but i think it makes sense to commit this functionality for now --- src/layouts/payment/payment.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index dd3442bb8..2f6891138 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -20,7 +20,7 @@ scrolling="no"> -
Switch payment to:
+
{{ switchPaymentText }}