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 loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||
import { Form } from "vee-validate";
|
||||
import { paymentMethods } from "@/constants/payment-method-constants";
|
||||
|
||||
export default {
|
||||
name: "payment-pia-return",
|
||||
|
|
@ -30,18 +31,19 @@ export default {
|
|||
this.$router.navigateWithoutSaving(this.navigationScenarios.PIA_ERROR, this.$route);
|
||||
} else {
|
||||
switch (store.getters.order.payment.piaType) {
|
||||
case "cc":
|
||||
case "ap":
|
||||
case paymentMethods.CREDIT_CARD:
|
||||
case paymentMethods.AFTERPAY:
|
||||
await this.processCreditCardResponse();
|
||||
break;
|
||||
case "pp":
|
||||
case paymentMethods.PAYPAL:
|
||||
await this.processPaypalResponse();
|
||||
break;
|
||||
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(
|
||||
storeActions.SAVE_PIA_ERROR_CODE,
|
||||
piaError,
|
||||
msg,
|
||||
false
|
||||
);
|
||||
this.$router.navigateWithoutSaving(
|
||||
|
|
|
|||
|
|
@ -1648,9 +1648,9 @@ export const actions = {
|
|||
isInsurance: order.payment.isInsurance,
|
||||
parentAccountNumber: order.payment.parentAccountNumber,
|
||||
inactivePromos: order.payment.inactivePromos,
|
||||
isCreditCard: order.payment.piaType == "cc" ? true : false,
|
||||
isPaypal: order.payment.piaType == "pp" ? true : false,
|
||||
isAfterPay: order.payment.piaType == "ap" ? true : false,
|
||||
isCreditCard: order.payment.piaType == paymentMethods.CREDIT_CARD ? true : false,
|
||||
isPaypal: order.payment.piaType == paymentMethods.PAYPAL ? true : false,
|
||||
isAfterPay: order.payment.piaType == paymentMethods.AFTERPAY ? true : false,
|
||||
paypalToken: order.payment.paypalToken,
|
||||
ccToken: {
|
||||
subscriptionId: order.payment.ccToken.subscriptionId,
|
||||
|
|
|
|||
Loading…
Reference in a new issue