CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Finance & Banking

🏦 Finance & Banking · C4 Architecture · Pro

Payment Gateway Architecture

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.

More Finance & Banking templates

C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.

Drawing diagram…

What this diagram shows

  • Merchant checkout and merchant dashboard as separate front ends
  • Fraud checks run before every authorisation
  • Events go to Kafka for settlement, reporting and webhooks

Prompt used

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.

Mermaid code
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")

Related templates

SequenceFinance & Banking

UPI Payment Flow

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.

FlowchartFinance & Banking

Loan Origination Workflow

A personal loan from application to disbursal: KYC, credit bureau check, underwriting rules, manual review for borderline cases, and the final agreement.

SequenceFinance & Banking

Card Payment Authorisation

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.

Data FlowFinance & Banking

Real-Time Fraud Detection Data Flow

How a bank scores every transaction for fraud in milliseconds: features from history, an ML model, rules, and a case queue for analysts.

C4 ArchitectureProFinance & Banking

Core Banking System Architecture

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.

FlowchartFinance & Banking

Digital KYC Onboarding

How a bank or fintech opens an account fully online: Aadhaar/PAN verification, video KYC, risk checks and account creation.