From c83644090e60b854719ff6d98bff65137d892003 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 29 Nov 2023 06:50:27 -0500 Subject: [PATCH 1/2] 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) From 021d7a063fd902c80d37ada4a685deb317e6fe5c Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 29 Nov 2023 06:53:18 -0500 Subject: [PATCH 2/2] Prettified --- src/layouts/payment-method/payment-method.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index b81ed9d5a..a480752e3 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -365,7 +365,8 @@ export default { storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, { billToAccountNumber: "87291", - providerNumber: this.$store.getters.order.serviceLocation.provider.providerNumber, + 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,