Repository navigation
Releases
Releases · Reyhandhani/idnpay-sandbox
v0.1.1
Existing Midtrans code can now point at this simulator without a rewrite.
Highlights
- Midtrans-compatible API at
/v2/chargeand/v2/{order_id}/status, with Basic auth and SHA512signature_keywebhooks. Request bodies match Midtrans Core API. - Idempotency-Key on both charge endpoints, so a retried CI job does not create a second transaction.
- Configurable failure status through
SIMULATED_FAILURE_STATUS, so you can force 504 or any other 4xx/5xx response. - CI guide with a GitHub Actions recipe, a two-container compose example, and recipes for retries, timeouts, and rejected signatures.
- Dashboard pass: light and dark toggle, 44px tap targets, scrollable table, explicit empty, loading, and error states.
- New documentation: why the project exists, a comparison table, a request sequence diagram, a state diagram, and a design direction document.
Upgrade notes
- Nothing breaks on
/v1. Existing requests keep working. /v2is new and optional. It usesSECRET_KEYas the Midtrans server key, and requirescallback_urlin the charge body because there is no dashboard to read it from.- Webhooks from
/v2transactions carrysignature_keyin the body. Transactions from/v1keep theX-IDNPay-Signatureheader.
Fixed
- Virtual Account prefixes are now described as illustrative, not real bank numbers.
dist/is cleaned before build and test, so removed modules cannot run from stale output.
Run it
docker compose up -d --build
Or, once the image is published:
docker run -p 9000:9000 ghcr.io/reyhandhani/idnpay-sandbox:v0.1.1
Open http://localhost:9000.
Full changelog: https://github.com/Reyhandhani/idnpay-sandbox/blob/main/CHANGELOG.mdv0.1.0
A local payment gateway simulator for Indonesia. Test QRIS, Virtual Account, and e-Wallet flows without a third-party sandbox that goes down or rate limits you.
Features
- QRIS with an EMVCo payload and CRC-16 checksum
- Virtual Accounts for BCA, Mandiri, BRI, BNI, and Permata
- e-Wallet deeplinks for GoPay, OVO, ShopeePay, and DANA
- Simulation endpoints for
PAID,FAILED, andEXPIRED, plus automatic expiry - Signed webhooks with HMAC-SHA256, retries, and exponential backoff
- At-least-once delivery using leases, with crash recovery when Redis is used
- Memory or Redis queue, with automatic fallback
- Dashboard with a connection test and a three-step flow
- Simulated latency and failures for resilience testing
Quick start
docker compose up -d --build
Open http://localhost:9000 for the dashboard.
First charge:
curl -X POST http://localhost:9000/v1/charge \
-H "Content-Type: application/json" \
-H "X-Client-Key: idnpay-dev-client-key" \
-d '{"order_id":"ORDER-1","gross_amount":150000,"payment_type":"qris","callback_url":"http://host.docker.internal:8000/webhook"}'
Requirements
Node.js 22 or newer if you run it without Docker.
Notes
- Transactions live in memory and are lost on restart. That is intentional for a test tool.
- Change
CLIENT_KEYandSECRET_KEYbefore exposing the simulator beyond your machine. - The webhook signature covers
order_id,status_code, andgross_amount. Re-read the transaction before acting ontransaction_status.
Documentation
Full changelog: https://github.com/Reyhandhani/idnpay-sandbox/blob/main/CHANGELOG.md