20 practical articles on card numbers, the Luhn algorithm, network rules, testing and PCI DSS compliance — in English and Arabic.
What the Luhn algorithm actually checks (and what it doesn't) A single formula from 1954 sits behind almost every card number. Here is exactly what it validates, why it catches typos, and why passing it proves nothing about a real account. algorithm · 2025-01-06 · 7 min
Anatomy of a card number (PAN): issuer, account and check digit The 16 digits on a card are three fields in disguise. Understanding them explains why forms can detect Visa after four keystrokes and why lengths vary from 12 to 19. basics · 2025-01-13 · 6 min
Expiry dates: valid through the last day of the month A card marked 05/30 works until 23:59 on 31 May 2030. Small detail, common bug — and one of several traps in a field that looks trivial. basics · 2025-02-10 · 5 min
CVV, CVC, CID: the code you must never store The three- or four-digit code proves the card is physically present. It cannot be derived from the number, cannot be validated offline, and must never be saved — even encrypted. security · 2025-02-17 · 6 min
BIN attacks: why 'valid-looking' numbers are a fraud vector Criminals generate thousands of Luhn-valid numbers from a real issuer prefix and probe merchants in bulk. Understanding this explains most modern checkout defences. security · 2025-02-24 · 7 min
The transposition Luhn cannot catch — and the algorithms that can Luhn detects every single-digit error and most adjacent swaps — except one specific pair, plus a family of twin errors. Here is the math and the stronger alternatives. algorithm · 2025-03-10 · 5 min
3-D Secure in plain language: what happens after the form is valid The extra verification step — a bank-app prompt or one-time code — shifts fraud liability to the issuer and is mandatory for most European payments under PSD2. Here is how it fits with validation. security · 2025-03-24 · 6 min
Tokenization: why your server should never see a PAN Modern checkouts swap the card number for a meaningless token at the edge. It shrinks compliance scope, limits breach impact and keeps subscriptions working when cards are reissued. compliance · 2025-03-31 · 6 min
Sandbox vs. live mode: the switch that bites on launch day Test numbers work only with test API keys; real cards only with live keys. Mixing them is the single most common first-launch failure — here is the checklist that prevents it. testing · 2025-04-07 · 5 min
Masking rules: what you may show on screen, in receipts and in logs PCI allows at most the first six and last four digits to be displayed. Everything else must be hidden — on screens, receipts, emails, support tools and especially logs. compliance · 2025-04-14 · 5 min
Designing card-form error messages that actually help 'Invalid card' is useless. Tell the user what to check, time the message well, and never blame the card for a typo you can see — small wording changes measurably lift checkout completion. basics · 2025-04-28 · 5 min
Why card numbers are 12 to 19 digits long (and 16 is not a rule) ISO/IEC 7812 allows up to 19 digits. Most cards use 16, but assuming 16 breaks Amex, Diners and many Maestro cards — one of the most common validation bugs in the wild. networks · 2025-05-05 · 4 min
Generating mock card numbers responsibly: a developer's guide A mock generator is a legitimate developer tool — as long as it never touches real issuer ranges, never claims the output 'works', and never calls a gateway. Here is the safe recipe this site uses. testing · 2025-05-12 · 6 min
Glossary: 20 payment-card terms every developer meets PAN, IIN, CVV2, AVS, 3DS, issuer, acquirer, token, chargeback… the vocabulary you meet in every payments document, defined in one sentence each with links to go deeper. basics · 2025-05-19 · 7 min