From b6e9bb29d5db0714bd9d42c1f244bf68b9fb2e79 Mon Sep 17 00:00:00 2001 From: Kristina <7614497+khjrtbrg@users.noreply.github.com> Date: Mon, 30 Jun 2025 09:59:13 +0200 Subject: [PATCH] Merge pull request #26661 from overleaf/kh-support-3ds-for-stripe-us [web] support 3DS for Stripe US GitOrigin-RevId: b798b59601f3fb0df54afbcfb19434fbb0b38cdf --- services/web/app/views/subscriptions/dashboard-react.pug | 1 - .../subscription/util/handle-stripe-payment-action.ts | 8 +++----- services/web/frontend/js/utils/meta.ts | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/web/app/views/subscriptions/dashboard-react.pug b/services/web/app/views/subscriptions/dashboard-react.pug index b253097d25..854f788b79 100644 --- a/services/web/app/views/subscriptions/dashboard-react.pug +++ b/services/web/app/views/subscriptions/dashboard-react.pug @@ -79,7 +79,6 @@ block append meta meta(name='ol-user' data-type='json' content=user) if personalSubscription && personalSubscription.payment meta(name='ol-recurlyApiKey' content=settings.apis.recurly.publicKey) - meta(name='ol-stripeUKApiKey' content=settings.apis.stripeUK.publishableKey) meta( name='ol-recommendedCurrency' content=personalSubscription.payment.currency diff --git a/services/web/frontend/js/features/subscription/util/handle-stripe-payment-action.ts b/services/web/frontend/js/features/subscription/util/handle-stripe-payment-action.ts index f533cba730..9912c39f89 100644 --- a/services/web/frontend/js/features/subscription/util/handle-stripe-payment-action.ts +++ b/services/web/frontend/js/features/subscription/util/handle-stripe-payment-action.ts @@ -1,16 +1,14 @@ import { FetchError, postJSON } from '@/infrastructure/fetch-json' -import getMeta from '../../../utils/meta' import { loadStripe } from '@stripe/stripe-js/pure' export default async function handleStripePaymentAction( error: FetchError ): Promise<{ handled: boolean }> { const clientSecret = error?.data?.clientSecret + const publicKey = error?.data?.publicKey - if (clientSecret) { - // TODO: support both US and UK Stripe accounts - const stripeUKPublicKey = getMeta('ol-stripeUKApiKey') - const stripe = await loadStripe(stripeUKPublicKey) + if (clientSecret && publicKey) { + const stripe = await loadStripe(publicKey) if (stripe) { const manualConfirmationFlow = await stripe.confirmCardPayment(clientSecret) diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index 8c620d234e..69552f9b1a 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -248,7 +248,6 @@ export interface Meta { 'ol-ssoDisabled': boolean 'ol-ssoErrorMessage': string 'ol-stripeCustomerId': string - 'ol-stripeUKApiKey': string 'ol-subscription': any // TODO: mixed types, split into two fields 'ol-subscriptionChangePreview': SubscriptionChangePreview 'ol-subscriptionId': string