From a79171479bc0264388ee3093ba2f8e4392001e15 Mon Sep 17 00:00:00 2001 From: Liangjun Song <146005915+adai26@users.noreply.github.com> Date: Thu, 9 Oct 2025 08:34:51 +0100 Subject: [PATCH] Merge pull request #28847 from overleaf/kh-verify-trials [web] ensure trials work for Stripe custom checkout GitOrigin-RevId: 9918e768502d50d61cf1a01dfc244fc57411ed35 --- services/web/types/stripe/webhook-event.ts | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/services/web/types/stripe/webhook-event.ts b/services/web/types/stripe/webhook-event.ts index c9cb304e21..f882847d6f 100644 --- a/services/web/types/stripe/webhook-event.ts +++ b/services/web/types/stripe/webhook-event.ts @@ -77,6 +77,34 @@ export type PaymentIntentPaymentFailedWebhookEvent = { request: Stripe.Event.Request } +export type SetupIntentSetupFailedWebhookEvent = { + type: 'setup_intent.setup_failed' + data: { + object: Stripe.SetupIntent & { + metadata: { + userId?: string + isTrial?: string + checkoutSource?: 'hosted-checkout' | 'elements-checkout' | undefined + } + } + } + request: Stripe.Event.Request +} + +export type SetupIntentSucceededWebhookEvent = { + type: 'setup_intent.succeeded' + data: { + object: Stripe.SetupIntent & { + metadata: { + userId?: string + isTrial?: string + checkoutSource?: 'hosted-checkout' | 'elements-checkout' | undefined + } + } + } + request: Stripe.Event.Request +} + export type InvoiceVoidedWebhookEvent = { type: 'invoice.voided' data: { @@ -122,6 +150,8 @@ export type WebhookEvent = | InvoicePaidWebhookEvent | InvoiceVoidedWebhookEvent | PaymentIntentPaymentFailedWebhookEvent + | SetupIntentSetupFailedWebhookEvent + | SetupIntentSucceededWebhookEvent | InvoiceOverdueWebhookEvent | CheckoutSessionCompletedWebhookEvent | CustomerCreatedWebhookEvent