Validation - Credit Card Validation

Look at Luhn algorithm - Wikipedia.

It's a good screen against flat-out invalid numbers. After that, it's
between you and your credit card payment acceptor.

active merchant comes w/ somr luhn javascript validation too