From 43dbffef9af51b737d36a34038752dd363b58e47 Mon Sep 17 00:00:00 2001 From: julianajlk Date: Thu, 25 Apr 2024 17:15:54 -0400 Subject: [PATCH] fix: Update on user location variables for the Payment Method Messaging Element --- src/payment/checkout/payment-form/StripePaymentForm.jsx | 6 +++--- src/payment/payment-methods/stripe/service.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/payment/checkout/payment-form/StripePaymentForm.jsx b/src/payment/checkout/payment-form/StripePaymentForm.jsx index fe5d5e20a..ac18cdebe 100644 --- a/src/payment/checkout/payment-form/StripePaymentForm.jsx +++ b/src/payment/checkout/payment-form/StripePaymentForm.jsx @@ -74,10 +74,10 @@ const StripePaymentForm = ({ // Check if should show PaymentMethodMessagingElement, as it only renders // for specific countries, if country code and currency are known, and they must match - const userLocationCountryCode = new Cookies().get(getConfig().LOCATION_OVERRIDE_COOKIE) - || new Cookies().get(getConfig().USER_LOCATION_COOKIE_NAME); + const userLocationCountryCode = new Cookies().get(getConfig().USER_LOCATION_COOKIE_NAME) + || new Cookies().get(getConfig().LOCATION_OVERRIDE_COOKIE); const shouldDisplayPaymentMethodMessagingElement = ( - (!!userLocationCountryCode || !!locationCountryCode) && !!orderTotal && !!currency + !!(userLocationCountryCode || locationCountryCode) && !!orderTotal && !!currency ); // Loading button should appear when: basket and stripe elements are loading, quantity is updating and not submitting diff --git a/src/payment/payment-methods/stripe/service.js b/src/payment/payment-methods/stripe/service.js index 62e59c0ef..f4c1be16d 100644 --- a/src/payment/payment-methods/stripe/service.js +++ b/src/payment/payment-methods/stripe/service.js @@ -84,7 +84,7 @@ export default async function checkout( const postData = formurlencoded({ payment_intent_id: result.paymentIntent.id, skus, - dynamic_payment_methods_enabled: basket.isDynamicPaymentMethodsEnabled, + dynamic_payment_methods_enabled: basket.isDynamicPaymentMethodsEnabled || false, }); await getAuthenticatedHttpClient() .post(