amaroteam / react-credit-cards

Beautiful credit cards for your payment forms
https://ovvwzkzry9.codesandbox.io/
MIT License
2.59k stars 301 forks source link

Amex and Diners maxLength #50

Closed kaisermann closed 5 years ago

kaisermann commented 5 years ago

Hi! First of all, thanks for this great component :)

I've hit an issue where the maxLength property for AMEX (15 chars + 2 spaces = 17) and DINERS (14 chars + 2 spaces = 16) doesn't count the spaces in contrast to the maxLength for MASTER and VISA (16 chars + 3 spaces = 19)

https://github.com/amarofashion/react-credit-cards/blob/fea2e002aa63b707cf697b4ae236738c237ad329/src/index.js#L185

Is this the expected behavior? Thanks 😁

gilbarbara commented 5 years ago

Hey,

These limits aren't supposed to include spaces. You can check the limits here and here

kaisermann commented 5 years ago

Oh okay! Thanks for the quick response 😁