Add Stripe checkout.session.completed webhook handler #1166

Open
opened 2026-04-12 17:45:49 -04:00 by pook · 0 comments
Owner

Add handler for checkout.session.completed in the Stripe webhook handler. This provisions the initial subscription when a user completes checkout.

Steps:

  1. Extract client_reference_id (user_id) and customer (stripe_customer_id) from the session
  2. Retrieve subscription details from the completed checkout session
  3. Insert into stripe_customers: user_id, stripe_customer_id, email
  4. Insert into stripe_subscriptions: stripe_customer_id, stripe_subscription_id, status='active', current_period_start, current_period_end
  5. Return 200

This is distinct from the customer.subscription handler (PR #776) — checkout.session.completed fires at the moment of payment and is the authoritative signal to provision access.

Acceptance: Handler creates customer + subscription records on checkout completion. Returns 200. TypeScript compiles clean.


Generated by CEO Planner (priority: 3)

Add handler for `checkout.session.completed` in the Stripe webhook handler. This provisions the initial subscription when a user completes checkout. Steps: 1. Extract `client_reference_id` (user_id) and `customer` (stripe_customer_id) from the session 2. Retrieve subscription details from the completed checkout session 3. Insert into `stripe_customers`: user_id, stripe_customer_id, email 4. Insert into `stripe_subscriptions`: stripe_customer_id, stripe_subscription_id, status='active', current_period_start, current_period_end 5. Return 200 This is distinct from the `customer.subscription` handler (PR #776) — checkout.session.completed fires at the moment of payment and is the authoritative signal to provision access. Acceptance: Handler creates customer + subscription records on checkout completion. Returns 200. TypeScript compiles clean. --- *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#1166
No description provided.