/

dz-sandbox Official Documentation (English)

Test what fails, not just what succeeds.

A deterministic, 100% offline-first local sandbox simulating Algerian payment gateways, mobile banking services, and courier APIs:


Service URLs & Default Ports

ServiceDefault URLPurpose
Control API & Dashboardhttp://127.0.0.1:4000Web dashboard (Arabic RTL default, FR/EN) with Live Stream auto-refresh, virtual clock, and scenario switcher
Chargily Pay v2 Mockhttp://127.0.0.1:4001/api/v2Checkouts, customers, products, prices, local hosted checkout page, and signed webhooks
SATIM E-Payment Mockhttp://127.0.0.1:4002/payment/restRegistration (register.do), hosted test cards (4000000000000001..05), confirmation, and refunds
Yalidine Express Mockhttp://127.0.0.1:4003/v1Parcel CRUD, fee calculator, tracking, and virtual-clock delivery lifecycles
BaridiMob Banking Mockhttp://127.0.0.1:4004/mobilebank/serviceAuthentication, device attachment, SMS OTP confirmation, RIP transfers, and bill payments

Quick Start in 3 Commands

# Option 1: Via npx directly
npx dz-sandbox start

# Option 2: Via Docker Compose
docker compose up

Once started, open the web dashboard: http://127.0.0.1:4000


Test Failure Modes in Your Code

1) With TypeScript / JavaScript

import { createSandboxClient } from '@dz-sandbox/client';

const sandbox = createSandboxClient({ controlUrl: 'http://127.0.0.1:4000' });

// 1. Reset state
await sandbox.reset();

// 2. Set scenario to deliver duplicate webhooks
await sandbox.scenario('chargily', 'duplicate_webhook');

// 3. Await 2 webhooks and verify idempotent order fulfillment
const hooks = await sandbox.waitForWebhook({ provider: 'chargily', count: 2 });

2) With PHP / Laravel / Pest

use DzSandbox\SandboxClient;

$sandbox = new SandboxClient('http://127.0.0.1:4000');
$sandbox->reset();

// Simulate BaridiMob SMS OTP expiration
$sandbox->scenario('baridimob', 'otp_timeout');

3) With Python

from dz_sandbox import SandboxClient

sandbox = SandboxClient("http://127.0.0.1:4000")
sandbox.reset()
sandbox.scenario("satim", "declined")

For AI Coding Agents (Cursor / Windsurf / Claude Code)

Using an AI coding assistant? The repository includes drop-in context files:


Key Guides & Sections

box.style.display = "block"; if (!hits.length) { box.innerHTML = "
" + noResultsText + "
"; return; } box.innerHTML = hits.map(function (hit) { return "" + hit.title.replace(/" + hit.path + " — " + hit.excerpt.replace(/"; }).join(""); }); })();