rwillrich / creditcard.js

A simple credit cards validation library in JavaScript. :credit_card:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

creditcard.js

Build Status Dependency Status devDependency Status

A simple credit cards validation library in JavaScript.

creditcard.js

## Install

You can download the zip file or use NPM and Bower.

NPM

$ npm install --save-dev creditcard.js

Bower

$ bower install creditcard.js --save

Usage

In the browser:

var obj = new CreditCard();
obj.getCreditCardNameByNumber('4539578763621486'); // returns 'Visa'

In the server:

var creditcard = require('creditcard.js');
credit.getCreditCardNameByNumber('4539578763621486'); // returns 'Visa'

Methods

obj.validadeExpiryDate()

Returns whether the value is true or false.

obj.validadeCreditCard()

Returns whether the value is true or false.

obj.validadeSecuryCode()

Returns whether the value is true or false.

obj.getCreditCardNameByNumber()

Returns a String with the credit card name.

Browser support

Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
Latest ✔ Latest ✔ 9+ ✔ Latest ✔ 8+ ✔

License

MIT © Conta Azul

About

A simple credit cards validation library in JavaScript. :credit_card:


Languages

Language:JavaScript 98.1%Language:HTML 1.9%