Skip to content
Meem Payment

Get started

Sandbox and testing

The sandbox runs the real orchestration engine, routing workflows and webhooks against two built-in mock gateways. Card numbers decide the outcome, so you can test every branch without a PSP contract.

Mock gateways

GatewayIdentity in APIs and tracesNotes
Mock 1MockSame simulator as Mock 2, registered under a different name.
Mock 2mock2Lets you test routing between two gateways, and failover.
  • Each is a merchant gateway account in the Sandbox environment; you can enable, disable or remove it per merchant.
  • Mocks exist only where the platform explicitly allows them. A production deployment leaves them off, so a mock can never process a real payment.
  • Mock calls are marked simulated in the API-call logs and labelled as simulated in the console.

Test cards

The mocks read the first six digits of the card number (or of cardToken on the API). The numbers below pass the Luhn check, so they also work on the hosted checkout page. Use any future expiry and any three-digit CVV.

Card numberOutcomeWhat you should see
4000 0011 1111 2223Approve200, Authorized (or Captured with capture: true).
4000 0111 1111 1117INSUFFICIENT_FUNDS (soft, retry later)402, Declined. No failover.
4000 0511 1111 1113DO_NOT_HONOUR on every mockFails over if allowed, then 402 once options run out.
4000 0611 1111 1112STOLEN_CARD (hard)402. No retry, no failover.
4000 0311 1111 1115Technical failureFails over to the next eligible account; 502 if none is left.
4000 0211 1111 1116Timeout, status stays unknownHeld for reconciliation. Never failed over.
4000 0711 1111 1111Unknown outcomeHeld. Never retried.
4000 0811 1111 1110Timeout; status query confirms not chargedSafe failover to the next account.
4000 0911 1111 1119Timeout; status query confirms chargedCompleted on the original gateway. No second charge.
4000 0411 1111 11143-D Secure challenge200, Requires3DS with a redirectUrl.
4000 1011 1111 1116Failover demoMock 1 soft-declines DO_NOT_HONOUR, Mock 2 approves.
5888 4511 1111 1119mada approveApproves on a mada-enabled mock account.
curl -X POST "https://api.sandbox.meem-dev.example/api/v1/payments" \
  -H "Authorization: Bearer $MEEM_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount": 75,
    "currency": "SAR",
    "cardToken": "4000011111111117",
    "cvv": "123"
  }'
{
  "paymentId": "<payment_id>",
  "status": "Declined",
  "code": "INSUFFICIENT_FUNDS",
  "normalizedCode": "INSUFFICIENT_FUNDS",
  "declineCategory": "SoftDecline",
  "correlationId": "<correlation_id>"
}

Forcing an outcome

Set metadata.mock_outcome to force an outcome regardless of the card. Values (case-insensitive): Success, Decline, Timeout, TechnicalFailure, Requires3DS, SoftDecline, HardDecline, Unknown, TimeoutNotCharged, TimeoutCharged. The hint takes precedence over card prefixes.

curl -X POST "https://api.sandbox.meem-dev.example/api/v1/payments" \
  -H "Authorization: Bearer $MEEM_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount": 25,
    "currency": "SAR",
    "cardToken": "4000001111112223",
    "metadata": {
      "mock_outcome": "TechnicalFailure"
    }
  }'

Environment isolation

  • Sandbox and Production gateway accounts are separate, each with its own credentials, endpoint and webhook secret. They never fall back to each other.
  • A payment's environment is either sent explicitly (Sandbox or Production) or resolved from your single resolvable account; it's never derived from the host name.
  • Workflows are published per environment. A sandbox publish doesn't affect production traffic.
  • A production account activates only after a passing, Verified connection test.

Simulated features

  • 3-D Secure challenge

    A simulated issuer challenge in the sandbox. Real 3-D Secure runs through your PSP.

    Simulated
  • Apple Pay, Google Pay, Samsung Pay, STC Pay on hosted checkout

    Badged as simulated on the page. Real wallet integrations are planned.

    Simulated
  • Tabby and Tamara (BNPL) on hosted checkout

    Eligibility uses a simulated pre-score in the sandbox.

    Simulated
  • Hosted fields (POST /api/v1/hosted-fields/sessions)

    Card iframes on your page return a single-use tok_hf_… token (15 minutes) for POST /payments. Outside the sandbox the endpoint returns 501 hosted_fields.sandbox_only.

    Sandbox
  • Payment-link email and SMS sharing

    Nothing is delivered; the response says simulated.

    Simulated

Pre-launch checklist

  • Approve, soft decline, hard decline, technical failure and 3-D Secure all handled in your UI.
  • Timeouts and unknown outcomes never trigger a new payment from your side.
  • Every mutating call sends a unique Idempotency-Key; retries reuse it.
  • Webhook signature verified on raw bytes; duplicate event_ids ignored.
  • Return URLs confirmed server-side with GET /api/v1/payments/{id}.
  • Tokens cached and refreshed before expires_in.

Documentation reflects the platform as verified on 3 December 2026. Placeholder hosts and credentials are used throughout; your real sandbox host and keys are provided at onboarding.