Project 6: Full Payment Processing Simulator (Capstone)

Project 6: Full Payment Processing Simulator (Capstone)

Project Overview

Attribute Value
Difficulty Level 5: Expert
Time Estimate 2-3 months
Programming Language Multi-language (system components)
Knowledge Area Full Payment Ecosystem
Key Technologies All previous projects + Settlement, Fraud Detection
Coolness Level Level 5: Industry Expert
Business Potential 5. Deep Domain Expertise

Learning Objectives

By completing this capstone project, you will:

  1. Build a complete payment ecosystem - All parties from merchant to issuer
  2. Understand multi-party cryptographic trust - Each partyโ€™s keys and certificates
  3. Implement authorization AND settlement - Dual-message transaction flow
  4. Handle chargebacks and disputes - What happens when security fails
  5. Integrate fraud detection - Risk scoring and decision rules
  6. Master the four-party model - Merchant, Acquirer, Network, Issuer

The Core Question Youโ€™re Answering

โ€œHow does money actually move when you swipe a credit card?โ€

Most developers understand authorization (โ€œcard approvedโ€), but thatโ€™s only half the story. This project teaches the complete flow from card swipe to money in the merchantโ€™s bank account.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    THE COMPLETE PAYMENT LIFECYCLE                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  PHASE 1: AUTHORIZATION (milliseconds)                                   โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                  โ”‚
โ”‚  "Can this card pay $100?"                                              โ”‚
โ”‚                                                                          โ”‚
โ”‚  Customer โ†’ Merchant โ†’ Acquirer โ†’ Network โ†’ Issuer                      โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                        โ”‚
โ”‚                    "APPROVED" or "DECLINED"                              โ”‚
โ”‚                                                                          โ”‚
โ”‚  NO MONEY MOVES YET! Just a promise from the issuer.                    โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€   โ”‚
โ”‚                                                                          โ”‚
โ”‚  PHASE 2: CAPTURE (hours later)                                         โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                          โ”‚
โ”‚  "I'm ready to collect that $100"                                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  Merchant โ†’ Acquirer: "Here's my authorized transaction"                โ”‚
โ”‚  (Batch of all day's transactions)                                      โ”‚
โ”‚                                                                          โ”‚
โ”‚  STILL NO MONEY MOVES! Just confirmation to collect.                    โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€   โ”‚
โ”‚                                                                          โ”‚
โ”‚  PHASE 3: CLEARING (that night)                                         โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                           โ”‚
โ”‚  "Everyone reconcile your transactions"                                  โ”‚
โ”‚                                                                          โ”‚
โ”‚  Acquirer โ†’ Network: "I have $1M in Visa transactions"                  โ”‚
โ”‚  Network: "Let me match these with issuers..."                          โ”‚
โ”‚  Network โ†’ Issuer: "Your cardholders spent $500K"                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  NUMBERS ARE AGREED, but still no money.                                โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€   โ”‚
โ”‚                                                                          โ”‚
โ”‚  PHASE 4: SETTLEMENT (next business day)                                โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                 โ”‚
โ”‚  "Move the money!"                                                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  Issuer Bank โ†’ Fed Wire โ†’ Acquiring Bank                                โ”‚
โ”‚                                                                          โ”‚
โ”‚  FINALLY: Money moves from cardholder's bank to merchant's bank        โ”‚
โ”‚                                                                          โ”‚
โ”‚  Total time: 1-3 business days                                          โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Deep Theoretical Foundation

1. The Four-Party Model

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      FOUR-PARTY MODEL                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚                                                                          โ”‚
โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚     โ”‚  CARDHOLDER  โ”‚                          โ”‚   MERCHANT   โ”‚          โ”‚
โ”‚     โ”‚              โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ”‚  Has card    โ”‚โ—„โ”€โ”€โ”€โ”€โ”€PURCHASEโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  Sells goods โ”‚          โ”‚
โ”‚     โ”‚  from issuer โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚            โ”‚                                         โ”‚                   โ”‚
โ”‚            โ”‚ Account                                 โ”‚ Account           โ”‚
โ”‚            โ”‚ relationship                            โ”‚ relationship      โ”‚
โ”‚            โ–ผ                                         โ–ผ                   โ”‚
โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚     โ”‚    ISSUER    โ”‚                          โ”‚   ACQUIRER   โ”‚          โ”‚
โ”‚     โ”‚              โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ”‚  Cardholder'sโ”‚โ—„โ”€โ”€โ”€โ”€SETTLEMENTโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  Merchant's  โ”‚          โ”‚
โ”‚     โ”‚  bank        โ”‚                          โ”‚  bank        โ”‚          โ”‚
โ”‚     โ”‚              โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ”‚  โ€ข Issues    โ”‚                          โ”‚  โ€ข Processes โ”‚          โ”‚
โ”‚     โ”‚    cards     โ”‚                          โ”‚    payments  โ”‚          โ”‚
โ”‚     โ”‚  โ€ข Authorizesโ”‚                          โ”‚  โ€ข Settles   โ”‚          โ”‚
โ”‚     โ”‚    purchases โ”‚                          โ”‚    funds     โ”‚          โ”‚
โ”‚     โ”‚  โ€ข Bears     โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ”‚    credit    โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ”‚    risk      โ”‚                          โ”‚              โ”‚          โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚            โ”‚                                         โ”‚                   โ”‚
โ”‚            โ”‚                                         โ”‚                   โ”‚
โ”‚            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
โ”‚                              โ”‚                                           โ”‚
โ”‚                              โ–ผ                                           โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚                    โ”‚   CARD NETWORK   โ”‚                                 โ”‚
โ”‚                    โ”‚   (Visa, MC)     โ”‚                                 โ”‚
โ”‚                    โ”‚                  โ”‚                                 โ”‚
โ”‚                    โ”‚  โ€ข Routes auth   โ”‚                                 โ”‚
โ”‚                    โ”‚  โ€ข Clears txns   โ”‚                                 โ”‚
โ”‚                    โ”‚  โ€ข Sets rules    โ”‚                                 โ”‚
โ”‚                    โ”‚  โ€ข Manages       โ”‚                                 โ”‚
โ”‚                    โ”‚    disputes      โ”‚                                 โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚
โ”‚                                                                          โ”‚
โ”‚  MONEY FLOW:                                                             โ”‚
โ”‚  Cardholder โ”€โ”€โ–บ Issuer โ”€โ”€โ–บ Network โ”€โ”€โ–บ Acquirer โ”€โ”€โ–บ Merchant            โ”‚
โ”‚           (credit)   (settlement)  (settlement)  (deposit)              โ”‚
โ”‚                                                                          โ”‚
โ”‚  FEE FLOW:                                                               โ”‚
โ”‚  Merchant pays: Interchange (to Issuer) + Network Fee + Acquirer Fee    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2. ISO 8583 Message Format

ISO 8583 is THE standard for authorization messages:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      ISO 8583 MESSAGE STRUCTURE                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  MTI (4 bytes): Message Type Indicator                          โ”‚    โ”‚
โ”‚  โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                          โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Format: XYZW where:                                            โ”‚    โ”‚
โ”‚  โ”‚  X = Version (0=1987, 1=1993, 2=2003)                          โ”‚    โ”‚
โ”‚  โ”‚  Y = Class (1=Auth, 2=Financial, 4=Reversal, 8=Network)        โ”‚    โ”‚
โ”‚  โ”‚  Z = Function (0=Request, 1=Response, 2=Advice)                โ”‚    โ”‚
โ”‚  โ”‚  W = Origin (0=Acquirer, 1=Repeat, 2=Issuer)                   โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Examples:                                                       โ”‚    โ”‚
โ”‚  โ”‚  0100 = Authorization Request (acquirer to network)             โ”‚    โ”‚
โ”‚  โ”‚  0110 = Authorization Response (network to acquirer)            โ”‚    โ”‚
โ”‚  โ”‚  0200 = Financial Request (purchase)                            โ”‚    โ”‚
โ”‚  โ”‚  0400 = Reversal Request                                        โ”‚    โ”‚
โ”‚  โ”‚  0800 = Network Management Request (echo, key exchange)        โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  BITMAP (8-16 bytes): Which data elements are present           โ”‚    โ”‚
โ”‚  โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•           โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Primary bitmap:   64 bits for data elements 1-64               โ”‚    โ”‚
โ”‚  โ”‚  Secondary bitmap: 64 bits for data elements 65-128             โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Example: 7234054020C00000                                      โ”‚    โ”‚
โ”‚  โ”‚  Binary:  0111 0010 0011 0100...                               โ”‚    โ”‚
โ”‚  โ”‚           โ”‚โ”‚โ”‚         โ”‚                                         โ”‚    โ”‚
โ”‚  โ”‚           โ”‚โ”‚โ””โ”€ DE3    โ””โ”€ DE7                                    โ”‚    โ”‚
โ”‚  โ”‚           โ”‚โ””โ”€โ”€ DE2                                              โ”‚    โ”‚
โ”‚  โ”‚           โ””โ”€โ”€โ”€ Secondary bitmap present                         โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  DATA ELEMENTS: The actual transaction data                     โ”‚    โ”‚
โ”‚  โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                      โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  DE2:  Primary Account Number (PAN)                             โ”‚    โ”‚
โ”‚  โ”‚  DE3:  Processing Code (what kind of transaction)               โ”‚    โ”‚
โ”‚  โ”‚  DE4:  Transaction Amount                                       โ”‚    โ”‚
โ”‚  โ”‚  DE7:  Transmission Date/Time                                   โ”‚    โ”‚
โ”‚  โ”‚  DE11: System Trace Audit Number (STAN)                        โ”‚    โ”‚
โ”‚  โ”‚  DE12: Local Transaction Time                                   โ”‚    โ”‚
โ”‚  โ”‚  DE13: Local Transaction Date                                   โ”‚    โ”‚
โ”‚  โ”‚  DE14: Expiration Date                                          โ”‚    โ”‚
โ”‚  โ”‚  DE22: Point of Service Entry Mode                              โ”‚    โ”‚
โ”‚  โ”‚  DE23: Card Sequence Number                                     โ”‚    โ”‚
โ”‚  โ”‚  DE35: Track 2 Data                                             โ”‚    โ”‚
โ”‚  โ”‚  DE37: Retrieval Reference Number                               โ”‚    โ”‚
โ”‚  โ”‚  DE38: Authorization Identification Response                    โ”‚    โ”‚
โ”‚  โ”‚  DE39: Response Code                                            โ”‚    โ”‚
โ”‚  โ”‚  DE41: Card Acceptor Terminal ID                               โ”‚    โ”‚
โ”‚  โ”‚  DE42: Card Acceptor Merchant ID                               โ”‚    โ”‚
โ”‚  โ”‚  DE43: Card Acceptor Name/Location                             โ”‚    โ”‚
โ”‚  โ”‚  DE55: ICC System Related Data (EMV chip data)                 โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

3. Settlement and Clearing

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      SETTLEMENT PROCESS                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  END OF BUSINESS DAY                                                     โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                     โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  MERCHANT BATCH CLOSE                                           โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Terminal batches all day's transactions:                       โ”‚    โ”‚
โ”‚  โ”‚  - TXN001: $50.00  (Visa, captured)                            โ”‚    โ”‚
โ”‚  โ”‚  - TXN002: $125.00 (MC, captured)                              โ”‚    โ”‚
โ”‚  โ”‚  - TXN003: $30.00  (Visa, void)                                โ”‚    โ”‚
โ”‚  โ”‚  - TXN004: $200.00 (Visa, captured)                            โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Batch total: $375.00 (2 Visa, 1 MC)                           โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Sent to Acquirer                                               โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                       โ”‚                                  โ”‚
โ”‚                                       โ–ผ                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  ACQUIRER AGGREGATION                                           โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Combines batches from all merchants:                           โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Visa transactions:   $5,234,567.00  (12,456 txns)             โ”‚    โ”‚
โ”‚  โ”‚  Mastercard:          $3,456,789.00  (8,234 txns)              โ”‚    โ”‚
โ”‚  โ”‚  Amex:                $1,234,567.00  (2,345 txns)              โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Creates clearing files for each network                        โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                       โ”‚                                  โ”‚
โ”‚                                       โ–ผ                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  NETWORK CLEARING (VisaNet, Mastercard Network)                 โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  1. Receives clearing files from all acquirers                  โ”‚    โ”‚
โ”‚  โ”‚  2. Matches transactions with original authorizations          โ”‚    โ”‚
โ”‚  โ”‚  3. Routes to issuing banks                                     โ”‚    โ”‚
โ”‚  โ”‚  4. Calculates interchange fees                                 โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚  INTERCHANGE CALCULATION                                 โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚                                                          โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚  Transaction: $100.00                                    โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚  Interchange: 1.80% + $0.10 = $1.90                     โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚                                                          โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚  Merchant receives: $100 - $1.90 - fees                  โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚  Issuer receives:   $1.90 (for card benefits, fraud)    โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚                                                          โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                       โ”‚                                  โ”‚
โ”‚                                       โ–ผ                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  SETTLEMENT (Money Movement)                                    โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Network calculates net positions:                              โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Issuer A owes: $1,234,567                                     โ”‚    โ”‚
โ”‚  โ”‚  Issuer B owes: $2,345,678                                     โ”‚    โ”‚
โ”‚  โ”‚  Acquirer X receives: $2,567,890                               โ”‚    โ”‚
โ”‚  โ”‚  Acquirer Y receives: $1,012,355                               โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Wire transfers via Federal Reserve or correspondent banks    โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  COMPLETE: Merchant's bank account credited                    โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

4. Chargeback Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      CHARGEBACK PROCESS                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  REASON CODES (Examples):                                                โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                 โ”‚
โ”‚  โ€ข 10.4: Fraud - Card-Absent Environment                                โ”‚
โ”‚  โ€ข 13.1: Merchandise/Services Not Received                              โ”‚
โ”‚  โ€ข 13.3: Not as Described                                               โ”‚
โ”‚  โ€ข 12.6: Duplicate Processing                                           โ”‚
โ”‚                                                                          โ”‚
โ”‚  TIMELINE (Visa):                                                        โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  Day 0    โ”‚ Day 75          โ”‚ Day 90          โ”‚ Day 120               โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€   โ”‚
โ”‚  Purchase โ”‚ Cardholder      โ”‚ Issuer files    โ”‚ Representment        โ”‚
โ”‚           โ”‚ disputes        โ”‚ chargeback      โ”‚ deadline             โ”‚
โ”‚           โ”‚                 โ”‚                 โ”‚                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  STEP 1: CARDHOLDER DISPUTE                                     โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Cardholder: "I don't recognize this $200 charge"               โ”‚    โ”‚
โ”‚  โ”‚  Contacts: Issuing bank                                         โ”‚    โ”‚
โ”‚  โ”‚  Bank investigates, may issue provisional credit                โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                           โ”‚                              โ”‚
โ”‚                                           โ–ผ                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  STEP 2: CHARGEBACK FILED                                       โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Issuer โ†’ Network โ†’ Acquirer โ†’ Merchant                        โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Chargeback message includes:                                   โ”‚    โ”‚
โ”‚  โ”‚  - Original transaction details                                 โ”‚    โ”‚
โ”‚  โ”‚  - Reason code                                                  โ”‚    โ”‚
โ”‚  โ”‚  - Documentation required from merchant                         โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Merchant's account DEBITED for transaction amount              โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                           โ”‚                              โ”‚
โ”‚                                           โ–ผ                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  STEP 3: MERCHANT REPRESENTMENT (optional)                      โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Merchant can fight the chargeback with evidence:               โ”‚    โ”‚
โ”‚  โ”‚  - Signed receipt                                               โ”‚    โ”‚
โ”‚  โ”‚  - Delivery confirmation                                        โ”‚    โ”‚
โ”‚  โ”‚  - AVS/CVV match confirmation                                   โ”‚    โ”‚
โ”‚  โ”‚  - 3D Secure authentication proof                               โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  If successful: Merchant re-credited, cardholder debited        โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                           โ”‚                              โ”‚
โ”‚                                           โ–ผ                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  STEP 4: ARBITRATION (if still disputed)                        โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚  Network makes final decision                                   โ”‚    โ”‚
โ”‚  โ”‚  Losing party pays arbitration fee ($500+)                      โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ”‚  LIABILITY SHIFT WITH 3D SECURE:                                         โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                         โ”‚
โ”‚  If merchant used 3D Secure and cardholder authenticated:               โ”‚
โ”‚  - Fraud liability shifts to ISSUER                                     โ”‚
โ”‚  - Chargeback reason 10.4 not available to cardholder                   โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

5. Fraud Detection

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      FRAUD DETECTION SIGNALS                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  VELOCITY CHECKS:                                                        โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                         โ”‚
โ”‚  โ€ข Same card, multiple transactions in short time                       โ”‚
โ”‚  โ€ข Same card, multiple merchants in different locations                 โ”‚
โ”‚  โ€ข Same IP, multiple different cards                                    โ”‚
โ”‚  โ€ข Same device fingerprint, multiple cards                              โ”‚
โ”‚                                                                          โ”‚
โ”‚  BEHAVIORAL ANOMALIES:                                                   โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                    โ”‚
โ”‚  โ€ข Purchase amount unusually high for cardholder                        โ”‚
โ”‚  โ€ข Purchase category unusual (e.g., electronics for groceries card)    โ”‚
โ”‚  โ€ข Geographic anomaly (card used 1000 miles from home)                 โ”‚
โ”‚  โ€ข Time anomaly (3AM purchase, normally 9-5 usage)                     โ”‚
โ”‚                                                                          โ”‚
โ”‚  DEVICE/NETWORK SIGNALS:                                                 โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                 โ”‚
โ”‚  โ€ข Known fraud proxy/VPN                                                 โ”‚
โ”‚  โ€ข TOR exit node                                                         โ”‚
โ”‚  โ€ข Device previously used in fraud                                       โ”‚
โ”‚  โ€ข Browser fingerprint mismatch                                          โ”‚
โ”‚                                                                          โ”‚
โ”‚  RISK SCORING MODEL:                                                     โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                                    โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ”‚   Signal                      โ”‚ Points โ”‚ Threshold Action        โ”‚    โ”‚
โ”‚  โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ”‚โ•โ•โ•โ•โ•โ•โ•โ•โ”‚โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•   โ”‚    โ”‚
โ”‚  โ”‚   New card, first purchase    โ”‚   +20  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   High-risk merchant category โ”‚   +15  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   Amount > 3x average         โ”‚   +25  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   IP in different country     โ”‚   +30  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   Known good device           โ”‚   -40  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   Previous 3DS success        โ”‚   -20  โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                        โ”‚    โ”‚
โ”‚  โ”‚   Score < 30                  โ”‚        โ”‚ Approve                 โ”‚    โ”‚
โ”‚  โ”‚   Score 30-60                 โ”‚        โ”‚ 3DS Challenge           โ”‚    โ”‚
โ”‚  โ”‚   Score 60-80                 โ”‚        โ”‚ Manual Review           โ”‚    โ”‚
โ”‚  โ”‚   Score > 80                  โ”‚        โ”‚ Auto-Decline            โ”‚    โ”‚
โ”‚  โ”‚                                                                  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Project Specification

What Youโ€™ll Build

A complete payment ecosystem simulator including:

  1. Merchant Checkout System - Web interface for purchases
  2. Payment Gateway - Merchantโ€™s processor (from Project 5)
  3. Card Network Switch - Routes between acquirers and issuers
  4. Issuer Authorization System - Approves/declines transactions
  5. Settlement System - Batch clearing and money movement
  6. Chargeback System - Dispute handling workflow
  7. Fraud Detection Engine - Real-time risk scoring
  8. Admin Dashboard - Visualize money flow and security events

System Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    FULL ECOSYSTEM COMPONENTS                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                      WEB INTERFACE                                 โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  Merchant   โ”‚  โ”‚  Admin      โ”‚  โ”‚ Cardholder  โ”‚               โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  Checkout   โ”‚  โ”‚  Dashboard  โ”‚  โ”‚ Portal      โ”‚               โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                    โ”‚                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                      ACQUIRER DOMAIN                               โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ Payment Gateway โ”‚  โ”‚ 3DS Server      โ”‚  โ”‚ Settlement      โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ (Project 5)     โ”‚  โ”‚ (Project 4)     โ”‚  โ”‚ Engine          โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ”‚           โ”‚                    โ”‚                    โ”‚             โ”‚  โ”‚
โ”‚  โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚  โ”‚
โ”‚  โ”‚                                โ”‚                                   โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚              Token Vault (Project 2)                       โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                    โ”‚                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                      NETWORK DOMAIN                                โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ Switch (Router) โ”‚  โ”‚ Clearing House  โ”‚  โ”‚ Dispute Manager โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚                 โ”‚  โ”‚                 โ”‚  โ”‚                 โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข BIN routing   โ”‚  โ”‚ โ€ข Match txns    โ”‚  โ”‚ โ€ข Chargeback    โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข Load balance  โ”‚  โ”‚ โ€ข Calc fees     โ”‚  โ”‚ โ€ข Represent     โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข Fallback      โ”‚  โ”‚ โ€ข Net settle    โ”‚  โ”‚ โ€ข Arbitration   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ”‚           โ”‚                    โ”‚                    โ”‚             โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚              โ”‚                    โ”‚                    โ”‚                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                      ISSUER DOMAIN                                 โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ Authorization   โ”‚  โ”‚ Fraud Engine    โ”‚  โ”‚ ACS (3DS)       โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ System          โ”‚  โ”‚                 โ”‚  โ”‚                 โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚                 โ”‚  โ”‚ โ€ข Velocity      โ”‚  โ”‚ โ€ข Risk decide   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข Check funds   โ”‚  โ”‚ โ€ข Behavior      โ”‚  โ”‚ โ€ข Challenge     โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข Apply rules   โ”‚  โ”‚ โ€ข ML scoring    โ”‚  โ”‚ โ€ข Authenticate  โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚ โ€ข Respond       โ”‚  โ”‚                 โ”‚  โ”‚                 โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ”‚           โ”‚                    โ”‚                    โ”‚             โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚                    Cardholder Accounts                      โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ”‚Card A โ”‚ โ”‚Card B โ”‚ โ”‚Card C โ”‚ โ”‚Card D โ”‚                   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ”‚$5000  โ”‚ โ”‚$2500  โ”‚ โ”‚$10000 โ”‚ โ”‚$1500  โ”‚                   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚   โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Expected Demo Output

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    PAYMENT ECOSYSTEM SIMULATOR                         โ•‘
โ•‘                    Live Transaction Dashboard                          โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                                        โ•‘
โ•‘  REAL-TIME TRANSACTION FLOW                                            โ•‘
โ•‘  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                                            โ•‘
โ•‘                                                                        โ•‘
โ•‘  TXN: 7f3a9b2c โ”‚ Amount: $149.99 โ”‚ Card: Visa ****4242                โ•‘
โ•‘                                                                        โ•‘
โ•‘  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ•‘
โ•‘  โ”‚                                                                  โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.001] MERCHANT    โ†’ Checkout initiated                โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.023] GATEWAY     โ†’ Card tokenized: tok_xyz           โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.045] GATEWAY     โ†’ Auth request to network           โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.067] NETWORK     โ†’ Routing to Visa (BIN: 424242)     โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.089] ISSUER      โ†’ Fraud check: Score 23 (LOW)       โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.112] ISSUER      โ†’ Balance check: $5000 available    โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.134] ISSUER      โ†’ โœ“ APPROVED (Auth: A12345)         โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.156] NETWORK     โ†’ Response routed to acquirer       โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.178] GATEWAY     โ†’ Response to merchant              โ”‚  โ•‘
โ•‘  โ”‚  [14:32:17.200] MERCHANT    โ†’ Order confirmed                   โ”‚  โ•‘
โ•‘  โ”‚                                                                  โ”‚  โ•‘
โ•‘  โ”‚  Total latency: 199ms                                           โ”‚  โ•‘
โ•‘  โ”‚                                                                  โ”‚  โ•‘
โ•‘  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ•‘
โ•‘                                                                        โ•‘
โ•‘  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”   โ•‘
โ•‘                                                                        โ•‘
โ•‘  DAILY STATISTICS                                                      โ•‘
โ•‘  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                                                      โ•‘
โ•‘                                                                        โ•‘
โ•‘  Authorizations:  15,234  โ”‚  Approved: 14,123 (92.7%)                 โ•‘
โ•‘  Captures:        13,891  โ”‚  Refunds:     342 (2.5%)                  โ•‘
โ•‘  Chargebacks:         23  โ”‚  Fraud:        12 (0.08%)                 โ•‘
โ•‘                                                                        โ•‘
โ•‘  Settlement Status: PENDING (closes at 23:00 UTC)                     โ•‘
โ•‘  Pending Amount: $1,234,567.89                                        โ•‘
โ•‘                                                                        โ•‘
โ•‘  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”   โ•‘
โ•‘                                                                        โ•‘
โ•‘  FRAUD ALERTS                                                          โ•‘
โ•‘  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                                                          โ•‘
โ•‘                                                                        โ•‘
โ•‘  ๐Ÿšจ [14:31:45] High-risk transaction declined                         โ•‘
โ•‘     Card: ****9876 โ”‚ Amount: $2,500 โ”‚ Score: 87 โ”‚ Reason: Velocity    โ•‘
โ•‘                                                                        โ•‘
โ•‘  โš ๏ธ  [14:28:12] Transaction sent to manual review                     โ•‘
โ•‘     Card: ****5555 โ”‚ Amount: $800 โ”‚ Score: 65 โ”‚ Reason: New device    โ•‘
โ•‘                                                                        โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Project Structure

payment_ecosystem/
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ merchant/                     # Merchant checkout system
โ”‚   โ”‚   โ”œโ”€โ”€ checkout-web/             # Web frontend
โ”‚   โ”‚   โ””โ”€โ”€ checkout-api/             # Backend
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ acquirer/                     # Acquirer domain
โ”‚   โ”‚   โ”œโ”€โ”€ gateway/                  # Payment gateway (Project 5)
โ”‚   โ”‚   โ”œโ”€โ”€ threeds-server/           # 3DS Server (Project 4)
โ”‚   โ”‚   โ”œโ”€โ”€ token-vault/              # Token vault (Project 2)
โ”‚   โ”‚   โ””โ”€โ”€ settlement/               # Settlement engine
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ network/                      # Card network
โ”‚   โ”‚   โ”œโ”€โ”€ switch/                   # Message router
โ”‚   โ”‚   โ”œโ”€โ”€ clearing/                 # Clearing house
โ”‚   โ”‚   โ””โ”€โ”€ disputes/                 # Chargeback management
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ issuer/                       # Issuing bank
โ”‚       โ”œโ”€โ”€ authorization/            # Auth engine
โ”‚       โ”œโ”€โ”€ fraud-engine/             # Fraud detection
โ”‚       โ”œโ”€โ”€ acs/                      # 3DS ACS (Project 4)
โ”‚       โ””โ”€โ”€ accounts/                 # Cardholder accounts
โ”‚
โ”œโ”€โ”€ shared/
โ”‚   โ”œโ”€โ”€ iso8583/                      # Message format library
โ”‚   โ”œโ”€โ”€ crypto/                       # Cryptography utilities
โ”‚   โ””โ”€โ”€ audit/                        # Logging framework
โ”‚
โ”œโ”€โ”€ infrastructure/
โ”‚   โ”œโ”€โ”€ docker-compose.yml            # Full system orchestration
โ”‚   โ”œโ”€โ”€ k8s/                          # Kubernetes configs (optional)
โ”‚   โ””โ”€โ”€ scripts/
โ”‚       โ”œโ”€โ”€ generate-keys.sh          # Key generation
โ”‚       โ”œโ”€โ”€ simulate-day.sh           # Day of transactions
โ”‚       โ””โ”€โ”€ run-settlement.sh         # Settlement batch
โ”‚
โ”œโ”€โ”€ admin-dashboard/                  # Visualization UI
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ public/
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ integration/                  # End-to-end tests
โ”‚   โ”œโ”€โ”€ performance/                  # Load tests
โ”‚   โ””โ”€โ”€ security/                     # Penetration tests
โ”‚
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ architecture.md
    โ”œโ”€โ”€ message-flows.md
    โ””โ”€โ”€ security-controls.md

Implementation Guide

Phase 1: ISO 8583 Message Library

Goal: Build the messaging foundation.

# iso8583/message.py

from dataclasses import dataclass
from typing import Dict, Optional
import struct

@dataclass
class ISO8583Message:
    mti: str                          # Message Type Indicator
    bitmap: bytes                     # Which fields present
    data_elements: Dict[int, bytes]   # Field number -> value

    def encode(self) -> bytes:
        """Encode message to bytes for transmission"""
        result = self.mti.encode('ascii')
        result += self.bitmap
        for de_num in sorted(self.data_elements.keys()):
            result += self._encode_field(de_num, self.data_elements[de_num])
        return result

    @classmethod
    def decode(cls, data: bytes) -> 'ISO8583Message':
        """Decode bytes to message"""
        mti = data[0:4].decode('ascii')
        bitmap = data[4:12]  # Primary bitmap
        # Parse data elements based on bitmap...

@dataclass
class AuthorizationRequest(ISO8583Message):
    """0100 - Authorization Request"""
    pan: str                          # DE2
    processing_code: str              # DE3
    amount: int                       # DE4 (in cents)
    transmission_datetime: str        # DE7
    stan: str                         # DE11
    expiry: str                       # DE14
    pos_entry_mode: str               # DE22
    terminal_id: str                  # DE41
    merchant_id: str                  # DE42

    def __post_init__(self):
        self.mti = "0100"
        self.data_elements = {
            2: self.pan.encode(),
            3: self.processing_code.encode(),
            4: str(self.amount).zfill(12).encode(),
            7: self.transmission_datetime.encode(),
            11: self.stan.encode(),
            14: self.expiry.encode(),
            22: self.pos_entry_mode.encode(),
            41: self.terminal_id.encode(),
            42: self.merchant_id.encode(),
        }
        self.bitmap = self._calculate_bitmap()

Phase 2: Network Switch

Goal: Route authorization requests to correct issuer.

# network/switch.py

class CardNetworkSwitch:
    def __init__(self):
        self.issuer_connections: Dict[str, IssuerConnection] = {}
        self.routing_table = BINRoutingTable()

    async def process_authorization(self, request: AuthorizationRequest) -> AuthorizationResponse:
        # 1. Validate message format
        self._validate_message(request)

        # 2. Determine issuer from BIN
        bin_prefix = request.pan[:6]
        issuer_id = self.routing_table.lookup(bin_prefix)

        if not issuer_id:
            return AuthorizationResponse(
                response_code="14",  # Invalid card number
                message="Unknown issuer"
            )

        # 3. Route to issuer
        issuer = self.issuer_connections.get(issuer_id)
        if not issuer or not issuer.is_connected:
            # Try fallback
            issuer = self._get_fallback_issuer(issuer_id)

        # 4. Forward and await response
        response = await issuer.send_authorization(request)

        # 5. Log for clearing
        await self.clearing_queue.enqueue(ClearingRecord(
            request=request,
            response=response,
            timestamp=datetime.utcnow()
        ))

        return response

Phase 3: Issuer Authorization

Goal: Implement cardholder account management and authorization logic.

# issuer/authorization.py

class IssuerAuthorizationEngine:
    def __init__(self, fraud_engine: FraudEngine, account_db: AccountDatabase):
        self.fraud_engine = fraud_engine
        self.account_db = account_db

    async def authorize(self, request: AuthorizationRequest) -> AuthorizationResponse:
        # 1. Look up cardholder account
        account = await self.account_db.get_by_pan(request.pan)
        if not account:
            return self._decline("14", "Invalid card")

        # 2. Check card status
        if account.card_status != CardStatus.ACTIVE:
            return self._decline("05", f"Card {account.card_status}")

        # 3. Check expiry
        if self._is_expired(request.expiry):
            return self._decline("54", "Expired card")

        # 4. Fraud check
        fraud_result = await self.fraud_engine.evaluate(request, account)
        if fraud_result.action == FraudAction.DECLINE:
            return self._decline("59", "Fraud suspected")
        if fraud_result.action == FraudAction.CHALLENGE:
            return self._request_3ds(request)

        # 5. Check available funds
        if account.available_credit < request.amount:
            return self._decline("51", "Insufficient funds")

        # 6. Place hold on funds
        hold = await self.account_db.place_hold(
            account_id=account.id,
            amount=request.amount,
            merchant=request.merchant_id,
            expiry=datetime.utcnow() + timedelta(days=7)
        )

        # 7. Return approval
        return AuthorizationResponse(
            response_code="00",
            auth_code=self._generate_auth_code(),
            available_balance=account.available_credit - request.amount
        )

Phase 4: Fraud Detection Engine

Goal: Real-time risk scoring.

# issuer/fraud_engine.py

class FraudEngine:
    def __init__(self):
        self.velocity_checker = VelocityChecker()
        self.behavior_analyzer = BehaviorAnalyzer()
        self.device_intelligence = DeviceIntelligence()

    async def evaluate(self, request: AuthorizationRequest,
                       account: CardholderAccount) -> FraudResult:
        score = 0
        signals = []

        # Velocity checks
        velocity_result = await self.velocity_checker.check(request.pan)
        if velocity_result.txn_count_1h > 5:
            score += 30
            signals.append("HIGH_VELOCITY")

        # Behavior analysis
        behavior = await self.behavior_analyzer.analyze(request, account)
        if behavior.amount_unusual:
            score += 25
            signals.append("UNUSUAL_AMOUNT")
        if behavior.merchant_category_unusual:
            score += 15
            signals.append("UNUSUAL_MCC")
        if behavior.time_unusual:
            score += 10
            signals.append("UNUSUAL_TIME")

        # Device/location checks
        device_result = await self.device_intelligence.check(
            ip=request.source_ip,
            device_fingerprint=request.device_id
        )
        if device_result.is_known_fraud_proxy:
            score += 40
            signals.append("FRAUD_PROXY")
        if device_result.geo_distance_from_home > 1000:  # km
            score += 20
            signals.append("GEO_ANOMALY")

        # Known good signals (reduce score)
        if await self._is_trusted_device(request.device_id, account):
            score -= 30
        if await self._recent_3ds_success(account):
            score -= 20

        # Make decision
        if score >= 80:
            action = FraudAction.DECLINE
        elif score >= 50:
            action = FraudAction.CHALLENGE
        elif score >= 30:
            action = FraudAction.STEP_UP
        else:
            action = FraudAction.APPROVE

        return FraudResult(
            score=max(0, score),
            action=action,
            signals=signals
        )

Phase 5: Settlement Engine

Goal: Batch processing and money movement.

# acquirer/settlement.py

class SettlementEngine:
    def __init__(self):
        self.transaction_store = TransactionStore()
        self.network_client = NetworkSettlementClient()

    async def run_settlement(self, settlement_date: date):
        """Run end-of-day settlement"""

        # 1. Collect all captured transactions for the day
        transactions = await self.transaction_store.get_captured_for_date(settlement_date)

        # 2. Group by card network
        by_network = self._group_by_network(transactions)

        settlement_results = []

        for network, txns in by_network.items():
            # 3. Calculate totals
            gross_amount = sum(t.amount for t in txns)
            interchange_fees = sum(self._calc_interchange(t) for t in txns)
            net_amount = gross_amount - interchange_fees

            # 4. Create clearing file
            clearing_file = self._create_clearing_file(network, txns)

            # 5. Submit to network
            result = await self.network_client.submit_clearing(network, clearing_file)

            settlement_results.append(SettlementResult(
                network=network,
                transaction_count=len(txns),
                gross_amount=gross_amount,
                interchange=interchange_fees,
                net_amount=net_amount,
                clearing_reference=result.reference
            ))

            # 6. Update transaction statuses
            for txn in txns:
                txn.status = TransactionStatus.SETTLED
                txn.settlement_date = settlement_date
                txn.clearing_reference = result.reference
                await self.transaction_store.update(txn)

        return settlement_results

    def _calc_interchange(self, txn: Transaction) -> Decimal:
        """Calculate interchange fee based on card type and MCC"""
        # Simplified - real interchange tables are complex
        base_rate = Decimal("0.0180")  # 1.80%
        fixed_fee = Decimal("0.10")    # $0.10

        return (txn.amount * base_rate) + fixed_fee

Phase 6: Chargeback System

Goal: Handle disputes and representment.

# network/disputes.py

class DisputeManager:
    def __init__(self):
        self.dispute_store = DisputeStore()
        self.acquirer_client = AcquirerNotificationClient()

    async def file_chargeback(self, chargeback: Chargeback):
        """Process a chargeback from issuer"""

        # 1. Validate chargeback
        if not self._is_valid_reason_code(chargeback.reason_code):
            raise InvalidChargebackError("Unknown reason code")

        # 2. Check timeframes
        original_txn = await self._get_original_transaction(chargeback.original_txn_id)
        if not self._within_chargeback_window(original_txn):
            raise ChargebackWindowExpired()

        # 3. Check if 3DS protected
        if original_txn.eci in ["05", "02"]:  # Fully authenticated
            if chargeback.reason_code.startswith("10."):  # Fraud
                # Liability shift - reject chargeback
                return ChargebackResult(
                    status="REJECTED",
                    reason="Liability shift applies - 3DS authenticated"
                )

        # 4. Store chargeback
        dispute = Dispute(
            id=generate_dispute_id(),
            original_transaction=original_txn,
            chargeback=chargeback,
            status=DisputeStatus.PENDING,
            created_at=datetime.utcnow(),
            representment_deadline=datetime.utcnow() + timedelta(days=30)
        )
        await self.dispute_store.create(dispute)

        # 5. Notify acquirer/merchant
        await self.acquirer_client.notify_chargeback(dispute)

        # 6. Debit merchant account (provisional)
        await self._debit_merchant(original_txn.merchant_id, original_txn.amount)

        return ChargebackResult(
            status="ACCEPTED",
            dispute_id=dispute.id
        )

    async def representment(self, dispute_id: str, evidence: RepresentmentEvidence):
        """Merchant disputes the chargeback"""

        dispute = await self.dispute_store.get(dispute_id)

        if datetime.utcnow() > dispute.representment_deadline:
            raise RepresentmentWindowExpired()

        # Update dispute with evidence
        dispute.representment = evidence
        dispute.status = DisputeStatus.REPRESENTMENT_FILED
        await self.dispute_store.update(dispute)

        # Route to issuer for review
        await self.issuer_client.send_representment(dispute)

Phase 7: Admin Dashboard

Goal: Visualization of the entire system.

Build a web dashboard showing:

  • Real-time transaction flow (WebSocket updates)
  • Authorization statistics
  • Fraud alerts
  • Settlement status
  • Chargeback queue
  • Money flow visualization

Testing Strategy

End-to-End Tests

# tests/integration/test_full_flow.py

async def test_complete_purchase_to_settlement():
    """Test entire lifecycle: auth โ†’ capture โ†’ settle"""

    # 1. Create test cardholder with balance
    account = await create_test_account(credit_limit=1000)

    # 2. Initiate purchase
    response = await merchant_checkout(
        pan=account.pan,
        amount=Decimal("100.00")
    )
    assert response.status == "APPROVED"

    # 3. Capture
    capture_response = await gateway_capture(response.transaction_id)
    assert capture_response.status == "CAPTURED"

    # 4. Run settlement
    settlement_result = await run_settlement(date.today())

    # 5. Verify
    assert settlement_result.net_amount == Decimal("98.10")  # After fees
    assert account.balance == Decimal("100.00")  # Cardholder charged

async def test_fraud_decline():
    """Test high-risk transaction gets declined"""

    account = await create_test_account()

    # Simulate suspicious activity
    await inject_fraud_signals(
        pan=account.pan,
        ip="185.x.x.x",  # Known fraud proxy
        velocity=10  # 10 transactions in 1 hour
    )

    response = await merchant_checkout(
        pan=account.pan,
        amount=Decimal("2500.00")  # High amount
    )

    assert response.status == "DECLINED"
    assert response.reason == "Fraud suspected"

async def test_chargeback_with_3ds():
    """Test that 3DS blocks fraud chargebacks"""

    # Purchase with 3DS authentication
    response = await merchant_checkout_with_3ds(
        pan="4111111111111111",
        amount=Decimal("500.00")
    )
    assert response.eci == "05"  # Fully authenticated

    # Attempt fraud chargeback
    chargeback_result = await issuer_file_chargeback(
        transaction_id=response.transaction_id,
        reason_code="10.4",  # Fraud
        amount=Decimal("500.00")
    )

    assert chargeback_result.status == "REJECTED"
    assert "Liability shift" in chargeback_result.reason

Load Testing

# tests/performance/load_test.py

async def test_authorization_throughput():
    """Verify system handles target TPS"""

    target_tps = 100  # Transactions per second
    duration_seconds = 60

    results = await run_load_test(
        endpoint="/authorize",
        tps=target_tps,
        duration=duration_seconds
    )

    assert results.successful_rate > 0.999  # 99.9% success
    assert results.p99_latency_ms < 500     # Under 500ms
    assert results.p50_latency_ms < 100     # Median under 100ms

Self-Assessment Checklist

Core Functionality

  • Authorization requests flow through entire system
  • Responses route back correctly
  • Settlement batches process nightly
  • Money totals match at each stage

Security

  • All components use proper encryption
  • Keys managed with split knowledge
  • Audit logs capture all transactions
  • No PAN leakage anywhere

Fraud Detection

  • Velocity checks block rapid-fire fraud
  • Behavior analysis flags anomalies
  • Risk scores drive decisions
  • 3DS integration works correctly

Compliance

  • Can map each component to PCI requirement
  • Data retention policies enforced
  • Chargeback handling follows network rules

Understanding

  • Can explain four-party model to anyone
  • Understand authorization vs. settlement
  • Know how interchange fees work
  • Understand liability shift

Resources

Specifications

  • ISO 8583 (1987, 1993, 2003 versions)
  • Visa BASE I and II
  • Mastercard Network Rules
  • EMVCo specifications

Books

| Topic | Book | |โ€”โ€”-|โ€”โ€”| | Distributed Systems | โ€œDesigning Data-Intensive Applicationsโ€ by Kleppmann | | Fraud Detection | โ€œData Science for Businessโ€ by Provost & Fawcett | | Payment Systems | Industry white papers from Visa/Mastercard |


Conclusion

By completing this capstone project, you will have built the most comprehensive payment system simulation possible outside of an actual financial institution. Youโ€™ll understand:

  • Every party in a credit card transaction
  • How money actually moves through the system
  • Why each security control exists
  • What happens when things go wrong (chargebacks, fraud)
  • The economics of payment processing

This knowledge is rare and valuable. Most developers never get this deep into payment infrastructure.

Youโ€™re not just building softwareโ€”youโ€™re learning how global commerce works.