Testing
Drive every outcome on demand, before a real payer ever does.
Every failure a real payer can produce, you can produce on purpose: insufficient funds, a refused PIN, an operator timeout, a declined card, a failed refund. Sandbox is not a mock of the API, it is the same API writing to a different database, so the code you test is the code you ship.
The three tools
| Tool | Use it to |
|---|---|
| Sandbox keys | Run your whole integration against test money |
| Test numbers and cards | Choose which outcome the sandbox produces |
| The CLI | Receive live events on localhost and trigger them on demand |
What a complete test run covers
Most integrations test the happy path and ship. These eight are what breaks afterwards, and each one is a single input away. Your ticks are kept in this browser, so a run can span several days.
Sandbox test run
Force it with
View guide →+237670000002, with no human looking at it.Force it with
+237670000001. It is not the same failure as a refusal.Force it with
+237670000003, the timeout. The order must not stay open forever.+237670000009pays, then refuses the refund. Your ledger must wait for the money to leave.Change one character of the secret and confirm your endpoint answers
View guide →400.Replay a delivery and assert one order, one email, one credit.
View guide →One
View guide →payment.succeededtrigger delivers five events. A handler that knows one drops four.A slower answer counts as a failure. The delivery gets five attempts over sixteen minutes.
View guide →
The signature test is the one almost nobody writes, and the only one that protects the money.
The loop that makes this quick
# 1
wajub listen --forward-to localhost:3000/webhooks/wajub
# 2
wajub trigger payment.succeeded
wajub trigger payment.failed
wajub trigger refund.succeededEach trigger drives the sandbox API end to end, so what reaches your handler is a real event chain rather than a fixture.
Everything above is provable in sandbox. What is not provable there, live keys, restricted scopes, alerting, belongs to the go live checklist, which carries its own list.
Sandbox does not test your provider coverage
The sandbox accepts every channel in its operator table. Whether your live account may use
ci.wave depends on your contracts, not on your code. Check wajub channels against the live
profile before assuming a rail is available.