
🏦 Finance & Banking · C4 Architecture · Pro
A payment gateway that lets online merchants accept cards and UPI: the checkout, the payment core with fraud checks, and the card networks and banks it connects to.
C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.
Drawing diagram…
A payment gateway for online merchants. Customers pay on a hosted checkout page. An API gateway routes to a payment service that calls a fraud detection service before authorising with card networks or the UPI switch. Transactions are stored in PostgreSQL and events are published to Kafka, which a settlement service and a webhook service consume. Merchants see payments in a merchant dashboard.
C4Container
title Payment Gateway
Person(customer, "Customer", "Pays for an order")
Person(merchant, "Merchant", "Tracks payments")
System_Boundary(pg, "Payment Gateway") {
Container(checkout, "Hosted Checkout", "React", "Card and UPI payment page")
Container(dash, "Merchant Dashboard", "Angular", "Payments, refunds, reports")
Container(api, "API Gateway", "Envoy", "Auth and routing")
Container(pay, "Payment Service", "Java", "Authorise and capture")
Container(fraud, "Fraud Service", "Python", "Risk score per payment")
Container(settle, "Settlement Service", "Go", "Daily payouts")
ContainerDb(db, "Transactions DB", "PostgreSQL", "Payments and refunds")
ContainerQueue(bus, "Event Bus", "Kafka", "Payment events")
}
System_Ext(network, "Card Networks / UPI", "Visa, Mastercard, NPCI")
Rel(customer, checkout, "Pays on")
Rel(merchant, dash, "Uses")
Rel(checkout, api, "Calls", "HTTPS")
Rel(dash, api, "Calls", "HTTPS")
Rel(api, pay, "Routes")
Rel(pay, fraud, "Checks risk")
Rel(pay, network, "Authorises")
Rel(pay, db, "Stores")
Rel(pay, bus, "Publishes")
Rel(bus, settle, "Consumed by")The steps behind a UPI payment: the payer's app, the payer's bank, NPCI's UPI switch and the payee's bank, from entering a UPI ID to the money arriving.
A personal loan from application to disbursal: KYC, credit bureau check, underwriting rules, manual review for borderline cases, and the final agreement.
What happens in the second after a card is tapped or entered online: the acquirer, card network and issuing bank authorise the payment, with 3-D Secure for online payments.
How a bank scores every transaction for fraud in milliseconds: features from history, an ML model, rules, and a case queue for analysts.
The main building blocks of a bank's core platform: accounts, deposits, loans, payments and the general ledger, used by branches, internet banking and mobile.
How a bank or fintech opens an account fully online: Aadhaar/PAN verification, video KYC, risk checks and account creation.