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

specific patterns must be analysed first to prevent false positives. #230

Closed danielmedina closed 8 years ago

danielmedina commented 8 years ago

Summary

I changed the pattern's order to analyse more specific rules (in my case, elo rules) first.

Creating this pull request to make easier to merge

Motivation

When your library analyse credit card patterns, it stops at first match. In my case, using elo bins, some numbers was identificated as maestro cards. I will attach all the bins used by elo in Brazil.

Testing

You alread had elo tests. I created two fiddles to test this solution with my bin list.

This is with your library nowadays -> https://jsfiddle.net/nd3o81uq/3/ This is with my modifications, in my fork -> https://jsfiddle.net/ay2rgoua/

Attached file -> all elo Bins used in Brazil elo_rangebinsproduto.pdf