jc
@oroinc/jquery-creditcardvalidator
npm i @oroinc/jquery-creditcardvalidator
jc

@oroinc/jquery-creditcardvalidator

jQuery credit card validation and detection plugin

by Pawel Decowski

1.1.0 (see all)License:MITTypeScript:Not Found
npm i @oroinc/jquery-creditcardvalidator
Readme

jQuery Credit Card Validator

jQuery Credit Card Validator detects and validates credit card numbers. It’ll tell you the detected credit card type and whether the number length and Luhn checksum are valid for the type of card.

Installation

NPM

npm i jquery-creditcardvalidator

Download

Download the latest jquery.creditCardValidator.js.

The latest stable version is always in the master branch. If you need previous versions, you’ll find them on the releases page.

Do not use any branches other than master. Branches starting with release/ are development branches and they will most likely be broken.

How to use

Run validation every time a field value changes:

$('#cc_number').validateCreditCard(function(result) {
    if (result.valid) {
        $(this).addClass('cc-valid');
    } else {
        $(this).removeClass('cc-valid');
    }
});

Run validation once:

const result = $('#cc_number').validateCreditCard();

if (result.valid) {
    $(this).addClass('cc-valid');
} else {
    $(this).removeClass('cc-valid');
}

Documentation

For full documentation see the jQuery Credit Card Validator website.

Downloads/wk

980

GitHub Stars

1K

LAST COMMIT

2yrs ago

MAINTAINERS

3

CONTRIBUTORS

7

OPEN ISSUES

8

OPEN PRs

1
VersionTagPublished
1.1.0
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial