stripe-archive / jquery.payment

[DEPRECATED] A general purpose library for building credit card forms, validating inputs and formatting numbers.
MIT License
3.53k stars 686 forks source link

Updating Elo's patterns #246

Closed danielmedina closed 8 years ago

danielmedina commented 8 years ago

Summary

I updated Elo patterns according to Elo's documentation (attached).

2015_RANGE DE BINS ELO_22122015.pdf

Motivation

Some of my customers are getting your cards unindentified because Elo's patterns are outdated.

Testing

You can use a fiddle I created. https://jsfiddle.net/danielmedinarj/av2m7tx7/

jenanwise commented 8 years ago

Hi @danielmedina!

Those are a lot of bin patterns! Can you please go to into more detail about specific bins that are being misidentified?

As you know, we need a tradeoff between lookup time + library maintenance vs exhaustiveness of the bins. I'm hesitant to merge in such a large set of bins, especially as none of the other cards seem to need it.

danielmedina commented 8 years ago

I checked with Elo's operations here in Brazil about some complaints with some BINs not recognized and they sent me that list with all the BINs used by them. I'm pretty sure that this list increased in size, but with this update there will be no more mistakes about card's brands.

I really think that remove this brand from your library is a reasonable solution. Doing this, only applications that really use this brand will import these rules. By the way, we was doing this untill you insert elo patterns in your library. After that i was forced to use your patterns.

Why don't you put this rule in your library like a extension that we can use or not?

jenanwise commented 8 years ago

@danielmedina You aren't forced to do anything! :) $.payment.cards is public and documented. You can always update it, replace it, whatever:

// on init
$.payment.cards.forEach((card) => {
  if (card.type == 'elo') {
    card.type.patterns = [ // whatever you want here
    ];
  }
});

We added it originally because it's a legit card brand that a user wanted. I agree that a reasonable solution would be to remove it. I will consider the tradeoffs there.

danielmedina commented 8 years ago

You can put these patterns in a file apart on your library too. I think this will be a win-win situation. Your library will be more complete and who don't need to use it simply don't load it.

jenanwise commented 8 years ago

I'm going to close this in favor of #248.

Given the status of the project, we're not going to maintain additional optional pattern lists. You're welcome to publish yours though! :)