CSR-1391 afterpay button and pop up
This commit is contained in:
parent
222bc81d49
commit
d6d0540d7f
2 changed files with 31 additions and 0 deletions
|
|
@ -66,6 +66,15 @@
|
||||||
alt="PayPal" />
|
alt="PayPal" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-on:click="afterpay">
|
||||||
|
<img
|
||||||
|
src="https://business.afterpay.com/rs/539-RJA-633/images/AP_logo_badge_6328x2204_blackmint_png.png"
|
||||||
|
width="100"
|
||||||
|
height="26"
|
||||||
|
alt="Afterpay" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<navbar
|
<navbar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
|
@ -221,6 +230,16 @@ export default {
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
async afterpay() {
|
||||||
|
this.$refs.loadingModal.showModal();
|
||||||
|
this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false);
|
||||||
|
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||||
|
await this.dispatchStoreAction(storeActions.SAVE_PAY_NOW_TYPE, "ap", false);
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_PAY_NOW,
|
||||||
|
this.$route
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
damageInfo() {
|
damageInfo() {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<hr class="mt-0" />
|
<hr class="mt-0" />
|
||||||
<div id="card-container">
|
<div id="card-container">
|
||||||
<iframe
|
<iframe
|
||||||
|
ref="paymentFrame"
|
||||||
class="hop-iframe payment-iframe"
|
class="hop-iframe payment-iframe"
|
||||||
name="card-frame"
|
name="card-frame"
|
||||||
id="card-frame"
|
id="card-frame"
|
||||||
|
|
@ -308,6 +309,17 @@ export default {
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.myForm.submit();
|
this.$refs.myForm.submit();
|
||||||
|
|
||||||
|
if (this.paymentType == "ap") {
|
||||||
|
const iframe = this.$refs.paymentFrame;
|
||||||
|
if (iframe) {
|
||||||
|
iframe.onload = () => {
|
||||||
|
if (iframe.contentWindow) {
|
||||||
|
iframe.contentWindow.postMessage("afterpay", "*");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue