Adyen / adyen-cse-web

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

Method for detecting credit card type on adyen object #45

Closed nkovacic closed 5 years ago

nkovacic commented 7 years ago

There is no method on the adyen object for detecting credit card type, which are needed for custom payment form integration with modern frameworks. The method that is currently present requires a DOM form which is not desirable. Is this planned in any future release?

ArnoudAdyen commented 7 years ago

No. We don't have concrete plans to clone the card type detection in a way that requires no DOM.

I will however consider this a feature request and as such leave this thread open until we get to it.

voronianski commented 7 years ago

@ArnoudAdyen request is valid because without card type detection this api - https://github.com/Adyen/adyen-cse-web#javascript-only-integration is useless

voronianski commented 7 years ago

@ArnoudAdyen we also need such method or at least cards list from https://github.com/Adyen/adyen-cse-web/blob/master/js/addOns/adyen.cardtype.js#L47

rvanlaak commented 7 years ago

Based on the credit card type we show the users how much transaction costs they have to pay. This detection and validation really has to be improved, especially as new "sub" card types were launched lately.

We for instance need to be able to detect if a creditcard is a "bijcard" or "visa dk" card. The major problem: we did configure additional transaction costs on these cards (or even better, the parent "visa") at the skin, but because of the partial CSE detection we now can not show our users the transaction costs.

lancergr commented 7 years ago

Hi @rvanlaak Is adyen.cardTypes.determine() sufficient for you? https://github.com/Adyen/adyen-cse-web/blob/master/js/addOns/adyen.cardtype.js#L61

lauterry commented 7 years ago

Hi @lancergr

I'm using adyen.cardTypes.determine(creditCardNumber) but it doesn't seem to work.

I have entered a correct credit card and the methodcard.setCardNumber(variant).isCardNumber() return false

I'm using Adyen version 0.1.18 JavaScript-only integration

BTW, is the argument of determine function a credit Card Number ?

Does the card type detection work with JavaScript-only integration of Adyen ?

Thx

lauterry commented 7 years ago

Hi @lancergr

Please ignore my previous comment.

I was passing "4111-1111-1111-1111" instead of "4111-1111-1111-1111" to the determine function.

Everything works as expected.

Sorry for the noise