Payment Gateways — Production Guide
Checklist
- Seed gateways:
PaymentGatewaySeeder(manual + stripe). - In Central UI, configure Stripe live credentials (or set encrypted config via API).
- Set Stripe as default only after a successful Test connection.
- Register webhooks in the Stripe Dashboard:
- Prefer
https://{APP_URL}/stripe/webhookfor Cashier subscription mirror + Billing Engine - Or
https://{APP_URL}/webhooks/gateways/stripefor Billing Engine only
- Prefer
- Store the webhook signing secret in gateway config (
webhook_secret) and/orSTRIPE_WEBHOOK_SECRETfor Cashier middleware. - Confirm CSRF exclusions remain for
stripe/*andwebhooks/gateways/*. - Monitor webhook status and
webhook_logsafter go-live.
Environment fallbacks
StripeGateway prefers encrypted payment_gateways.config.secret_key. If absent, it falls back to Cashier env (STRIPE_SECRET). Production should treat DB-encrypted credentials as source of truth so credentials can rotate without redeploying env.
Security
- Never log secret values — only changed key names.
- Never return secrets from API resources.
- Prefer sandbox mode until connection tests pass.
- Rotate webhook secrets after any suspected leak; update both Stripe Dashboard and gateway config.
Ops signals
| Signal | Source |
|---|---|
payment_gateways.webhook_status | ok / failing / unknown |
webhook_last_received_at | Last successful ingress |
gateway_logs | Config/mode/test events |
webhook_logs | Per-event processing result + timing |