Testing
Test keys behave like live ones, but no money moves. Test charges answer themselves; test checkouts let you approve or decline.
Use your sk_test_ key while you build. Everything works the same as live.
Nothing reaches a real wallet or card, and test payments never reach your
balance or your dashboard's payments. A test key only sees test payments,
and a live key only live ones.
Test charges
A direct charge with a test key sends no prompt. It answers itself a few seconds later:
| The number ends in | What happens |
|---|---|
000, like 024 400 1000 | Declined: payment.failed |
| Anything else | Approved: payment.successful |
Their webhooks are marked "test": true.
Test transfers
A transfer with a test key moves no money, and needs no switch from your owner: it comes out of your test balance (test charges, less test transfers), so make a test charge or two first. It ends a few seconds later:
| The account number ends in | What happens |
|---|---|
999, like 024 555 0999 | Fails: transfer.failed, and the money is back |
| Anything else | Sent: transfer.successful |
Your owner's limits and approval amount apply to test transfers too, so you can try a transfer that waits: approve or decline it in the dashboard's Transfers page, under Test.
Test name lookups never reach a network. Numbers and accounts ending 0000
are not_found, ones ending 8888 are no_answer, and the rest are
found, as KOFI BOATENG.
Test links, pages and invoices
Payment links, payment pages and invoices made with a test key are test copies:
- Links and pages live at
xtopay.me/test/<username>/<slug>(theirurlsays so), so a test one can share an address with a live one. Invoices keepxtopay.me/i/<reference>. - Their pages say Test mode. Paying goes to the test provider's page, where you approve or decline the payment yourself.
- The payment is a test payment:
"mode": "test", seen only by your test key, out of balances and the dashboard. Event tickets are issued, so you can try checking them in. - Nobody is emailed: not the business about a test link, and not the customer about a test invoice, its reminders, receipts or tickets.
- None of them appear in the dashboard, and a live key can't see them.
Test checkouts
A checkout made with a test key (and every checkout from a test link, page or invoice) says Test mode. Choosing Mobile Money or card takes your customer to a test page with two buttons:
- Approve: the payment succeeds, and
payment.successfulis sent. - Decline: it fails, and
payment.failedis sent. The checkout stays open, so you can try again.
Use them to try your success and failure paths, and your webhook handler.
Going live
- Verify your business.
- Create your live secret key in Developers, and put it on your server instead of the test key.
- Add your servers' addresses to the live key's Allowed IPs. Direct charges and transfers need it.
- To send money, your owner switches Live sending on in Developers, and sets the limits.
- Add your live webhook endpoint, and copy its signing secret.