Who Is Involved in a Card Payment
- You and your card.
- The acquirer: the shop’s bank (or a payment company working with it), which lets the shop accept cards through a card machine or a payment processor.
- The card network: Visa, Mastercard, RuPay and others. It routes the message between banks and sets the rules.
- The issuer: your bank, which gave you the card. It normally makes the final yes-or-no decision.
How a Card Payment Works, Step by Step
When you tap or insert your card, the chip uses secret cryptographic keys stored securely inside it to generate a cryptogram: a code worked out from the details of this payment, valid for this payment only. Because a new one is generated every time, simply copying the data from one payment isn’t enough to make another valid one. Then:
- The terminal sends the amount, card details and the cryptogram to the shop’s bank (the acquirer).
- The acquirer sends an authorisation request to the card network.
- The network reads the first digits of the card number and routes the request to your bank (the issuer).
- Your bank checks the card, your credit limit, the cryptogram and sometimes the PIN, and runs a fraud check.
- If all is well, it approves, puts a hold on that amount of your limit, and sends back an approval code.
- The answer travels back the same way, and the terminal shows Approved.
In India, contactless payments up to a limit set by the RBI (₹5,000 per payment at the time of writing) can go through without a PIN. Above that, you’ll be asked for your PIN.
Why Was My Credit Card Declined?
- Not enough limit left for the amount.
- Wrong PIN or OTP.
- Card blocked, expired or not yet activated.
- That kind of use is switched off. In India, online, contactless and international use can each be turned on or off in your bank’s app.
- The fraud check said no. Your bank scores every payment in milliseconds (amount, place, shop, your usual pattern), and an unusual one can be declined or sent for an extra check.
Online Payments: OTP and Tokenisation
Paying online, nobody can see your card, so India requires a second check. This is usually an OTP sent to your registered mobile number, though banks can also use other methods the RBI allows.
Apart from your bank and the card network, the companies in the payment chain, including shops, aren’t allowed to store your actual card number for online payments. Instead, a token stands in for it. Depending on the type, a token is tied to one shop (when you save a card on a website) or to one device (when you add a card to your phone). The shop can’t work out your real card number from it, so a leak from one shop doesn’t expose your actual card.
After Approval: Clearing and Settlement
Approved only reserves the amount against your credit limit. No money has moved to the shop yet. Later, the shop sends its approved payments for clearing: the network works out what each bank owes the others. Then settlement moves the money between the banks, on a schedule set by each network.
For accepting cards, the shop pays a fee called the merchant discount rate (MDR). It covers interchange paid to your bank, the card network’s fees and the acquirer’s processing charges, split in different ways for different cards. The MDR is the shop’s cost, not yours. The purchase appears in your card account and on the statement for the billing cycle it falls in.
For Engineers: Deciding in Milliseconds
Authorisation messages travel in the ISO 8583 format, and the issuer has a very short window, often a few hundred milliseconds, to answer. Inside that window it must validate the card and the cryptogram, check the available credit, run its fraud checks and send back a decision.
It must also survive timeouts and retries without charging the same payment twice. That means telling a retry of the same payment apart from a genuinely new one, rather than simply rejecting every repeat. If the issuer can’t be reached, the network may make the decision on its behalf within agreed rules, called stand-in processing.
All of this happens while you stand at the counter, waiting for the beep. The fraud engine, making a risk decision under a hard time limit, is one of the most interesting systems to build.
From Building Payment Systems
I built an SDK around a card management system (CMS): the system a card issuer uses to run all its card operations, from issuing and blocking cards to billing. The card status it holds is one of the first things your bank checks when it decides whether a card is valid.
After we rolled it out, one of the most challenging scaling problems wasn’t a payment at all. It was statement generation. When a billing cycle closes, thousands of statements have to be produced within a narrow window, and the load arrives as a single burst, typically lasting about an hour. We redesigned the system so that each statement became a separate job placed in a queue (Amazon SQS). A pool of workers (on ECS Fargate) picks up jobs from the queue, and the pool grows automatically as the queue gets longer. Once the backlog is cleared, it shrinks back to zero. The extra computing power was needed only for that hour, so we pay for it only while statements are being generated, rather than paying for peak capacity all month.
This article explains how the systems work. It is not financial advice, and limits and rules change: check the current ones with RBI, NPCI or your bank.