vue-credit-card-validation icon indicating copy to clipboard operation
vue-credit-card-validation copied to clipboard

The expiration year is not validated correctly

Open mtzrmzia opened this issue 2 years ago • 2 comments

This issue also can be checked on the example page https://wuori.github.io/vue-credit-card-validation/example/

If you try to set a two digits year before 2000, like '99', '98' and so on the focus is set to CVC input and the validator doesn't work

CleanShot 2022-03-30 at 14 41 46@2x

but if you set the full year like '1999', '1998' the validator works. CleanShot 2022-03-30 at 14 43 27@2x

mtzrmzia avatar Mar 30 '22 20:03 mtzrmzia

Great find! I'll try to get this updated soon. Feel free to submit a PR in the meantime if you want. Thanks!

wuori avatar Apr 05 '22 06:04 wuori

@IsidroMar95 When you put in 78 it is setting the card expiry year to 2078 which is valid.

While most cards have expiration limits within 20 years, there is no standard to rely upon (at least none that I could find).

If you can find some spec that dictates the max deviation in years for a card's expiration date, please share. Until then, I don't really know the best path to address this issue except for providing an option to set a max years value.

Please let me know your thoughts.

wuori avatar Apr 07 '22 04:04 wuori