xtopaydocs

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 inWhat happens
000, like 024 400 1000Declined: payment.failed
Anything elseApproved: 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 inWhat happens
999, like 024 555 0999Fails: transfer.failed, and the money is back
Anything elseSent: 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.

Payment links, payment pages and invoices made with a test key are test copies:

  • Links and pages live at xtopay.me/test/<username>/<slug> (their url says so), so a test one can share an address with a live one. Invoices keep xtopay.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.successful is sent.
  • Decline: it fails, and payment.failed is 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

  1. Verify your business.
  2. Create your live secret key in Developers, and put it on your server instead of the test key.
  3. Add your servers' addresses to the live key's Allowed IPs. Direct charges and transfers need it.
  4. To send money, your owner switches Live sending on in Developers, and sets the limits.
  5. Add your live webhook endpoint, and copy its signing secret.

On this page