api_test_sk_...) to exercise the full payment flow
without moving real money. Test mode behaves exactly like live mode — same
endpoints, same objects, same statuses — but cards are simulated.
Objects created in test mode are invisible to live keys and vice versa.
Check the
livemode flag on any object if in doubt.Test cards
Use these card numbers with any future expiry date, any 3- or 4-digit CVC, and any cardholder name:| Number | Scenario |
|---|---|
4111 1111 1111 1111 | Visa — payment succeeds. |
5555 5555 5555 4444 | Mastercard — payment succeeds. |
4000 0000 0000 9995 | Declined with insufficient_funds. |
4000 0000 0000 0002 | Declined with generic_decline. |
4000 0000 0000 0069 | Declined with expired_card. |
4000 0000 0000 3220 | Requires 3D Secure; challenge succeeds. |
4000 0000 0000 3063 | Requires 3D Secure; customer fails the challenge → three_d_secure_failed. |
Scenarios to cover before going live
Happy path
Create a payment, complete it, verify you observe
SUCCEEDED via polling
and via the payment.succeeded webhook.Declines
Trigger at least
insufficient_funds and generic_decline; confirm your
checkout shows a sensible message and lets the customer retry with a
different card. See Decline codes.3D Secure
Complete and fail a challenge; verify both outcomes, including the
redirect back to your
return_url.Abandonment
Create a hosted payment and never complete it; verify your system handles
EXPIRED (and doesn’t strand the order).Retries and duplicates
Send the same create request twice with the same
Idempotency-Key and
confirm only one payment exists. Send it with a changed body and confirm
you get 409 idempotency_error. See Idempotency.Refunds
Refund a test payment partially, then fully; verify
amount_refunded,
amount_refundable, and refund webhooks.Going live
- Complete the checklist above in test mode.
- Swap
api_test_sk_...forapi_live_sk_...in your server configuration — nothing else changes. - Configure live-mode webhook endpoints (test and live endpoints are separate).
- Make a small real payment and refund it to verify the live configuration end to end.