stripe-archive / jquery.payment

[DEPRECATED] A general purpose library for building credit card forms, validating inputs and formatting numbers.
MIT License
3.53k stars 686 forks source link

'4222 2222 2222 2' is "valid" #255

Closed oaleynik closed 8 years ago

oaleynik commented 8 years ago

Expected behavior

Should be false (right?)

Actual behavior

$.payment.validateCardNumber('4222 2222 2222 2') // => true

shaun-stripe commented 8 years ago

Thanks for reporting. I'm not sure what's causing this-- any fewer or more digits will cause the valid check to fail. We can only handle critical bugs right now for this project, so we have to close.

jenan-stripe commented 8 years ago

It's correct behavior. Visas can be from 13 to 16 digits long: https://github.com/stripe/jquery.payment/blob/f0e303b3769e9bbbc22ca2eb4a3e97f64745ab33/src/jquery.payment.coffee#L43