Test and live mode
Section titled “Test and live mode”Keys come in two environments: ci_test_/sk_test_ keys, and their at_test_ tokens, work in test mode; ci_live_/sk_live_ keys and at_live_ tokens in live mode. Every object says which it belongs to in livemode, and a token sees only its own mode's objects: a test intent asked for with a live key is not_found.
Test mode never moves money: a test payment is only ever simulated, and confirming one with a method that cannot be simulated is refused with test_mode_unavailable.
To make a test payment succeed, fail or expire, see Testing your integration.
Card in test mode
Section titled “Card in test mode”A test card payment never shows card fields: on hosted checkout, inside embedded checkout and on the card page of an API-only integration, the customer is shown a simulated card step instead, which asks for no card number and charges nothing. It offers four choices, each ending as its live counterpart does:
| Choose | The intent |
|---|---|
| Pay | succeeded, at once, as most live cards do |
| Decline | requires_payment_method, with last_payment_error.code card_declined (expired_card for that reason) |
| Challenge, then pay | succeeded, after a simulated check by the customer's bank in the whole page |
| Challenge, then fail | requires_payment_method, with last_payment_error.code payment_intent_authentication_failure |
A challenge leaves the page as a live one does, through a link inside embedded checkout, and the customer comes back through your return_url. See On the simulated card page for the details, and the test helper that gives the same outcomes over the API.
Test values
Section titled “Test values”In test mode, these amounts make a payment do something particular, so you can try the whole path:
| Method | Amount | What happens |
|---|---|---|
card | PHP 404.00 (amount: 40400, currency: php) | Once the payment succeeds, whether you choose Pay or Challenge, then pay on the simulated card page or send the test helper approved or three_d_secure_passed, it is charged back in full: a dispute opens and dispute.created is sent. Its reason is fraud (network_reason_code 10.4), its chargeback_cost is PHP 500.00 (50000), and its evidence_due_date is 10 days later. Any other amount is never charged back. |
The test dispute can be read with a test key from List disputes, seen, answered with evidence and accepted in the Merchant Dashboard, as any dispute can, and sends its events. Like every test payment, it moves no money.