Sandbox
Test cash scenarios
Pay, expire, refuse or suspend a test cash code, and see how your integration reacts to each outcome.
A test cash code cannot be paid at an agent. Instead, you decide what happens to it, in one of three places:
- Simulate payment and the other buttons on the voucher page your customer sees, in test mode;
- the test helpers card on the payment's page in the dashboard, in test mode;
- the test helpers API, for automated tests:
pay,expire,refuseandsuspendon the payment's attempt.
The outcome reaches the payment the way a live one does: through a status check on the simulated network, then the state machine, the events and your webhook. After a simulated action the check runs at once, so the result arrives within seconds.
The scenarios
pay
The payment succeeds: payment_intent.succeeded.
pay with an amount that differs
Nothing is credited: the payment stays processing with a review (amount_mismatch), and you receive review.opened.
expire
The attempt ends expired; the payment goes back to requires_payment_method with voucher_expired.
expire, then pay
Nothing is credited: a review (paid_after_end) and review.opened.
refuse
The attempt fails with voucher_refused; the payment goes back to requires_payment_method.
suspend, then pay
The payment waits while suspended, then succeeds.
A cash payment of 50.00 MAD (5000)
Refused with amount_too_small, as in live mode.
The amount to pay
A voucher gives two amounts: your amount, and the amount_to_pay your customer hands over, which
adds a small stamp fee (in test mode, 0.25 MAD: 15000 becomes 15025). Your customer pays the
fee; it is not taken from your amount. Show amount_to_pay as the voucher gives it.
To try Paid another amount, pass an amount clearly apart from the payment's, such as half of
it. Without an amount, pay pays the voucher in full.
What each scenario teaches
- Expired: most unpaid codes end this way. Free the order or the stock, and let your customer get a new code.
- Paid another amount and Paid after expiry: money can arrive that does not match the
payment. AdProMaxPay credits nothing by itself and a person looks at it; your code waits for
succeeded, which may never come for this payment. - Suspended: a code can be on hold for a while at the network. Your code has nothing to do but wait.
Card scenarios are in Test cards. How cash differs in live mode is in Sandbox and live: the differences.