Answered

How do I trigger a failed payment in the sandbox on purpose?

Ultraner Team Ultraner· 2h ago· 0 views

Every sandbox payment I make succeeds. I need to test what my code does when a payment fails, times out, or the customer has no money.

Is there a way to force those, or do I just have to hope it happens in production?

Accepted answer

Ultraner Team Ultraner· 2h ago

You never have to hope. The simulator is deterministic, and the last digits of the phone number choose the outcome.

Test MSISDN ends with What happens
700000001 succeeds
700000002 fails, insufficient funds
700000003 times out

There is also an amount-based lever: an amount between 1 and 100 returns a simulated 5xx from the gateway, which is how you exercise your retry path rather than your decline path. Anything else succeeds after a realistic delay of a few seconds, so you can see your pending state on screen instead of everything resolving instantly.

Test the timeout case properly. It is the one most integrations get wrong, because a timeout is genuinely ambiguous: the push may still have reached the customer. Treat it as unresolved and reconcile, rather than as a failure you can safely retry.

Answering opens shortly, with your Ultraner account. More in Integrations and the API

How do I trigger a failed payment in the sandbox on purpose? - Ultraner Community | Ultraner