From 19dd003f8b835f756784df39e33390ea364cc973 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 13 Oct 2023 16:25:25 -0400 Subject: [PATCH] Don't autofill payment-method field if not defined in store --- src/layouts/payment-method/payment-method.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 612d27cb6..7123a9267 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -228,6 +228,10 @@ export default { getPaymentMethodFromStore() { const isPia = store.getters.order.payment.isPia; + if (isPia === null || isPia === undefined) { + return null; + } + if (isPia) { return store.getters.order.payment.piaType; } else { @@ -271,7 +275,11 @@ export default { default: this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false); this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); - this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); + this.dispatchStoreAction( + storeActions.SAVE_PAYMENT_METHOD_CHOICE, + this.paymentMethod, + false + ); await submitWorkOrder({ pageNameToLog: "payment-method" }); this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_FORWARD, @@ -293,7 +301,11 @@ export default { // since we're leaving the site for pia, clear any save session promises that we will not be able to resolve when we return await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); - await this.dispatchStoreAction(storeActions.SAVE_PAYMENT_METHOD_CHOICE, this.paymentMethod, false); + await this.dispatchStoreAction( + storeActions.SAVE_PAYMENT_METHOD_CHOICE, + this.paymentMethod, + false + ); // make sure pia error codes are reset this.dispatchStoreAction(storeActions.SAVE_PIA_ERROR_CODE, null, false);