CSR-1390
use payment method constants
This commit is contained in:
parent
166b3a43d7
commit
b9750982a4
2 changed files with 10 additions and 8 deletions
|
|
@ -13,6 +13,7 @@ import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
import { paymentMethods } from "@/constants/payment-method-constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "payment-pia-return",
|
name: "payment-pia-return",
|
||||||
|
|
@ -30,18 +31,19 @@ export default {
|
||||||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
||||||
} else {
|
} else {
|
||||||
switch (store.getters.order.payment.piaType) {
|
switch (store.getters.order.payment.piaType) {
|
||||||
case "cc":
|
case paymentMethods.CREDIT_CARD:
|
||||||
case "ap":
|
case paymentMethods.AFTERPAY:
|
||||||
await this.processCreditCardResponse();
|
await this.processCreditCardResponse();
|
||||||
break;
|
break;
|
||||||
case "pp":
|
case paymentMethods.PAYPAL:
|
||||||
await this.processPaypalResponse();
|
await this.processPaypalResponse();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log("Unknown Pia type: " + store.getters.order.payment.piaType);
|
var msg = "Unknown Pia type: " + store.getters.order.payment.piaType;
|
||||||
|
console.log(msg);
|
||||||
baseMixin.methods.dispatchStoreAction(
|
baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.SAVE_PIA_ERROR_CODE,
|
storeActions.SAVE_PIA_ERROR_CODE,
|
||||||
piaError,
|
msg,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
|
|
|
||||||
|
|
@ -1648,9 +1648,9 @@ export const actions = {
|
||||||
isInsurance: order.payment.isInsurance,
|
isInsurance: order.payment.isInsurance,
|
||||||
parentAccountNumber: order.payment.parentAccountNumber,
|
parentAccountNumber: order.payment.parentAccountNumber,
|
||||||
inactivePromos: order.payment.inactivePromos,
|
inactivePromos: order.payment.inactivePromos,
|
||||||
isCreditCard: order.payment.piaType == "cc" ? true : false,
|
isCreditCard: order.payment.piaType == paymentMethods.CREDIT_CARD ? true : false,
|
||||||
isPaypal: order.payment.piaType == "pp" ? true : false,
|
isPaypal: order.payment.piaType == paymentMethods.PAYPAL ? true : false,
|
||||||
isAfterPay: order.payment.piaType == "ap" ? true : false,
|
isAfterPay: order.payment.piaType == paymentMethods.AFTERPAY ? true : false,
|
||||||
paypalToken: order.payment.paypalToken,
|
paypalToken: order.payment.paypalToken,
|
||||||
ccToken: {
|
ccToken: {
|
||||||
subscriptionId: order.payment.ccToken.subscriptionId,
|
subscriptionId: order.payment.ccToken.subscriptionId,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue