Adyen / adyen-cse-web

[DEPRECATED] Client-side encryption on JavaScript
MIT License
15 stars 39 forks source link

adyen.cardtype.determine returns "mc" when card number is undefined or "" #66

Closed lauterry closed 5 years ago

lauterry commented 6 years ago

Hello

In the file addOns.adyen.cardType.js line 61

Cards.determine("") and Cards.determine(undefined) returns "mc".

I think this is not the expected behavior, right ?

If I'm wrong, please explain me why ?

I use this method to detect the cardType and show an icon in the input field depending on the credit card number

capture d ecran 2017-12-11 a 10 29 46

Best regards

ArnoudAdyen commented 6 years ago

Yes. This seems wrong. Arguably there is no sense in calling the method at all in these scenarios, but the code needs to be more defensive about this. I'll have it fixed.

lauterry commented 6 years ago

Do you mean that I should not use this method for my scenario ?

ArnoudAdyen commented 6 years ago

Until it's fixed, it's indeed better to check for empty string and undefined in your own integration before calling the method.

lauterry commented 6 years ago

Yes this is what I have done until the fix is shipped :)

lauterry commented 6 years ago

Hi

Any news on this issue ?