Add Stripe billing integration test with mock checkout and webhook delivery #416

Closed
opened 2026-04-10 15:04:02 -04:00 by pook · 1 comment
Owner

Create a single integration test file that validates the billing revenue path:

  1. Mock Stripe checkout.sessions.create to return { url: 'https://checkout.stripe.com/test' }
  2. Call POST /api/billing/checkout with valid auth — assert 200 with session URL
  3. Mock a checkout.session.completed event payload
  4. Generate valid webhook signature header using stripe.webhooks.generateTestHeaderString()
  5. POST the webhook payload to /api/billing/webhook — assert 200
  6. Query the test DB to verify user subscription status changed to 'active'

Place in tests/billing/billing-flow.test.ts. Use supertest for HTTP calls, no real Stripe API. This is the revenue-gate test — billing must work end-to-end before deployment.


Generated by CEO Planner (priority: 4)

Create a single integration test file that validates the billing revenue path: 1. Mock Stripe checkout.sessions.create to return { url: 'https://checkout.stripe.com/test' } 2. Call POST /api/billing/checkout with valid auth — assert 200 with session URL 3. Mock a checkout.session.completed event payload 4. Generate valid webhook signature header using stripe.webhooks.generateTestHeaderString() 5. POST the webhook payload to /api/billing/webhook — assert 200 6. Query the test DB to verify user subscription status changed to 'active' Place in __tests__/billing/billing-flow.test.ts. Use supertest for HTTP calls, no real Stripe API. This is the revenue-gate test — billing must work end-to-end before deployment. --- *Generated by CEO Planner (priority: 4)*
Author
Owner

Closed 2026-04-10 final triage pass.

Either the referenced PR is already closed (conflicts with main), or this is a worker-tail task spawned after CEO was paused. Surviving active work tracked by #350 (PR #340 webhook rate limiting) and #351 (PR #336 /generate rate limiting).

Pipeline state: 14 open PRs, CEO paused until PR review pass is complete. Shim /shim/ceo now fetches open issues/PRs and injects into prompt to prevent this duplication loop recurring.

Closed 2026-04-10 final triage pass. Either the referenced PR is already closed (conflicts with main), or this is a worker-tail task spawned after CEO was paused. Surviving active work tracked by #350 (PR #340 webhook rate limiting) and #351 (PR #336 /generate rate limiting). Pipeline state: 14 open PRs, CEO paused until PR review pass is complete. Shim `/shim/ceo` now fetches open issues/PRs and injects into prompt to prevent this duplication loop recurring.
pook closed this issue 2026-04-10 15:12:49 -04:00
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#416
No description provided.