@@ -117,7 +117,7 @@ const handleSubscriptionUpdated = async (subscription: Stripe.Subscription): Pro
117117 const license = await LicenseRepo . getLicenseByStripePaymentId ( subscription . id )
118118
119119 await notificationEngine . sendNotification ( {
120- type : 'subscription_cancel_requested ' ,
120+ type : 'subscription_cancelled ' ,
121121 user : {
122122 id : license ?. user_id || 'unknown' ,
123123 email : 'N/A' // Email not available in subscription object
@@ -128,8 +128,9 @@ const handleSubscriptionUpdated = async (subscription: Stripe.Subscription): Pro
128128 customer_id : subscription . customer ,
129129 license_id : license ?. id ,
130130 cancel_at : subscription . cancel_at ? new Date ( subscription . cancel_at * 1000 ) : null ,
131- current_period_end : new Date ( subscription . current_period_end * 1000 ) ,
132- status : subscription . status
131+ cancel_at_period_end : subscription . cancel_at_period_end ,
132+ status : subscription . status ,
133+ message : 'User requested cancellation - will expire at period end'
133134 }
134135 } , [ 'discord' ] )
135136
@@ -228,6 +229,7 @@ const handleInvoicePaymentFailed = async (invoice: Stripe.Invoice): Promise<void
228229
229230export const WebhookService = {
230231 handleCheckoutSessionCompleted,
232+ handleSubscriptionUpdated,
231233 handleSubscriptionDeleted,
232234 handleInvoicePaymentFailed,
233235}
0 commit comments