Sandbox and the Fake processor
How sandbox works, and what the Fake processor does and does not simulate.
Sandbox is dhango's test environment, at https://api.dhangodemo.com, and no real money moves there. You can connect a sandbox account to any processor through that provider's test account, such as a Stripe or Adyen test account. If you do not have one, use the Fake processor, which dhango runs so you can test without an outside provider. The card and bank account numbers to use are in Test cards and bank accounts.
Moving to production means changing three things: the host, the credentials, and the processor configured on each account.
Create sandbox API credentials on your platform account under API Credentials, and keep the secret out of the browser.
Test a card payment
- Save a test card with
POST /v1/tokens, or send it directly on pay or authorize. - Call
POST /v1/transactions/paywithamountandpayerFee. - Read the result with
GET /v1/transactions/{id}. A successful card payment or authorization stores the network transaction idFAKE0123456789. - Try capture, refund, and void. On the Fake processor they always succeed.
The Fake processor does not simulate 3-D Secure, and it does not implement confirm. Test those flows against a provider test account.
Test an ACH payment
Pay with ach and a test account number. The account number decides whether the payment succeeds, is returned before batching, or is returned after batching, which lets you test a debit back from the merchant. R01 is the only return code simulated.
On a split payment, the return applies to every leg. The parent transaction is marked returned but does not get its own reversal.
ACSS, payouts, and splits
ACSS payments and refunds always succeed. Payouts, which are ACH, succeed and are included in a batch. Splits work on pay and capture, but live processors support fewer split combinations. See Split a payment.
What the Fake processor does not cover
- Processor tokens. Test token migration on a sandbox processor that accepts them.
- 3-D Secure and confirm.
- Return codes other than R01.
Provider test accounts
When a sandbox account is connected to a Stripe or Adyen test account, the provider decides the outcome, so use its test values instead. Test cards and bank accounts links to them.