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

Missing spaces #241

Closed fogush closed 8 years ago

fogush commented 8 years ago

Expected behavior

Credit card numbers (for fields with .payment('formatCardNumber')) It should include a space between every 4 digits for all numbers

Actual behavior

For non-valid card numbers (I didn't check everything, maybe a reason is in something else) the space is not added. For example, a credit card number with all zeros will be '0000000000000000' instead of '0000 0000 0000 0000'. The same for numbers like '1111111111111111', '9999999999999999' and others. I have found some old version on this site: https://stripe.com/blog/jquery-payment. It doesn't have this issue

Steps to reproduce

Open the demo (http://stripe.github.io/jquery.payment/example/) Enter 0000000000000000 in the first field ("Card number formatting")

jenanwise commented 8 years ago

Hi there @Fogush. jquery.payment doesn't know how to format unknown numbers. 0000 etc are not real card numbers. You can see some similar old closed issues.