Stripe Live Checkout + Webhook Provisioning
Property: ChurchWiseAI Category: Onboarding
Tier:
any
Persona: pastor-admin
Touchpoint: /checkout
Preconditions
- Use Stripe test card 4242 4242 4242 4242, any future expiry, any CVC
- No existing premium_churches row for the test email
- Stripe webhook endpoint registered and reachable
Steps
| # | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /pricing | All tier cards render with correct prices matching pricing.yaml |
| 2 | Click 'Get Started' on any paid tier | Redirected to Stripe Checkout with correct price_id for selected plan |
| 3 | Complete payment with test card 4242 4242 4242 4242 | Stripe Checkout completes, redirected to /onboarding or success page |
| 4 | Check stripe_webhook_inbox table within 30 seconds | checkout.session.completed event row present with status=pending |
| 5 | Wait for cron/process-stripe-webhooks to fire (up to 60s) | Webhook inbox row status changes to processed |
| 6 | Check Supabase premium_churches table | New row with correct plan, status=active or preview, church_id set |
| 7 | Complete onboarding form | Redirected to /admin/[token] dashboard — dashboard loads with correct tier entitlements |
| 8 | Verify magic link email | Email with subject 'Your ChurchWiseAI dashboard' arrives within 2 min |
Known Failure Modes
- Webhook not received — check Stripe dashboard webhook log for delivery failures
- premium_churches row created but plan wrong — check process-stripe-webhooks handler
- Onboarding redirects back to /pricing — subscription not provisioned
- stripe_webhook_inbox row stuck at pending — check cron is running
References
- Playwright spec:
e2e/stripe-e2e-validator.spec.ts - Acceptance spec: acceptance/starter-chat.md
- Code files:
Cleanup
- Cancel the test subscription in Stripe test dashboard
- Delete the test premium_churches row (or set status=cancelled)
Notes
CRITICAL PATH. Any PR touching linked_code_files must produce a green Playwright run before merge — see CLAUDE.md rule #10 and registry.yaml entry stripe-live-checkout. The webhook now uses inbox pattern (2026-04-14): thin ack → stripe_webhook_inbox → cron processes async. Do NOT inline provisioning in the webhook handler again.