Преглед изворни кода

Merge pull request #27551 from overleaf/kh-fix-failing-webhook-event

[web] prefer metadata over email for invoice.paid events

GitOrigin-RevId: cfb06333b62dfb5018bcdee0f153a812d19ff328
M Fahru пре 1 година
родитељ
комит
34a47c7767
1 измењених фајлова са 9 додато и 1 уклоњено
  1. 9 1
      services/web/types/stripe/webhook-event.ts

+ 9 - 1
services/web/types/stripe/webhook-event.ts

@@ -53,7 +53,15 @@ export type CustomerSubscriptionsDeletedWebhookEvent = {
 export type InvoicePaidWebhookEvent = {
   type: 'invoice.paid'
   data: {
-    object: Stripe.Invoice
+    object: Stripe.Invoice & {
+      parent: Stripe.Invoice.Parent & {
+        subscription_details: Stripe.Invoice.Parent.SubscriptionDetails & {
+          metadata: {
+            adminUserId?: string
+          }
+        }
+      }
+    }
   }
   request: Stripe.Event.Request
 }