Eli5: how does platforms like Steam or Amazon know if you’re using a correct visa card or not if you didn’t buy anything with it?

599 views

When you enter your card details to add it to your account and you write 1 number wrong, it instantly tells you that the card is wrong. How do they know?

In: Technology

7 Answers

Anonymous 0 Comments

There is a method called the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) that can be used to check the digits of the card number. The last couple digits of the card number are the result of the Luhn algorithm on the other digits. This is built in as a simple check for errors.

Anonymous 0 Comments

Credit Card numbers are generated with something called the Luhn algorithm. It is a checksum algorithm. It takes the 15 real digits of your credit card and determines the 16th.

This means that only one final digit is valid, and 9 are invalid. If you type a number in wrong, it will definitely fail the checksum.

The algorithm also counts every second digit differently (they’re doubled). This means that simply swapping digits also causes a failure, which is the most common type of error when typing a card number.

Anonymous 0 Comments

The last digit is a checksum: for any given combination of the first 15 digits, there’s only one possible value for the last digit of the card. The website can perform that same calculation to verify that you didn’t make a mistake entering in the card number.

Anonymous 0 Comments

There is some internal logic to the format the numbers should be in. So in many cases a typo of one digit would make the number invalid.

Old computer games could also do that offline where the CD key had to follow a certain format and rules.

Someone else can probably explain in detail how the check actually works.

Anonymous 0 Comments

How the system I work on “knows” is it talks to the banks. They all share data with one another and credit score checking companies. Other companies can then use services to simply attach to the network and get a “yes/no” or more information.

Anonymous 0 Comments

The [Luhn algorithm] (https://en.m.wikipedia.org/wiki/Luhn_algorithm). It’s a simple checksum formula used to validate a variety of identification numbers

Anonymous 0 Comments

I believe similarly to an American SSN, the first 4 numbers of the card are the bank that card is processed through. For example 4833 is Visa where I live. The second set is another specific set of numbers and I believe only the last 4 really specify YOUR card. Hence why when you go to online checkout you see your MasterCard and it only shows the last 4 numbers because that’s the only info you need to distinguish one out of many cards.