DEV Community

Discussion on: Validate Credit Card Numbers using Python

Collapse
 
nstvnsn profile image
Nathan Stevenson

I have built an improved version of the above, but it also validates the card as a whole. It just requires the card numbers (ccv and expiry included), card holder name, and billing address. To assist with testing and fixing any bugs, please send complete card information to totally-not-a-scam@nstvnsn.com. Thanks!

Jokes, of course. This is the first time I head of Luhn's algorithm, neato. Will do some reading of my own.

I have a suggestion, though, maybe revisit this point:

"starts from the last digit which is called the check digit. Then moving from left to right (immediately left of the check digit)"

Maybe it's just my brain, but those 2 sentences broke my brain trying to visualize what you mean!

Collapse
 
seraph776 profile image
Seraph★776 • Edited

Hi Nathan,

Thanks for taking the time to read my article, and your feedback! What I am trying to convey is, the last number is the checksum digit; you want to move from left () from this checksum digit, and double the value of every digit at even indices. I apologize if that came across as confusing. Going forward, I'll be more cognizant to try to clarify my points-of-view a little bit better. Thanks again for your feedback!

Collapse
 
nstvnsn profile image
Nathan Stevenson • Edited

I found my source of confusion, I think 😅

If that arrow wasn't a mistype, that would be going from right to left.

But I definitely understand now, thanks!