About Payment Orchestration Engine
A payment orchestration service that abstracts multiple payment gateways behind a single API.
It routes transactions across Razorpay and Cashfree, supports automatic gateway fallback, verifies and deduplicates webhooks, and maintains a complete audit trail of payment events. Inspired by the architecture of modern payment orchestration platforms such as Juspay.
Payment Processing
Initiate payments through a single unified API and track the latest payment status and gateway details regardless of the underlying gateway.
Secure Webhooks
Idempotent webhook processing detects and ignores duplicate deliveries while validating webhook authenticity using gateway secrets.
Project Links
Live Applications
Repositories
Architecture Overview
Project Architecture
Database & Module Interactions
System Flow
Payment Initiation
1.Client sends payment initiation request.
2.Payment Module validates request, creates a record.
3.Routing Module selects the appropriate payment gateway.
4.Gateways Module creates the payment with the provider.
5.PostgreSQL updated with gateway's order ID.
Webhook Processing
1.Gateway sends a webhook on status change.
2.Webhooks Module verifies the webhook signature.
3.Duplicate webhook deliveries are detected and ignored.
4.Payment record is located and status updated in PostgreSQL.
5.Processed event recorded for auditing.
Tech Stack
Runtime & Framework
Node.jsExpress.jsTypeScript
Database & ORM
PostgreSQLDrizzle ORM
Gateways
RazorpayCashfree
Validation & Docs
ZodScalar (OpenAPI)
Tools
DockerJest
Security & Monitoring
Security Measures
•Internal API key authentication for service communication.
•Runtime request validation using Zod.
•Cryptographic verification of gateway webhooks.
•Idempotency keys to prevent duplicate payment creation.
Monitoring & Logging
•Consistent error responses across all modules with sanitized responses.
•Structured JSON logging with Pino for debugging and observability.
•Multi-stage Docker builds for consistent deployments.