From c83644090e60b854719ff6d98bff65137d892003 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 29 Nov 2023 06:50:27 -0500 Subject: [PATCH] Now calculating taxes on revalidated promos --- src/layouts/payment-method/payment-method.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 6fa1b02a6..d7e8c465b 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -347,6 +347,7 @@ export default { "payment-method", false ); + // Handle error alerts here, success alerts are handled in the watcher if (revalidatePromoResponse.errors.length) { getNewlyInactivatedPromos( @@ -357,6 +358,24 @@ export default { this.$refs.funnelHeader.pushGlobalAlert(errorAlert, errorAlert.shouldAutoFade); }); } + + if (revalidatePromoResponse.promoLineItems.length > 0) { + await baseMixin.methods.dispatchStoreActionWithLogging( + storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, + { + billToAccountNumber: "87291", + providerNumber: this.$store.getters.order.serviceLocation.provider.providerNumber, + appointmentType: this.$store.getters.order.serviceLocation.appointmentType, + serviceLocationCity: this.$store.getters.order.serviceLocation.city, + serviceLocationState: this.$store.getters.order.serviceLocation.state, + serviceLocationZipCode: this.$store.getters.order.serviceLocation.zipCode, + pricedLineItems: revalidatePromoResponse.promoLineItems, + }, + "payment-method", + false + ); + } + this.lineItems.promos = revalidatePromoResponse.promoLineItems; this.inactivePromos = revalidatePromoResponse.errors.map((x) => getPromoCodeWithoutBundleIdentifier(x.promoCode)