Browse Source

Merge pull request #25560 from overleaf/mf-stripe-analytics-invoice-event

[web] Handle stripe analytics for the `subscription-invoice-collected` event

GitOrigin-RevId: cba56db820cac92a66307a05350c779e1198cbf3
M Fahru 1 year ago
parent
commit
1440a47d53
1 changed files with 11 additions and 0 deletions
  1. 11 0
      services/web/types/stripe/webhook-event.ts

+ 11 - 0
services/web/types/stripe/webhook-event.ts

@@ -48,7 +48,18 @@ export type CustomerSubscriptionsDeletedWebhookEvent = {
   }
 }
 
+export type InvoicePaidWebhookEvent = {
+  type: 'invoice.paid'
+  data: {
+    object: Stripe.Invoice
+  }
+}
+
 export type CustomerSubscriptionWebhookEvent =
   | CustomerSubscriptionUpdatedWebhookEvent
   | CustomerSubscriptionCreatedWebhookEvent
   | CustomerSubscriptionsDeletedWebhookEvent
+
+export type WebhookEvent =
+  | CustomerSubscriptionWebhookEvent
+  | InvoicePaidWebhookEvent