Test mode
Build and check your whole integration with a test key. Test payments move through the same code as live ones, but no money moves.
On this page
Test and live mode
The mode of a request is the mode of its API key. The two never see each other.
| Test | Live | |
|---|---|---|
| Key prefix | cp_test_ | cp_live_ |
| Money | None moves | Real payments |
| Payments it sees | Test payments only | Live payments only |
| Webhook events | Sent to test endpoints | Sent to live endpoints |
livemode | false | true |
A test payment of the wrong mode, like any payment you cannot see, answers 404 not_found.
Completing a test payment
There is no payment provider in test mode, so a test payment does not move on its own. You play the provider:
- Open the
checkout_url. The page shows the banner “Test payment, no money moves”. - Choose a method. The payment becomes pending and the page links to the test controls.
- On the test controls (
<checkout_url>/simulate), choose paid, failed or expired. The payment is updated and your test endpoint receives the event.
With the direct payment API, selecting a method on a test payment returns a next_action of type none: there is nothing to show, so open <checkout_url>/simulate to finish it.
The test controls exist only for test payments. For a live payment they answer 404.
What differs in test mode
- The methods offered are the ones enabled for test on your account.
- A test payment is never invoiced and has no VAT: its
charge.vat_amountis"0.00". - A pending test payment cannot be canceled through the API: the cancel call answers
409 not_cancellable. Acreatedone can. - Payouts are live only. Payout events are never sent for test payments.
- Subscriptions have no test mode: creating one with a test key answers
422 livemode_required.