Marjoel / m-credit-card

Validate credit card number and identify it brand in a simple way with this module for AngularJS.

Home Page:https://www.marjoel.com/github/m-credit-card

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

m-credit-card ~2kb

Validate credit card number and identify it brand in a simple way with this module for AngularJS.

click to see the demo

Supported brands

  • Visa visa
  • Mastercard mastercard
  • American Express amex
  • Hipercard hipercard
  • Hiper hiper
  • Diners Club International diners
  • Japanese Credit Bureau jcb
  • Elo elo
  • Aura aura
  • Discover discover
Brand It starts Length
Visa 4 13, 16
Mastercard 5, 2 16
Amex 34, 37 15
Hipercard 606282 16
Hiper 637095, 637599, 637609, 637612, 637600, 637568 16
Diners 300, 301, 302, 303, 304, 305, 36, 38, 39 14
JCB 3088, 3096, 3112, 3158, 3337, 35 16
Elo 401178, 401179, 431274, 438935, 451416, 4573, 4576, 506, 509, 636, 6500, 6504, 6505, 6507, 6509, 6516, 6550, 504175, 627780 16
Aura 50 16
Discover 6011, 622, 64, 65 16

Official data from the two of the largest acquirers in the world and from the largest bank in Latin America.

How to use

Install m-credit-card with bower.

$ bower install m-credit-card --save

Set the directive m-credit-card on the input.

<input type="text" m-credit-card />

Set a span with a class called m-credit-card.

<input type="text" m-credit-card />
<span class="m-credit-card"></span>

Set a custom css for the following classes:

  • .m-credit-card
  • .m-credit-card.visa
  • .m-credit-card.mastercard
  • .m-credit-card.hipercard
  • .m-credit-card.hiper
  • .m-credit-card.diners
  • .m-credit-card.amex
  • .m-credit-card.jcb
  • .m-credit-card.elo
  • .m-credit-card.aura
  • .m-credit-card.discover
<input type="text" m-credit-card />
<span class="m-credit-card"></span>

Contributors

Setup

$ git clone https://github.com/Marjoel/m-credit-card

Then go to the project's folder.

$ cd m-credit-card

Install local dependencies.

$ npm install

Before the commit

Run grunt style to validate the code style.

$ grunt style

Run npm test to validate the unit testing.

$ npm test

Then run grunt build to generate the dist folder.

$ grunt build

To do

  • Identify other credit card brands
  • Unit testing for directive

About

Validate credit card number and identify it brand in a simple way with this module for AngularJS.

https://www.marjoel.com/github/m-credit-card

License:GNU General Public License v3.0


Languages

Language:JavaScript 69.3%Language:HTML 22.3%Language:CSS 8.4%