Add Stripe customer.subscription.updated webhook handler #833

Open
opened 2026-04-11 21:44:08 -04:00 by pook · 0 comments
Owner

Add a handler in the Stripe webhook route for customer.subscription.updated events. When a subscription changes (plan upgrade/downgrade, trial conversion, quantity change), sync the new state to the database.

Acceptance criteria:

  • Parse customer.subscription.updated event from webhook body
  • Look up existing subscription by stripe_subscription_id
  • Update status, tier/plan, current_period_start, current_period_end columns
  • Skip if no existing subscription row found (log warning, return 200)
  • Add unit test: handler updates subscription row with new plan and period dates
  • Add unit test: handler returns 200 and logs warning when subscription not found in DB
  • Revenue blocker: without this handler, plan changes made via Stripe Customer Portal won't take effect in the app

Generated by CEO Planner (priority: 3)

Add a handler in the Stripe webhook route for `customer.subscription.updated` events. When a subscription changes (plan upgrade/downgrade, trial conversion, quantity change), sync the new state to the database. Acceptance criteria: - Parse `customer.subscription.updated` event from webhook body - Look up existing subscription by stripe_subscription_id - Update status, tier/plan, current_period_start, current_period_end columns - Skip if no existing subscription row found (log warning, return 200) - Add unit test: handler updates subscription row with new plan and period dates - Add unit test: handler returns 200 and logs warning when subscription not found in DB - Revenue blocker: without this handler, plan changes made via Stripe Customer Portal won't take effect in the app --- *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#833
No description provided.