sk_test_...) operate in a sandboxed environment. No real payments are processed, and test data is completely isolated from live data.
Test payment methods
Use these payment method IDs in test mode to simulate different outcomes:| Payment Method | Behavior |
|---|---|
pm_card_visa | Simulates a successful Visa payment |
pm_card_declined | Simulates a card decline (generic_decline) |
4242 4242 4242 4242 with any future expiration date and any 3-digit CVC.
Simulating a successful payment
Simulating a declined payment
Testing webhooks
Webhook events in test mode are delivered to your configured endpoints withlivemode: false in the payload. You can verify your webhook handler processes test events correctly without affecting live data.
Go-live checklist
Verify error handling
Test with
pm_card_declined and confirm your integration handles decline codes gracefully.Test the full payment flow
Create, confirm, and refund a PaymentIntent using
pm_card_visa in test mode.Configure live webhooks
Set up webhook endpoints for your production URL and subscribe to the events you need.