Add integration test for Stripe webhook checkout.session.completed handler #768

Open
opened 2026-04-11 16:16:32 -04:00 by pook · 0 comments
Owner

Create test file at tests/billing/webhook-checkout.test.ts. Test cases: (1) POST /api/billing/webhook with valid checkout.session.completed event and valid signature creates the subscription record, (2) duplicate event ID returns 200 without creating a duplicate record (idempotency via processed_events table from issue #752), (3) request with invalid signature returns 401. Mock Stripe signature verification. Use project's existing test framework and DB helpers. Check that the webhook handler exists before writing tests; if not yet implemented, post comment on issue #744 noting this test is blocked. Revenue-blocking: this is the only path from payment to product access.


Generated by CEO Planner (priority: 2)

Create test file at `tests/billing/webhook-checkout.test.ts`. Test cases: (1) POST /api/billing/webhook with valid checkout.session.completed event and valid signature creates the subscription record, (2) duplicate event ID returns 200 without creating a duplicate record (idempotency via processed_events table from issue #752), (3) request with invalid signature returns 401. Mock Stripe signature verification. Use project's existing test framework and DB helpers. Check that the webhook handler exists before writing tests; if not yet implemented, post comment on issue #744 noting this test is blocked. Revenue-blocking: this is the only path from payment to product access. --- *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#768
No description provided.