7.6 KiB
7.6 KiB
Stripe Go-Live Checklist
This checklist is for preparing ALwrity’s Stripe integration for production. Use it before switching to live keys or onboarding real customers.
Tick each item as you complete it.
1. Configuration & Environment
- Separate environments set up
- Test mode Stripe account configured.
- Live mode Stripe account configured.
- Environment variables configured for production
STRIPE_SECRET_KEYset to live secret key.STRIPE_WEBHOOK_SECRETset to live webhook signing secret.STRIPE_MODE=liveis set (recommended for explicit mode selection).STRIPE_PLAN_PRICE_MAPPING_LIVEis set to JSON mapping live price IDs.- (Optional fallback)
STRIPE_PLAN_PRICE_MAPPINGis set only if you intentionally use one shared mapping across environments. ADMIN_EMAILSconfigured with correct admin emails (comma-separated).ADMIN_EMAIL_DOMAINconfigured if using domain-based admin access.DISABLE_AUTHis not set to"true"in production.
- Secrets handling
- No Stripe keys are committed to the repo.
- Secrets are stored only in your deployment platform / secret manager.
2. Prices, Plans and Mapping
- All required prices exist in Stripe (live)
- BASIC monthly price created.
- PRO monthly price created (if used).
- Yearly prices created if you plan to sell yearly plans.
- Price mapping in backend updated
STRIPE_PLAN_PRICE_MAPPING_LIVEuses live price IDs (not test IDs).STRIPE_PLAN_PRICE_MAPPING_TESTis configured separately for test deployments.- Mapping includes required keys:
basic.monthlyandpro.monthly. - Mapping covers any additional tiers and billing cycles you intend to offer.
- SubscriptionPlan data is consistent
- DB has
SubscriptionPlanrows for each tier (BASIC/PRO/etc.). is_activeis set to true for sellable plans.
- DB has
3. Database & Migrations
- Model changes applied in production DB
- Tables related to subscriptions exist:
subscription_plansuser_subscriptions
- Usage/billing tables exist if used (
api_usage_logs,usage_summaries, etc.). fraud_warningstable exists for early fraud warnings:- Checked via DB console or migration logs.
- Tables related to subscriptions exist:
- Migration strategy verified
- Any migration scripts run successfully on staging.
- Same process is planned for production.
4. Webhook Setup
- Production webhook endpoint configured in Stripe Dashboard
- URL points to your production backend:
- e.g.
https://your-domain.com/api/subscription/webhook
- e.g.
- Uses HTTPS.
- URL points to your production backend:
- Subscribed events include at least
checkout.session.completedinvoice.payment_succeededinvoice.payment_failedcustomer.subscription.updatedcustomer.subscription.deletedradar.early_fraud_warning.created- (Optional)
radar.early_fraud_warning.updated
- Webhook secret set correctly
- Copy live webhook signing secret from Stripe into
STRIPE_WEBHOOK_SECRET. - Confirm no test webhook secret is used in production.
- Copy live webhook signing secret from Stripe into
- Webhook endpoint health check
- Trigger a test event from Stripe Dashboard (in a safe environment).
- Verify the backend logs show successful verification and handling.
5. Internal Admin Tools (Ops Readiness)
- Admin roles/permissions
- Confirm at least one admin user can access
/stripe-disputes. - Non-admin users cannot access sensitive endpoints (disputes, fraud warnings).
- Confirm at least one admin user can access
- Disputes dashboard
/stripe-disputesloads without error.- Disputes tab can:
- List disputes.
- Show dispute details.
- Submit evidence.
- Close a dispute.
- Fraud Warnings tab
- Fraud Warnings tab loads without error.
- List of early fraud warnings is visible when test EFWs exist.
- Details dialog shows:
- Issuer fraud type.
- Actionable flag.
- Internal status / actions.
- Buttons:
- “Refund Full Amount” works (in test/staging).
- “Mark as Ignored” works (updates status).
- Ops team trained
- Ops have read the Ops Guide.
- They understand:
- How to respond to disputes.
- When to proactively refund EFWs.
- When to escalate to engineering.
6. Manual Test Flows (Before Real Customers)
Perform these in test environment first, then in live with small amounts.
6.1 New Subscription Flow
- As a test user:
- Go to Pricing page.
- Select BASIC monthly (or equivalent).
- Start Stripe Checkout and complete payment with test card.
- You are redirected back to the success URL.
- Backend:
- Webhook logs show
checkout.session.completedprocessed. UserSubscriptionupdated withstripe_customer_idandstripe_subscription_id.- Subscription status is
ACTIVE.
- Webhook logs show
6.2 Billing Portal
- From the app, open the billing portal (Customer Portal).
/api/subscription/create-portal-sessionreturns a URL.- You can:
- View invoices.
- Update card details.
- Cancel a subscription.
- After cancellation:
- Webhook logs show
customer.subscription.deleted. UserSubscriptionis updated to cancelled and not active.
- Webhook logs show
6.3 Failed Payment (Test Mode)
- Use a known failing test card.
- Trigger a failed invoice.
- Verify:
invoice.payment_failedprocessed.UserSubscriptionstatus is set toPAST_DUEandis_activeis false.
6.4 Dispute (Test Mode)
- Create a test dispute in Stripe’s test mode.
- Confirm:
- Dispute appears in the Disputes tab.
- You can open details and submit evidence.
6.5 Early Fraud Warning (Test Mode)
- Create a test Early Fraud Warning (if supported in test mode or via Stripe tools).
- Confirm:
- EFW is ingested and appears in Fraud Warnings tab.
- Details dialog shows issuer
fraud_typeandactionableflag. - “Refund Full Amount” works in test (Stripe shows charge refunded).
7. Rate Limiting and Abuse Protection
- Checkout endpoint rate limiting
- Confirm
create-checkout-sessionapplies per-user rate limits. - Hitting the endpoint rapidly produces HTTP 429 and a log entry.
- Confirm
- Monitoring for card testing
- Logs for rate-limited events are visible in your logging system.
- You have a plan to investigate suspicious spikes (many 429s or many failed payments).
8. Monitoring & Alerts
- Logging
- Backend logs are centralized (e.g. in a logging service).
- Key Stripe flows (webhooks, disputes, fraud warnings) log useful context.
- Basic alerting
- At minimum, you can detect:
- Webhook failures.
- Unusually high dispute volume.
- Frequent early fraud warnings.
- At minimum, you can detect:
9. Final Production Switch
- Keys double-checked
- Production environment uses live Stripe keys and webhook secret.
- No references to test keys remain in production configs.
- Test charge in live mode
- Complete a small real transaction in live mode.
- Verify:
- Subscription is active.
- Internal dashboard reflects the subscription correctly.
- Refund/portal flows work as expected.
- Ops sign-off
- Ops team confirms they can use Disputes and Fraud Warnings tools comfortably.
Once all items are checked, you can consider the Stripe integration ready for production traffic.