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. #225

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.

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

jenanwise commented 8 years ago

@danielmedina This change looks good, but I'll take care of incrementing versions separately. Can you make this PR just 1 commit w/o the version changes? Thanks!

danielmedina commented 8 years ago

You can ignore the increment version part. I didn't know that whill appear on pull request. Sorry about my delay. Github didn't warn me about your answer.

jenanwise commented 8 years ago

@danielmedina If you use git rebase you can change your branch locally and then git push --force to cleanup this PR. Please let me know when you do!

danielmedina commented 8 years ago

Use the other pull request... I can't do what you sugest. https://github.com/stripe/jquery.payment/pull/230

danielmedina commented 8 years ago

The other pull request have the things you want?

jenanwise commented 8 years ago

Yup! Merged it.