From 5ba31ab14fed0fe996024ef4e831223f435019f3 Mon Sep 17 00:00:00 2001 From: M Fahru Date: Thu, 8 May 2025 09:28:22 -0700 Subject: [PATCH] Merge pull request #25363 from overleaf/mf-stripe-webhook-delete-subscription [web] Delete "expired" subscription in Stripe (in Stripe, this is called "canceled" status) GitOrigin-RevId: 847cf431c2f6edd7ec6c4e17137d163e450dc4f1 --- services/web/types/stripe/webhook-event.ts | 7 ++++++- services/web/types/subscription/dashboard/subscription.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/services/web/types/stripe/webhook-event.ts b/services/web/types/stripe/webhook-event.ts index 648f26b8dc..a53c03f440 100644 --- a/services/web/types/stripe/webhook-event.ts +++ b/services/web/types/stripe/webhook-event.ts @@ -1,5 +1,10 @@ +type StripeWebhookEventType = + | 'customer.subscription.created' + | 'customer.subscription.updated' + | 'customer.subscription.deleted' + export type CustomerSubscriptionWebhookEvent = { - type: 'customer.subscription.created' + type: StripeWebhookEventType data: { object: { id: string diff --git a/services/web/types/subscription/dashboard/subscription.ts b/services/web/types/subscription/dashboard/subscription.ts index 1272f33eb0..4b9c9de57c 100644 --- a/services/web/types/subscription/dashboard/subscription.ts +++ b/services/web/types/subscription/dashboard/subscription.ts @@ -111,3 +111,8 @@ export type PaymentProvider = { trialStartedAt?: Nullable trialEndsAt?: Nullable } + +export type SubscriptionRequesterData = { + id?: string + ip?: string +}