Hacker News new | ask | show | jobs
by castis 3257 days ago
To just validate the numbers themselves, you can use https://en.wikipedia.org/wiki/Luhn_algorithm

Beyond that, I'm not sure what that person is talking about.

1 comments

FYI that's not enough. That may act as a form validation, but does not verify that the card is active and able to be used. Anyone can run the Luhn against a card # - but thieves have known CC numbers and want to verify they can be used. As a merchant you have to be somewhat on top of your orders and cancel any "suspicious" ones to prevent chargebacks.
Well aware, thanks. I only ever stated that the Luhn algorithm would validate just the numbers.