If you run your own payment page, you probably know by now that the MasterCard 2-series BIN expansion is coming, and having some test cards to run against validators is always useful to check that your front-end update is going well—but where do you get them?
There are many websites that provide generators that produce test card numbers for the most popular networks, in CSV or JSON for many cards, but these elaborate solutions don’t let you enter any BIN and length to get a Luhn-valid card.
Well I needed just this, so here it is, a mix coming from an original Java class by Josef Galea on GitHub and a validator by ShirtlessKirk, enjoy.
Open on CodePen if the embed does not load.
Comments