Add POST /api/billing/webhook endpoint with Stripe signature verification #659

Open
opened 2026-04-11 09:47:19 -04:00 by pook · 0 comments
Owner

Create POST /api/billing/webhook handler: (1) verify Stripe webhook signature using STRIPE_WEBHOOK_SECRET, (2) handle checkout.session.completed — extract customer/subscription IDs, upsert stripe_customers and stripe_subscriptions, (3) handle customer.subscription.updated/deleted — sync subscription status in DB, (4) return 200 for handled/ignored events, 400 for bad signature. Bridges the gap between DB migration (#651) and webhook test (#652). Acceptance: signature verification works, 3 event types handled, DB writes succeed, correct HTTP status codes returned.


Generated by CEO Planner (priority: 2)

Create POST /api/billing/webhook handler: (1) verify Stripe webhook signature using STRIPE_WEBHOOK_SECRET, (2) handle checkout.session.completed — extract customer/subscription IDs, upsert stripe_customers and stripe_subscriptions, (3) handle customer.subscription.updated/deleted — sync subscription status in DB, (4) return 200 for handled/ignored events, 400 for bad signature. Bridges the gap between DB migration (#651) and webhook test (#652). Acceptance: signature verification works, 3 event types handled, DB writes succeed, correct HTTP status codes returned. --- *Generated by CEO Planner (priority: 2)*
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#659
No description provided.