mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
Merge pull request #26661 from overleaf/kh-support-3ds-for-stripe-us
[web] support 3DS for Stripe US GitOrigin-RevId: b798b59601f3fb0df54afbcfb19434fbb0b38cdf
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user