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