Pārlūkot izejas kodu

[web] update webhook handler to include cancel_at (#32165)

* update webhook handler to include cancel_at
* guard against accidentally marking subscription event as canceled
* fix cancellation edgecase (reactivating a subscription that was canceled from Stripe Dashboard and also has a non-migration schedule)

GitOrigin-RevId: a872e91afa19094d4ae859293fc9669ea3e528f2
Kristina 4 mēneši atpakaļ
vecāks
revīzija
e4e4193d55
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      services/web/types/stripe/webhook-event.ts

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

@@ -19,6 +19,7 @@ export interface CustomerSubscriptionUpdatedWebhookEvent
     // https://docs.stripe.com/api/events/object?api-version=2025-04-30.basil#event_object-data-previous_attributes
     previous_attributes: {
       cancel_at_period_end?: boolean // will only be present if the subscription was cancelled or reactivated
+      cancel_at?: number | null // will only be present if the subscription was cancelled or reactivated
       items?: {
         // will be present if the subscription was downgraded, upgraded, or renewed
         data: [