Rute Bayar is an open source payment router for Indonesian payment gateways.
The project provides one internal interface for multiple providers, starting with Xendit and Midtrans. It is designed as a Go CLI and daemon that can create payments, receive provider webhooks, store raw JSON traffic for debugging, and optionally forward incoming webhooks to user-configured targets.
Status: early scaffold. The repository already contains the project structure, domain contracts, daemon skeleton, forwarding skeleton, docs, and initial SQLite migration. Provider API implementations are still in progress.
- Modular provider adapters.
- CLI-first onboarding and operations.
- Webhook daemon per provider.
- Pass-through webhook forwarding.
- Raw inbound and outbound JSON storage for debugging and audit.
- SQLite-first local storage.
- Initial support target: Xendit Payment Sessions and Midtrans.
Clone the repository:
git clone git@github.com:pendig/rute-bayar.git
cd rute-bayarInstall Go 1.22 or newer, then check the CLI:
go run ./cmd/rute-bayar version
go run ./cmd/rute-bayar provider listStart the webhook daemon:
go run ./cmd/rute-bayar webhook serve --addr :8080Check the daemon:
curl http://localhost:8080/healthzSend a local webhook simulation:
curl -X POST http://localhost:8080/webhooks/xendit \
-H 'Content-Type: application/json' \
-d '{"event":"payment_session.created","status":"ACTIVE"}'The current daemon accepts the webhook and runs the forwarding scaffold. Provider verification and persistence are planned next.
Build a local binary:
go build -o bin/rute-bayar ./cmd/rute-bayarRun it:
./bin/rute-bayar versionInstall into your Go binary path:
go install github.com/pendig/rute-bayar/cmd/rute-bayar@latestFor now, prefer local builds from the repository until the first tagged release is published.
Available command skeleton:
rute-bayar onboard
rute-bayar provider list
rute-bayar provider test
rute-bayar pay create
rute-bayar pay status
rute-bayar pay refund
rute-bayar webhook serve --addr :8080
rute-bayar webhook replay
rute-bayar webhook forward list
rute-bayar webhook forward add
rute-bayar webhook forward update
rute-bayar webhook forward remove
rute-bayar reconcile
rute-bayar versionThese commands establish the intended user experience. The next implementation milestone is wiring them to SQLite and provider adapters.
Copy the example environment file:
cp .env.example .envDefault local configuration:
RUTE_BAYAR_ENV=sandbox
RUTE_BAYAR_DB_PATH=./rute-bayar.sqlite3
RUTE_BAYAR_WEBHOOK_ADDR=:8080Do not commit .env or provider credentials. The file is ignored by Git.
Run formatting and tests:
gofmt -w ./cmd ./internal
go test ./...Validate the SQLite migration:
sqlite3 :memory: ".read migrations/0001_initial.sql"Project layout:
cmd/rute-bayar: CLI entrypoint.internal/cli: command routing.internal/daemon: HTTP daemon for webhook receiving.internal/domain: provider-neutral domain types.internal/provider: provider adapter contracts and registry.internal/forwarding: pass-through webhook forwarding service.internal/storage: storage implementations.migrations: SQLite schema migrations.docs: product and technical documentation.
Xendit sandbox simulation has been tested with Payment Sessions:
POST /sessionscreates a Payment Session.GET /sessions/{session_id}retrieves status.- Initial Xendit
ACTIVEstatus maps naturally to Rute Bayarpending. items[].categoryis required for the tested Payment Session payload.
See docs/xendit-sandbox-simulation.md.
- Modular per provider.
- Keep provider-specific behavior inside adapter packages.
- Store inbound and outbound payloads as raw JSON.
- Keep webhook forwarding pass-through by default.
- Make CLI onboarding simple before asking users to configure providers manually.
- Start with SQLite, but keep the domain portable.
Read the project docs:
- Product Requirements
- Architecture
- Model Data
- CLI Onboarding
- Provider Integration
- Webhook Forwarding
- Development
- Xendit Sandbox Simulation
- Implement SQLite storage layer.
- Wire CLI onboarding to provider account storage.
- Implement Xendit Payment Session create/status/refund.
- Implement Xendit webhook verification and parsing.
- Implement Midtrans create/status/refund and notification handling.
- Persist raw inbound/outbound JSON for every provider operation.
- Add webhook forwarding target management via CLI.
Issues, ideas, and pull requests are welcome. For larger changes, please open an issue first so the design can stay aligned with the provider adapter model.
Before opening a pull request:
- Run
gofmt -w ./cmd ./internal. - Run
go test ./.... - Avoid committing provider credentials,
.env, local SQLite files, or raw secret-bearing payloads.
Rute Bayar is open source under the MIT License.
Copyright (c) 2026 Wahyu Adi Putra Pena Digital.