Sandbox

Sandbox and live: the differences

Test mode runs the same code as live mode. Every intentional difference, with its value and its reason.

Open as Markdown
On this page
  1. What differs
  2. What is the same
  3. Test and live never mix

Test mode is not a mock of AdProMaxPay: it is the same API, the same validation, the same state machine, the same events and the same webhooks. Only the payment providers are simulated, so that no real money moves. A request that works in test mode works in live mode, and a request refused in live mode is refused in test mode.

The differences below are deliberate. Each one keeps you from waiting, or from spending real money.

What differs

Test modeLive modeWhy
MoneyNone moves; nothing reaches a bankReal paymentsThe sandbox is for building
Keysapx_sk_test_…, apx_pk_test_…, once your email is verifiedapx_sk_live_…, apx_pk_live_…, once your account is activatedTwo modes, two sets of data
Card payment pageA simulated page marked TEST, which takes only the test cardsThe secure payment page of our card partnerA real card never enters test mode
3-D SecureA simulated page where you choose to approve or failYour customer's bankSo you can test both outcomes
Cash codesPaid with Simulate payment or the test helpers; no agent accepts themPaid in cash at a partner payment agentNo real cash for a test
Cash status checksEvery 10 seconds, and at once after a simulated paymentEvery 2 minutesA test confirms in seconds
Funds become available120 seconds after a payment succeedsAfter the holding period set when your account is activatedYou see the whole balance cycle in a test
Our feesA placeholder taken from each succeeded payment: 2.5% for a card, 3% for cashThe fees announced with activationYour test balance moves like a live one; the figures are not our prices
Card refundsComplete within secondsCan stay pending for longer while the card network carries them outThe simulated provider answers at once
Test helpersAvailableRefused: 403, test_mode_onlySimulating a payment has no meaning in live mode
Rate limits, per minuteAll requests 600, writes 150, payment creations 60, searches 30All requests 1,200, writes 300, payment creations 120, searches 30Live traffic gets the larger share
Daily cap10,000 requests and 1,000 payment creations per day, Morocco time; then 429, test_daily_cap_reachedNoneProtects the shared sandbox
Request logsKept 30 daysKept 90 daysTest traffic is short-lived

Rate limits are the defaults; yours may differ. The dashboard's API limits page shows the values that apply to you, and lets you ask for more: see Rate limits.

What is the same

  • Validation: the same fields, the same checks, the same error codes and messages.
  • Minimums: 100.00 MAD for cash, 1.00 MAD for a card, in both modes. A cash payment of 50.00 MAD is refused in test mode exactly as in live mode.
  • Life spans: a card payment page lasts about 30 minutes; a cash code about three days (its expires_at says); a checkout session 24 hours unless you set less.
  • Idempotency: the same required keys, the same 24-hour replays.
  • Events and webhooks: the same types, the same payloads, the same signatures, the same retries.
  • Statuses: a payment intent goes through the same statuses, and succeeds once.
  • Refunds: card payments can be refunded; cash payments cannot, in both modes.

Test and live never mix

  • A test key sees test objects only; a live key sees live objects only. Reading a test object with a live key answers resource_missing, with a hint that the object exists in the other mode.
  • Webhook endpoints belong to one mode. Create your live endpoints when you go live.
  • Test objects carry "livemode": false; live objects "livemode": true.