Skip to content

juspay/decision-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

376 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rust License Docker Release Slack



⚑ Decision Engine

The Brain Behind Smarter Payments

Open-Source β€’ High-Performance β€’ Success Rate Based

Route payments intelligently. Maximize success rates. Zero vendor lock-in.


πŸš€ Quick Start β€’ πŸ“š Documentation β€’ πŸ— Architecture β€’ 🀝 Contributing


🎯 What is Decision Engine?

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    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why Teams Choose Decision Engine

πŸ’₯ 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

✨ Features

🧠 Intelligent Routing

Feature What It Does
Eligibility Check Filters out ineligible gateways before routing
Rule-Based Ordering Apply merchant-specific priority rules
Dynamic Ordering Success rate based gateway optimization
Downtime Detection Auto-pause failing gateways

πŸ›  Built for Production

Capability Details
⚑ Blazing Fast Fast routing decisions
πŸ” Memory Safe Built in Rust β€” no data races
πŸ“Š Multi-DB MySQL & PostgreSQL support
🐳 Docker Ready One-command deployment
☸️ K8s Native Helm charts included

πŸ“Š Performance at a Glance

Metric Value
Routing Decision Time Low latency
Memory Footprint ~50MB
Concurrent Requests 100K+
Uptime SLA Support 99.99%

πŸƒ Quick Start

🐳 Docker (Recommended)

# 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

πŸ¦€ From Source

# 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_router

βœ… Verify

curl http://localhost:8080/health
# β†’ {"message":"Health is good"}

πŸ“– Documentation

πŸ“˜ 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

πŸ— Architecture

High-Level Flow

Decision Engine Architecture

Integration Pattern

Decision Engine integrates seamlessly into your existing payment stack:

Integration Pattern

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

πŸ—Ί Roadmap

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

🀝 Contributing

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!


πŸ’¬ Community

Platform What It's For
Slack Real-time help, discussions
GitHub Discussions Ideas, feature requests
GitHub Issues Bug reports

πŸ“œ License

Licensed under GNU AGPL v3.0.


Built with ❀️ by Juspay

Reliable, open-source payments infrastructure for the world.

⬆ Back to Top

About

open-source routing system designed for payment processing

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors