← InfraDraft

Fintech & Commerce

Design a Payment Gateway (Stripe clone, strict idempotency focus)

A payment processing gateway routing transactions to card networks and banks while guaranteeing exactly-once charge semantics via strict idempotency.

Open and Simulate this Architecture in InfraDraft

Core Architectural Components

Idempotency Key Store

Guarantees a retried charge request never results in a duplicate charge.

Payment Orchestration Service

State machine driving a payment through authorized → captured → settled or failed.

Card Network/Bank Integration Adapter

Translates internal payment intent into the external network's protocol.

Tokenization & Vaulting Service

Isolates raw card data to a minimal PCI-scoped boundary.

Webhook Delivery Service

Reliably notifies merchants of async payment state changes.

Fraud/Risk Scoring Integration

Screens transactions before authorization.

Ledger/Reconciliation Service

Keeps internal accounting consistent with what actually settled.

Retry & Dead-Letter Queue for Failed Charges

Handles transient failures without silently dropping a payment.