Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taq/creditcardvalidatorjs
A JavaScript credit card data validator
https://github.com/taq/creditcardvalidatorjs
Last synced: about 1 month ago
JSON representation
A JavaScript credit card data validator
- Host: GitHub
- URL: https://github.com/taq/creditcardvalidatorjs
- Owner: taq
- Created: 2012-11-08T10:38:43.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-08T10:52:36.000Z (about 12 years ago)
- Last Synced: 2023-04-11T08:51:02.742Z (over 1 year ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Credit Card data validator
==========================A JavaScript implementation
---------------------------Can check if only the credit card number is valid, or also the date, based on
the current date.### Usage:
Just using the number, just valid the number:
```javascript
var validator = new Bluefish.CreditCardValidator("1234123412341234");
console.log(validator.valid());
```Using number, year and month:
```javascript
var validator = new Bluefish.CreditCardValidator("1234123412341234",2012,11);
console.log(validator.validNumber());
console.log(validator.validDate());
console.log(validator.valid());
```Formatting number:
```javascript
var validator = new Bluefish.CreditCardValidator("1234123412341234");
console.log(validator.formatNumber()) => "1234-1234-1234-1234"
```