Open-Source β’ High-Performance β’ Success Rate Based
Route payments intelligently. Maximize success rates. Zero vendor lock-in.
π Quick Start β’ π Documentation β’ π Architecture β’ π€ Contributing
Decision Engine is a high-performance payment gateway router built in Rust that intelligently selects the optimal payment gateway for each transaction β in real-time.
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
β Payment ββββββΆβ Decision Engine ββββββΆβ Best β
β Request β β (Fast routing) β β Gateway β
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
| π₯ The Problem | β Our Solution |
|---|---|
| Payment failures from gateway downtime | Real-time health monitoring with automatic failover |
| Suboptimal routing = lost revenue | SR-based routing based on success rates & latency |
| Vendor lock-in limits flexibility | Modular design β works with any orchestrator |
| Complex rule management | Flexible policies β rule-based + SR-based hybrid |
|
|
| Metric | Value |
|---|---|
| Routing Decision Time | Low latency |
| Memory Footprint | ~50MB |
| Concurrent Requests | 100K+ |
| Uptime SLA Support | 99.99% |
# Clone and run
git clone https://github.com/juspay/decision-engine.git
cd decision-engine
docker compose --profile postgres-ghcr up -d
# That's it! API ready at http://localhost:8080# Prerequisites: Rust 1.85+, MySQL/PostgreSQL, Redis
git clone https://github.com/juspay/decision-engine.git
cd decision-engine
cargo build --release
# Configure
cp config.example.toml config/development.toml
# Edit config with your settings
# Run migrations & start
diesel migration run
./target/release/open_routercurl http://localhost:8080/health
# β {"message":"Health is good"}| π Resource | Description |
|---|---|
| Local Setup Guide | Canonical guide for CLI, Docker, Compose profiles, and Helm |
| MySQL Setup Guide | MySQL-specific walkthrough |
| PostgreSQL Setup Guide | PostgreSQL-specific walkthrough |
| API Reference | Complete REST API documentation |
| Configuration Guide | All config options explained |
| Deep Dive Blog | How routing logic works |
Decision Engine integrates seamlessly into your existing payment stack:
Integration Steps:
| Step | Direction | Component | Action |
|---|---|---|---|
| 1 | β | Your App | Initiates payment request |
| 2 | β | Orchestrator | Forwards to Decision Engine |
| 3 | β | Decision Engine | Selects optimal gateway |
| 4 | β | Vault | Returns card token (PCI-safe) |
| 5 | β | Gateway | Processes payment |
| 6 | β | Gateway | Returns result |
| 7 | β | Orchestrator | Routes response back |
| 8 | β | Your App | Receives final result |
Key Benefits:
- Zero PCI scope β Vault handles all card data
- Drop-in integration β Works with any orchestrator
- Intelligent fallback β Auto-switches on gateway failure
| Status | Feature | Description |
|---|---|---|
| β | Rule-based routing | Merchant-defined priority rules |
| β | Dynamic ordering | SR-based gateway selection |
| β | Downtime detection | Automatic health monitoring |
| β | Multi-database | MySQL & PostgreSQL support |
| π | Enhanced routing models | Better success rate prediction |
| π | Admin dashboard | Visual rule management UI |
| π | Multi-tenant analytics | Per-tenant routing insights |
| π | GraphQL API | Alternative query interface |
We β€οΈ contributions!
# 1. Fork & clone
git clone https://github.com/YOUR_USERNAME/decision-engine.git
# 2. Create branch
git checkout -b feature/your-feature
# 3. Make changes & test
cargo test
# 4. Submit PR!π See CONTRIBUTING.md for guidelines.
π± New to open source? Check out good first issues!
| Platform | What It's For |
|---|---|
| Real-time help, discussions | |
| GitHub Discussions | Ideas, feature requests |
| GitHub Issues | Bug reports |
Licensed under GNU AGPL v3.0.
Built with β€οΈ by Juspay
Reliable, open-source payments infrastructure for the world.

