Stripe webhook handlers: real implementations + Portal/Checkout endpoints #178

Open
opened 2026-05-14 17:30:26 +00:00 by chihlasm · 0 comments
Owner

Replace stub handlers in backend/app/core/stripe_handlers.py with real implementations.

Required

  • Signed webhook payload verification (stripe.Webhook.construct_event)
  • Idempotent processing keyed on event.id
  • Real state updates for:
    • checkout.session.completed
    • invoice.paid
    • invoice.payment_failed
    • customer.subscription.updated
    • customer.subscription.deleted
  • Customer Portal session creation endpoint
  • Checkout session creation endpoint (per plan + interval)
  • Subscription state reconciliation job for missed webhooks

Blocked by

Pricing model decision (defines plans & prices in Stripe).

Acceptance

Customer can self-serve checkout, upgrade/downgrade, and cancel through the Portal; subscription table stays in sync.

Replace stub handlers in `backend/app/core/stripe_handlers.py` with real implementations. ## Required - Signed webhook payload verification (`stripe.Webhook.construct_event`) - Idempotent processing keyed on `event.id` - Real state updates for: - `checkout.session.completed` - `invoice.paid` - `invoice.payment_failed` - `customer.subscription.updated` - `customer.subscription.deleted` - Customer Portal session creation endpoint - Checkout session creation endpoint (per plan + interval) - Subscription state reconciliation job for missed webhooks ## Blocked by Pricing model decision (defines plans & prices in Stripe). ## Acceptance Customer can self-serve checkout, upgrade/downgrade, and cancel through the Portal; subscription table stays in sync.
Sign in to join this conversation.