Răsfoiți Sursa

Merge pull request #26661 from overleaf/kh-support-3ds-for-stripe-us

[web] support 3DS for Stripe US

GitOrigin-RevId: b798b59601f3fb0df54afbcfb19434fbb0b38cdf
Kristina 1 an în urmă
părinte
comite
ffb7f23dfd

+ 0 - 1
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

+ 3 - 5
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)

+ 0 - 1
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