How yatinsharda/payment-gateway-system-design works
This repository is a system-design document for a payment gateway, not an implementation. Its principal workflow is a merchant request entering through the API Gateway, being authenticated, then orchestrated by the Payment Service through idempotency, risk checks, tokenization and processor routing. The design also documents payment lifecycle operations, ledger records, asynchronous webhooks and reconciliation. Relationships below follow the README’s diagrams and prose; the tree contains no service source, so implementation-level wiring is not available.
Main entry points: README.md Payment Service
Components 16
Merchant Entry
- API Gateway
README.md - Auth Service
README.md
Payment Processing
- Payment Service
README.md - Tokenization
README.md - Risk Service
README.md - Payment Router
README.md
Records and Events
- Payment Database
README.md - Redis Cache
README.md - Ledger Database
README.md - Message Broker
README.md
Operations
- Webhook Service
README.md - Reconciliation Service
README.md - Monitoring / Logging
README.md
Other components
- Customer
- Merchant App
- Processors / Acquirers
Connections 22
- Customer → Merchant App: initiates payment
- Merchant App → API Gateway: sends requests
- API Gateway → Auth Service: authenticates
- API Gateway → Payment Service: routes requests
- Payment Service → Redis Cache: checks idempotency
- Payment Service → Payment Database: reads and writes
- Payment Service → Tokenization: tokenizes method
- Payment Service → Risk Service: checks risk
- Payment Service → Payment Router: routes payment
- Payment Router → Processors / Acquirers: sends transactions
- Processors / Acquirers → Payment Router: returns decisions
- Payment Service → Ledger Database: records entries
- Payment Service → Message Broker: publishes events
- Message Broker → Webhook Service: dispatches events
- Webhook Service → Merchant App: sends webhooks
- Reconciliation Service → Processors / Acquirers: compares records
- Reconciliation Service → Payment Database: reads records
- Reconciliation Service → Ledger Database: reads records
- API Gateway → Monitoring / Logging: reports telemetry
- Payment Service → Monitoring / Logging: reports telemetry
- Payment Router → Monitoring / Logging: reports telemetry
- Webhook Service → Monitoring / Logging: reports telemetry