Fintech & Banking

How Card Payments Work: Four-Party Model, Authorization and PCI DSS

Intermediate8 min readUpdated

A card tap looks instantaneous, but behind it sit four institutions, several distinct message types and a settlement cycle that finishes days later. This guide walks the whole flow from the card number to the merchant's bank account, and shows which parts of it your code is responsible for.

What you will learn

  • Explain the roles of cardholder, merchant, acquirer, issuer and scheme in the four-party model
  • Decode a card number, validate it with the Luhn algorithm and describe what EMV and tokenisation change
  • Separate authorization, capture, clearing and settlement, and the disputes that follow
  • Apply 3-D Secure and strong customer authentication correctly in a checkout flow
  • Reduce PCI DSS scope by choosing the right integration pattern with a payment service provider

Tapping a card is one of the few consumer experiences that hides an entire industry behind a second of latency. In that second, a request crosses from a terminal to an acquiring bank, over a card scheme's network, into an issuing bank's authorization system, and back again with an approval code. Then, over the following days, an entirely separate set of files moves the money, applies fees and, occasionally, reverses everything.

Engineers usually meet only one slice of this — a checkout form or a terminal SDK — and inherit vocabulary that looks arbitrary until the whole picture is visible. This guide supplies that picture. It assumes the ledger and settlement concepts from payment systems fundamentals; cards are one instrument riding on top of them.

The four-party model

The classic card transaction involves four institutions and one very useful piece of asymmetry.

  • The cardholder holds a card issued to them.
  • The issuer is the cardholder's bank. It owns the account, decides whether to approve a transaction, and bears most fraud losses on authenticated transactions.
  • The merchant sells something and wants to be paid.
  • The acquirer is the merchant's bank. It signs the merchant up, receives transactions from it, and pays the merchant net of fees.
  • The scheme — the card network — sits between issuer and acquirer, providing the switching network, the rulebook, dispute arbitration and the settlement calculation. It is not a party to the sale.

The asymmetry is that the cardholder and merchant have no relationship with each other's bank, yet the transaction works because both banks follow the same rulebook. That rulebook, not any bilateral contract, is what makes a card usable in a country you have never visited.

A three-party model collapses issuer, acquirer and scheme into a single company that has a direct relationship with both cardholder and merchant. It gives that company tighter control over pricing and acceptance, at the cost of much slower merchant coverage. In practice large schemes now blend the two.

Between the merchant and the acquirer, most modern businesses insert a payment service provider (PSP) or gateway, which supplies the APIs, the hosted checkout, the tokens and often the risk engine. Some providers also hold the acquiring licence themselves.

The card, the number and the chip

The primary account number (PAN) is normally 16 digits, though the standard permits up to 19. The leading digits are the issuer identification number (historically the BIN), which identifies the issuing institution, the scheme and the product type, and is how routing and acceptance decisions are made before any network call. The last digit is a check digit computed with the Luhn algorithm.

Validate 4111 1111 1111 1111

Starting from the rightmost digit, double every second digit
(the check digit itself is never doubled). If a doubled value
exceeds 9, subtract 9.

  digits   4  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1
  double   x     x     x     x     x     x     x     x
  becomes  8  1  2  1  2  1  2  1  2  1  2  1  2  1  2  1

  sum = 8 + (7 x 2) + (8 x 1) = 8 + 14 + 8 = 30
  30 mod 10 == 0  ->  the number is internally consistent

To generate a check digit rather than verify one, run the same weighting over the number with a zero in the final position and take (10 - sum mod 10) mod 10.

function luhnValid(pan) {
  let sum = 0;
  for (let i = 0; i < pan.length; i++) {
    let d = pan.charCodeAt(pan.length - 1 - i) - 48;
    if (d < 0 || d > 9) return false;
    if (i % 2 === 1) { d *= 2; if (d > 9) d -= 9; }
    sum += d;
  }
  return pan.length >= 12 && sum % 10 === 0;
}

Physically, the card has moved a long way from the magnetic stripe, which stored a static copy of the data and could therefore be cloned by anyone who read it once. EMV chip cards replace that with a small computer that signs a cryptogram over the transaction details using a key that never leaves the chip, so a captured transcript cannot be replayed. Contactless is the same cryptography over a radio interface, with offline limits and periodic PIN requests to bound the risk of a lost card.

In a wallet on a phone or watch, the card is network tokenised: the wallet holds a device-specific token PAN issued by the scheme's token service rather than the real number, with its own cryptogram per transaction. If the token leaks it is useless on another device, and the underlying card need not be reissued. Card-on-file tokenisation applies the same idea to subscriptions, and has the pleasant side effect that expiry-date updates propagate without the customer doing anything.

The three or four digits printed on the card (the security code) exist only to prove possession in remote transactions. Storing it after authorization is prohibited outright — there is no compliant configuration in which you keep it.

Authorization, capture, clearing, settlement

Four words that beginners use interchangeably and that mean four separate things.

Authorization asks the issuer, in real time, to check the account and reserve the amount. The reply is an approval code or a decline reason. No money moves; the reservation reduces the cardholder's available balance and expires after a scheme-defined period if unused.

Capture (or completion) tells the acquirer that the goods have shipped and the merchant now claims the amount. Many businesses authorise at checkout and capture at dispatch; hotels and fuel pumps authorise an estimate and capture a different final amount, within limits.

Clearing is the exchange of captured transaction records between acquirer and issuer through the scheme, typically in daily batches, applying interchange and scheme fees along the way.

Settlement is the actual movement of funds between the banks, netted by the scheme, followed by the acquirer paying the merchant on its own schedule.

Day 0  10:32  Authorization request  (terminal -> acquirer -> scheme -> issuer)
       10:32  Approval, funds reserved on the cardholder account
Day 1  09:00  Capture / presentment batch sent by the acquirer
Day 1  22:00  Clearing: scheme computes net positions, applies fees
Day 2  08:00  Interbank settlement
Day 3        Merchant credited, net of the merchant service charge
Day 40       Cardholder disputes -> chargeback -> possible representment

Fees flow in the opposite direction to the money. The merchant pays its acquirer a service charge, out of which the acquirer pays interchange to the issuer and a fee to the scheme. Interchange is the reason issuers can offer free cards and rewards, and the reason regulators in several regions have capped it for consumer cards. Treat the mechanics as conceptual here — the rates change and are jurisdiction-specific.

Chargebacks are the dispute mechanism. A cardholder complains to their issuer, the issuer pulls the funds back from the acquirer under a reason code (fraud, non-delivery, incorrect amount, duplicate processing), and the merchant may respond with evidence in a representment. Chargeback ratios are monitored by the schemes and a persistently high ratio costs a merchant its acceptance. Practically, this means your systems must be able to produce, months later, the proof of what was ordered, authenticated, shipped and delivered — an argument for keeping immutable order and authentication logs.

Authentication: 3-D Secure and SCA

Remote transactions have no chip to prove the card is present, so the schemes built 3-D Secure: an authentication step run between the merchant, the scheme's directory server and the issuer's access control server. The first generation was the notorious pop-up password page. The current generation is risk-based: the merchant sends a rich set of device, transaction and behavioural data, and the issuer decides between a frictionless approval and a challenge (typically a push notification in the banking app).

Under European rules, strong customer authentication requires two independent factors from knowledge, possession and inherence for most electronic payments, with defined exemptions — low-value transactions, recurring payments of a fixed amount after the first, merchants the cardholder has whitelisted, and transaction-risk analysis below a fraud-rate threshold. The regulatory context is the same one described in PSD2 and open banking.

Two engineering consequences follow. First, authentication is asynchronous and may redirect or open an app, so your checkout must be resumable: a customer who authenticates on their phone and returns two minutes later must not lose the basket. Second, successful authentication generally shifts fraud liability to the issuer, so the business case for a challenge is not only compliance — it changes who pays when the transaction turns out to be fraudulent.

{
  "amount": { "currency": "EUR", "value": 4990 },
  "paymentMethod": { "type": "scheme", "token": "tok_9f3c1a7b" },
  "authentication": {
    "threeDSRequestorChallengeIndicator": "no-preference",
    "exemption": "transaction-risk-analysis"
  },
  "merchantOrderReference": "ORD-2026-114522",
  "shopperInteraction": "Ecommerce"
}

PCI DSS and keeping your scope small

The Payment Card Industry Data Security Standard applies to any organisation that stores, processes or transmits cardholder data. Its requirements cover network segmentation, encryption in transit and at rest, access control, logging, vulnerability management and regular testing; the validation effort ranges from a short self-assessment questionnaire to an on-site audit depending on volume and integration type.

The single most valuable architectural decision is to stay out of the cardholder data environment altogether. Ranked from least to most burdensome:

  1. Redirect or hosted payment page. The customer enters the card on the provider's page. Your servers never see a PAN.
  2. Hosted fields / iframe. The card inputs are rendered by the provider inside your checkout, so the look is yours and the data is theirs. This is the usual sweet spot.
  3. Client-side encryption or direct-to-provider API. The browser encrypts or posts card data straight to the provider; your backend receives only a token.
  4. Server-side collection. Your application receives raw PANs. Full audit scope, penetration testing, segmentation, key management — only worth it with a strong reason.

Whichever you pick, the standard defences still apply: never log a PAN or security code (scrub at the logging framework, not at each call site), mask to first six and last four where display is genuinely needed, keep tokens rather than numbers in your database, and treat the checkout page as security-critical because a script injected there defeats every iframe. The OWASP Top 10 and application security architecture guides cover the surrounding hygiene.

Integrating with a provider

A workable integration checklist, learned the expensive way by many teams:

  • Idempotency on every mutating call. A retried capture must not capture twice; send a stable key derived from your order identifier.
  • Webhooks are the source of truth, not the HTTP response. Authorization results, chargebacks and settlement notifications arrive asynchronously, possibly out of order and more than once. Verify signatures, deduplicate on the event id, and make handlers idempotent.
  • Store the provider's references — authorization code, transaction id, token, scheme reference — next to your order. Every support conversation and every dispute needs them.
  • Reconcile the settlement report daily against your own records, matching on the provider's reference, and alert on unmatched items in both directions.
  • Model partial captures, partial refunds and expiries explicitly. They are not edge cases; they are Tuesday.
  • Test declines, not just approvals. Providers publish test cards for insufficient funds, expired cards, do-not-honour, 3-D Secure challenge and timeouts. A checkout that only handles success is half written.
  • Never build your own retry loop over a decline. Repeated attempts on a declined card are penalised by the schemes and are how a merchant ends up on a monitoring programme.

Design the API boundary so that the provider is replaceable: a small internal payment abstraction with your own status vocabulary, mapped at the edge, spares you a rewrite when commercial terms change. The general principles in REST API design apply directly.

Key takeaways

  • Four institutions — issuer, acquirer, scheme and merchant, usually plus a PSP — cooperate under a scheme rulebook that neither the cardholder nor the merchant signs.
  • The PAN encodes the issuer in its leading digits and ends in a Luhn check digit that catches typing errors and nothing more.
  • EMV cryptograms and network tokens replace static, clonable card data with per-transaction proof, which is why wallets are safer than the numbers behind them.
  • Authorization reserves, capture claims, clearing exchanges records and settlement moves the money — days apart, with disputes reaching back months.
  • 3-D Secure and strong customer authentication add friction but shift fraud liability; build a checkout that can be interrupted and resumed.
  • Choose an integration that keeps card data out of your servers; PCI DSS scope is decided by architecture long before it is decided by paperwork.

Sources and further reading

Frequently asked questions

Why is an authorization not the same as a payment?
An authorization only asks the issuer to reserve funds and confirm it will honour a later claim; nothing is transferred and the reservation expires if unused. The merchant must capture, which converts the reservation into a claim, and that claim is then cleared and settled over the following days. Refunds, expiries and partial captures all live between those two steps.
Does the Luhn check tell me a card is real?
No. Luhn is a checksum that catches mistyped or transposed digits before you send a request anywhere; roughly one random sixteen-digit string in ten passes it. Whether the account exists, has funds or is stolen can only be answered by the issuer, and only through an authorization request. Use Luhn for form validation and nothing else.
How does tokenisation reduce PCI DSS scope?
If the real card number never enters your systems, the systems that would otherwise store, process or transmit it fall outside the cardholder data environment. Hosted fields or a redirect keep the number inside the provider's iframe or page, and you hold only a token that is useless elsewhere. Scope is reduced by architecture, not by a policy document.
Who pays when a customer disputes a transaction?
The scheme's dispute rules allocate liability case by case. As a rule of thumb, if the merchant took the payment without the required authentication the merchant carries the loss; if the cardholder authenticated with strong customer authentication the liability generally shifts to the issuer. Fraud is only one dispute category — non-delivery and processing errors are common too.