Skip to main content
Sandbox is selected by the key you use. A sk_sandbox_... key hits the same base URL, the same endpoints and the same webhook events as live — it simply never moves real money.
Sandbox comes with a built-in test payment gateway, so you can reproduce every outcome — including the awkward ones — without depending on anyone else’s system. Its method code is test, and it exists in sandbox only.

Outcome matrix

The outcome is chosen by the last two digits of the payer’s phone number, not by the amount. A number ending in 02 always fails; one ending in 55 always succeeds. See Next actions for what to render in each case.

Working through an OTP

1

Start an attempt with a phone ending in 03

The intent comes back with active_attempt.next_action.type set to collect_otp, digits: 6 and is_strict: true.
2

Collect the code

In production the payer receives it by SMS. In sandbox the valid code is always 123456.
3

Submit it

The correct code completes the attempt. Anything else fails it — which is the path worth testing too.

Controlling the pending delay

The 01 outcome stays processing for 20 seconds by default. Shorten it so your asynchronous tests do not crawl:
Accepted range is 1 to 600 seconds.

What to rehearse before going live

  • A payment that fails, and the message you show for each failure category.
  • Each next action your interface can receive.
  • A payment that completes only after the payer has left your site, so you prove your webhook handler works.
  • The same webhook delivered twice, and out of order.
  • A refund, including a partial one.

Going live

That is the whole change. URLs, request shapes and response shapes are identical.
The test gateway does not exist in the live environment. The test method code is rejected outside sandbox.

Testing payouts

Payouts have their own test gateway and their own outcome matrix.