|
@@ -1,15 +1,18 @@
|
|
|
import Stripe from 'stripe'
|
|
import Stripe from 'stripe'
|
|
|
|
|
|
|
|
|
|
+type StripeSubscription = Stripe.Subscription & {
|
|
|
|
|
+ metadata: {
|
|
|
|
|
+ billing_migration_id?: string
|
|
|
|
|
+ recurly_to_stripe_migration_status?: 'in_progress' | 'completed'
|
|
|
|
|
+ }
|
|
|
|
|
+ customer: string
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export interface CustomerSubscriptionUpdatedWebhookEvent
|
|
export interface CustomerSubscriptionUpdatedWebhookEvent
|
|
|
extends Stripe.EventBase {
|
|
extends Stripe.EventBase {
|
|
|
type: 'customer.subscription.updated'
|
|
type: 'customer.subscription.updated'
|
|
|
data: {
|
|
data: {
|
|
|
- object: Stripe.Subscription & {
|
|
|
|
|
- metadata: {
|
|
|
|
|
- adminUserId?: string
|
|
|
|
|
- }
|
|
|
|
|
- customer: string
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ object: StripeSubscription
|
|
|
// https://docs.stripe.com/api/events/object?api-version=2025-04-30.basil#event_object-data-previous_attributes
|
|
// https://docs.stripe.com/api/events/object?api-version=2025-04-30.basil#event_object-data-previous_attributes
|
|
|
previous_attributes: {
|
|
previous_attributes: {
|
|
|
cancel_at_period_end?: boolean // will only be present if the subscription was cancelled or reactivated
|
|
cancel_at_period_end?: boolean // will only be present if the subscription was cancelled or reactivated
|
|
@@ -34,12 +37,7 @@ export interface CustomerSubscriptionCreatedWebhookEvent
|
|
|
extends Stripe.EventBase {
|
|
extends Stripe.EventBase {
|
|
|
type: 'customer.subscription.created'
|
|
type: 'customer.subscription.created'
|
|
|
data: {
|
|
data: {
|
|
|
- object: Stripe.Subscription & {
|
|
|
|
|
- metadata: {
|
|
|
|
|
- adminUserId?: string
|
|
|
|
|
- }
|
|
|
|
|
- customer: string
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ object: StripeSubscription
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -47,12 +45,7 @@ export interface CustomerSubscriptionsDeletedWebhookEvent
|
|
|
extends Stripe.EventBase {
|
|
extends Stripe.EventBase {
|
|
|
type: 'customer.subscription.deleted'
|
|
type: 'customer.subscription.deleted'
|
|
|
data: {
|
|
data: {
|
|
|
- object: Stripe.Subscription & {
|
|
|
|
|
- metadata: {
|
|
|
|
|
- adminUserId?: string
|
|
|
|
|
- }
|
|
|
|
|
- customer: string
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ object: StripeSubscription
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -63,7 +56,8 @@ export interface InvoicePaidWebhookEvent extends Stripe.EventBase {
|
|
|
parent: Stripe.Invoice.Parent & {
|
|
parent: Stripe.Invoice.Parent & {
|
|
|
subscription_details: Stripe.Invoice.Parent.SubscriptionDetails & {
|
|
subscription_details: Stripe.Invoice.Parent.SubscriptionDetails & {
|
|
|
metadata: {
|
|
metadata: {
|
|
|
- adminUserId?: string
|
|
|
|
|
|
|
+ billing_migration_id?: string
|
|
|
|
|
+ recurly_to_stripe_migration_status?: 'in_progress' | 'completed'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|