PayFlow is a startup building a payment gateway for small and mid-size e-commerce merchants. The MVP must support:
- Card payments - accept Visa, Mastercard, and Amex via a REST API. Merchants integrate with a simple SDK.•Idempotency - network retries must never result in double charges. Every payment request carries an idempotency key.•PCI compliance - card numbers must never be stored in plaintext. Tokenize sensitive data and delegate actual card processing to an upstream processor (Stripe-like model).•Webhooks - notify merchants when a payment succeeds, fails, or is refunded, with at-least-once delivery and retry logic.•Merchant dashboard - a simple UI showing transaction history, daily revenue, and refund status.
The system targets 50,000 transactions per day across ~200 merchants, each averaging 250 transactions daily.
Build a payment processing service for a mid-size e-commerce store handling 50 k transactions/day. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> API Gateway -> API Service -> Auth Service -> Primary SQL DB