Context
The new "Cancel Membership" feature (replacing "Deactivate Membership") schedules Stripe subscription cancellation at the end of the billing period via cancel_at_period_end: true. However, when the period actually ends and Stripe fires the customer.subscription.deleted event, we don't yet handle it.
What needs to happen
When customer.subscription.deleted fires (billing period has ended after cancellation):
- Deactivate member: Set
membershipActive: false in Firestore
- Draft profile: Set the member's Hugo profile to draft so it's hidden from the directory
- Unsubscribe from newsletter: Remove from MailerLite subscriber list
Technical details
- The webhook handler should be added to the existing Stripe webhook processing pipeline
- Follow the same patterns as the existing
charge.refunded handler
- The handler should be idempotent (safe to retry)
- Should send admin notification on failure
Related
- Cancel membership implementation: the PR that introduces
cancel_at_period_end behavior
Context
The new "Cancel Membership" feature (replacing "Deactivate Membership") schedules Stripe subscription cancellation at the end of the billing period via
cancel_at_period_end: true. However, when the period actually ends and Stripe fires thecustomer.subscription.deletedevent, we don't yet handle it.What needs to happen
When
customer.subscription.deletedfires (billing period has ended after cancellation):membershipActive: falsein FirestoreTechnical details
charge.refundedhandlerRelated
cancel_at_period_endbehavior