card.io-Android-source
card.io-Android-source copied to clipboard
Supporting country specific cards (Brazil - ELO / Hipercard)
THIS IS A QUESTION, NOT AN ISSUE
I'm using CardIO it on a project in Brazil and here we have some non-international credit cards (such as ELO and HIPERCARD, only available here in Brazil) which are not recognized by default. I made a fork of card.io-Android-source and it was not hard to add support for them.
I was planning to submit a PR with those changes, however, as these cards are supported only in Brazil, some of their BIN codes conflict with other cards (for instance, a Diners starts with 38, whereas an HIPERCARD starts with 3841.. Visa cards start with 4, whereas some ELO cards starts with 401178 / 40119 / 431274 / 438935 / 451416 / 457393 / 457631 / 457632 and so on). Thus, as I didn't find any "interval conflicts" on intervalLookup (CardType.java), I don't think it is safe to submit these kind of modifications.
That being said, my question is: Do you have any way to support these country-specific cards that I missed? If not, are you planning to have some CardIO version where these kind of cards are supported?
This type of issue has been brought up before wrt other country-specific cards. As you state, there are conflicts with existing card types, as well as a possibly endless rabbit-hole of these cards. I think it'd be best if we add a developer customization option without the need to fork the project. It would essentially be an override for these country-specific cards. We'd need to push this logic down to the common DMZ layer too, so this is by no means trivial.
@carlospontual Hi How is the status of this implementation, I will use for ELO cards in Brazil
@ricardojlrufino Hi Ricardo, how are you?
Well, as this is something very specific for each country, I've created a fork from Card.io open source and I've added the patterns to match ELO cards.
Fell free to take a look at my fork at https://github.com/carlospontual/card.io-Android-source . If you have any idea for improvements, just open a PR and I'll be glad to review it.
Can your code not be integrated into Card.io?