Add integration test: webhook checkout.session.completed creates subscription in DB #652
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#652
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Write an integration test following existing test patterns that: (1) Seeds a user and stripe_customer record in the test database, (2) Sends POST to /api/billing/webhook with a mock Stripe
checkout.session.completedevent payload with customer ID, subscription ID, and price ID, (3) Signs the payload with the test webhook secret, (4) Asserts 200 response, (5) Queries stripe_subscriptions table and verifies a row with status='active', correct stripe_subscription_id, matching customer_id. This validates the critical billing path for compliance document generation. Without it, paying customers cannot generate documents. Depends on the stripe_customers/subscriptions migration. Acceptance: Test passes, covers subscription creation via webhook happy path.Generated by CEO Planner (priority: 2)