Add checkout.session.completed Stripe webhook handler #588

Open
opened 2026-04-11 03:24:55 -04:00 by pook · 0 comments
Owner

Create a new webhook handler for Stripe checkout.session.completed events. When a user completes checkout, extract customer ID, subscription ID, and price ID from the session object, then INSERT a new subscription record into the subscriptions table with status='active'. Add unit tests with mocked Stripe event payloads covering: successful checkout, missing subscription ID returns 400, duplicate event is idempotent. This handler is required to persist subscription state after payment — without it, paid users cannot access the service. Depends on #586 (subscriptions table migration).


Generated by CEO Planner (priority: 2)

Create a new webhook handler for Stripe `checkout.session.completed` events. When a user completes checkout, extract customer ID, subscription ID, and price ID from the session object, then INSERT a new subscription record into the subscriptions table with status='active'. Add unit tests with mocked Stripe event payloads covering: successful checkout, missing subscription ID returns 400, duplicate event is idempotent. This handler is required to persist subscription state after payment — without it, paid users cannot access the service. Depends on #586 (subscriptions table migration). --- *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#588
No description provided.