getbouncer / cardscan-android

Scan payment cards quickly and easily, including full number, name, and expiry.
MIT License
192 stars 36 forks source link

How to scan other types of cards? #150

Closed JavaYank closed 4 years ago

JavaYank commented 4 years ago

Hello! Thanks for the library, it scans visa cards well!

How can I scan cards that start with "8600 ..." or "9860 ..." or "6262 ..." ?

awushensky commented 4 years ago

Hi @JavaYank !

Thanks for the question, we're always working to support new types of cards, however this repository is out of date. We released version 2.0 here a few months ago: https://github.com/getbouncer/cardscan-ui-android .

Regarding the IINs you're asking about, we do not currently support these cards, but I'm happy to add support for them. I looked up these numbers on multiple sites (bindb, exactbins, binlookup, etc). but was unable to find any information for 8600 or 9860.

Do you have any details for how these numbers should be handled? I would need to know the valid bins for each range of cards, the issuer name, valid account number lengths (e.g. 16 to 19), valid CVC lengths, and validation algorithm.

You can see our current validation logic here: https://github.com/getbouncer/scan-payment-android/blob/master/scan-payment/src/main/java/com/getbouncer/scan/payment/card/PaymentCardUtils.kt

JavaYank commented 4 years ago

These INNs are valid for Uzbekistan.

  1. Uzcard. It has a number length of only 16 digits. Starts at 8600 31 .., where 860 is the national currency (shorturl.at/fzCH5), and 031 is the bank id. Now the maximum bank id is 059. But in the next 10-15 years, 41 banks will definitely not open for us, so that the id exceeds 100 (example 8601 00 ..). So you can safely use the first 4 digits of 8600 as a Uzkard. https://uzcard.uz/

  2. Uzcard-UnionPay. It has a number length of only 16 digits. Starts with 6262 .... You can safely use the first 4 digits of 6262 as Uzcard-UnionPay.

  3. Uzcard-MIR. MIR is a Russian payment system. It has a number length of only 16 digits. It starts with 5614 .... You can safely use the first 4 digits of 5614 as Uzcard-MIR.

  4. HUMO. This is the second payment system in Uzbekistan. It has a number length of only 16 digits. It starts with 9860 .... You can safely use the first 4 digits of 9860 as HUMO. https://humocard.uz/en/

If you can add please scan the validity of the card and card holder name.

If you need, then I can throw a photo of cards on your mail. Thanks for the help!

awushensky commented 4 years ago

Thanks for the info. I'll confirm these details and put a fix in. It might be a week or two before I have time to implement.

JavaYank commented 4 years ago

Hello! Haven't you edited the library yet?

awushensky commented 4 years ago

hey @JavaYank , sorry for the slow action on this item. We have been very busy implementing other features throughout the code base.

This was prioritized for this week, and we should have methods available by EoW that support adding custom card issuers.

smkuhne commented 4 years ago

@JavaYank You can now add your own valid cards as follows

PaymentCardUtils.supportCardIssuer(626200..626299, CardIssuer.Custom, listOf(16), listOf(3))

The above would roughly mean that you now support cards that start with 6262, that have a length of 16, and with a security code (CVC) of length 3. There is also an optional fifth argument that allows you to change how the card number (pan) is validated.

A more detailed guide on this and related features will be up in the API documentation in the next few days. Please let me know if you have any questions.

awushensky commented 4 years ago

Documentation is now available: https://docs.getbouncer.com/liveness-check/android-integration-guide/android-card-support

JavaYank commented 4 years ago

thank you man)