Test Mode vs Live Mode
Development Testing Workflow
Step 1: Configure Test Mode
In Cloud Admin, navigate to Payments > Settings and enter your test credentials:Get Test Keys from Stripe
- Publishable key:
pk_test_... - Secret key:
sk_test_...
Enter Keys in Cloud Admin
Copy Webhook URL
Step 2: Set Up Local Webhook Testing
Use Stripe CLI to forward webhooks to your local development environment:{your-project-id} with your actual project UUID from Cloud Admin.Step 3: Trigger Test Events
Use Stripe CLI to simulate events:Test Card Numbers
Use these Stripe test cards to simulate various scenarios:Successful Payments
Failed Payments
Special Scenarios
Testing Subscription Scenarios
New Subscription Flow
Start Subscription
Complete Checkout
4242 4242 4242 4242 with any future date and CVC.Verify in Cloud Admin
Verify in Stripe
Test Plan Changes
Test Payment Failure
Create Subscription
4242 4242 4242 4242.Update to Failing Card
4000 0000 0000 0341.Trigger Invoice
Verify Status
past_due.Test Cancellation
Cancel via Customer Portal
Verify Webhook
customer.subscription.updated with cancel_at_period_end.Check Cloud Admin
cancelled with access until period end.Monitoring Test Events
Stripe CLI Output
Watch the CLI for incoming webhooks:Cloud Admin Dashboard
After test events:- Statistics - Verify subscription and transaction counts update
- Subscriptions - New subscription appears in the list
- Transactions - Payment record shows in transaction history
Stripe Dashboard
Check webhook logs for delivery status:- Go to Developers > Webhooks
- Select your test endpoint
- View recent deliveries and response codes
Testing Checklist
Use this checklist before going live:Basic Checkout
- Successful payment with
4242 4242 4242 4242 - Subscription created in Cloud Admin
- User sees active subscription in dashboard
Payment Failures
- Declined card shows appropriate error
- Insufficient funds triggers retry
- Subscription goes to
past_duecorrectly
Subscription Management
- Plan upgrade creates proration charge
- Plan downgrade creates proration credit
- Cancellation marks subscription correctly
- Uncancellation works if before period end
Customer Portal
- User can access portal
- Payment method update works
- Invoice download works
Webhooks
- All expected events received and processed
- Signature validation working
- Failed webhook delivery alerts configured
Going Live Checklist
When testing is complete, prepare for production:Configure Live Credentials
pk_live_*, sk_live_*).Create Live Webhook
https://api.devkit4ai.com/api/v1/payments/stripe/webhooks/{project_id}/liveUpdate Environment
Make a Real Test
Monitor First Customers
- Verify webhooks are received
- Confirm subscription status updates
- Check email receipts are sent
Troubleshooting Tests
Webhooks not received locally
Webhooks not received locally
- Verify Stripe CLI is running:
stripe listen --forward-to ... - Check the forwarding URL is correct
- Ensure no firewall blocking outbound connections
- Try
stripe listen --print-jsonfor detailed output
Signature verification failed
Signature verification failed
- Use the webhook secret from the current
stripe listensession - Secrets change each time you restart Stripe CLI
- For persistent secrets, create an endpoint in Stripe Dashboard
Test payment not appearing
Test payment not appearing
- Check webhook delivery in Stripe Dashboard
- Verify the project_id in the webhook URL matches your project
- Check Cloud API logs for processing errors
3D Secure not triggering
3D Secure not triggering
- Use card
4000 0025 0000 3155which requires authentication - Ensure your checkout session has correct billing address fields

