Credit Card Composed Validator
This is a custom validator (or plugin) for the composed validations library.
This is also a simple and useful repository to use as a example on how to create custom validators for the composed validations library.
Installation
npm install cv-credit-card
How to Use
var validations = ;var ccValidator = validations; // The accepts option is optional.// If you don't pass, will accept 18 types of validation.// See the Available Validations below var validator = ; validator; // will return 4444444444444448 validator; // false (this is a switch card test number)
Available Credit Card Validations (18)
- American Express
- VISA
- VISA Commercial Card
- VISA Corporate Card II
- VISA Corporate Card III
- Mastercard
- MasterCard Diners
- MasterCard II
- MasterCard III
- Diners Club
- Discover Network
- Discover Diners
- JCB
- Switch/Solo (Paymentech)
- Union
- Laser
- Dankort
- Insta Payment
Credit Card Test Numbers
- https://www.auricsystems.com/support-center/sample-credit-card-numbers/
- http://en.wikipedia.org/wiki/Credit_card_numbers
- http://www.worldpay.com/support/kb/bg/testandgolive/tgl5103.html
- http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D