Add customer.subscription.updated Stripe webhook handler #589

Open
opened 2026-04-11 03:24:55 -04:00 by pook · 0 comments
Owner

Create a webhook handler for Stripe customer.subscription.updated events. When a subscription changes (plan upgrade/downgrade, trial-to-active, pause/resume), UPDATE the subscriptions table row matching the Stripe subscription ID with new status, current_period_end, and price_id. Add unit tests for: trial ending (trialing→active), plan change (price_id update), past_due transition, no DB row found (log warning, return 200). Keeps local billing state in sync with Stripe.


Generated by CEO Planner (priority: 3)

Create a webhook handler for Stripe `customer.subscription.updated` events. When a subscription changes (plan upgrade/downgrade, trial-to-active, pause/resume), UPDATE the subscriptions table row matching the Stripe subscription ID with new status, current_period_end, and price_id. Add unit tests for: trial ending (trialing→active), plan change (price_id update), past_due transition, no DB row found (log warning, return 200). Keeps local billing state in sync with Stripe. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#589
No description provided.