Payment Orchestration Layer
System diagram
Architectural overview
The orchestration layer sits between your product and one or more gateways. It handles routing, retries, idempotency, and webhook normalization. Product code talks only to the orchestrator; gateway adapters are pluggable.
Tradeoffs
- Single abstraction simplifies product code but adds a hop and operational surface.
- Unified response shape can hide gateway-specific details; expose when needed for ops.
Scaling considerations
Scale orchestrator horizontally; use queues for async processing. Rate-limit per gateway. Cache gateway credentials and config.
Common pitfalls
- Not idempotent at orchestrator boundary, so retries create duplicate payments.
- Webhooks processed synchronously, blocking response and causing timeouts.