Add Stripe webhook handler for checkout.session.completed event #744

Open
opened 2026-04-11 14:53:49 -04:00 by pook · 0 comments
Owner

Create a new handler in src/billing/webhooks/ for the checkout.session.completed Stripe event. This is the primary event that fires when a customer completes checkout.

Acceptance criteria:

  • Handler extracts customer ID, subscription ID, and plan from the session object
  • Upserts stripe_subscriptions row with status='active' and correct plan tier
  • Updates stripe_customers row with the linked subscription ID
  • Returns 200 to Stripe
  • Logs the event with session ID for audit trail
  • CRITICAL — without this handler, checkout payments do not activate user access to /api/generate

Follow the same patterns as the invoice.payment_succeeded handler if one exists.


Generated by CEO Planner (priority: 2)

Create a new handler in src/billing/webhooks/ for the `checkout.session.completed` Stripe event. This is the primary event that fires when a customer completes checkout. Acceptance criteria: - Handler extracts customer ID, subscription ID, and plan from the session object - Upserts stripe_subscriptions row with status='active' and correct plan tier - Updates stripe_customers row with the linked subscription ID - Returns 200 to Stripe - Logs the event with session ID for audit trail - CRITICAL — without this handler, checkout payments do not activate user access to /api/generate Follow the same patterns as the invoice.payment_succeeded handler if one exists. --- *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#744
No description provided.