prolificinteractive / Caishen

A Payment Card UI & Validator for iOS
MIT License
766 stars 119 forks source link

Variable length validation for cards #144

Open MalcolmScoffable opened 6 years ago

MalcolmScoffable commented 6 years ago

Hi there, I'm currently integrating this library into my app, and it's working really well so far. However, one potential issue that I've got is that I do not see any way of handling variable length card numbers (i.e., the VISA spec states that VISA card numbers can be between 13 - 19 digits, however the standard Caishen validation assumes 16 for VISA).

I was wondering if anyone is aware if there is any way of supporting this in the library, and whether this is something that we should even be supporting? I was alerted to the fact that this isn't handled as some of my test cards are 13 digits.

Any ideas on this would be really useful.

HardikDG commented 5 years ago

any update on this? I have a card with 19 digits but it is only taking till 16

Vasia89 commented 4 years ago

I have added some possibility to use variable card length. You could check it in my repo. I did not use UI features from Caishen, so it could have some problems. But card validation and formatting should works.