All Projects → ContaAzul → Creditcard.js

ContaAzul / Creditcard.js

Licence: other
A simple credit cards validation library in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Creditcard.js

Credit card validations
💳 ruby gem for validating credit card numbers, generating valid numbers, luhn checks
Stars: ✭ 140 (-45.95%)
Mutual labels:  validation, credit-card
Mfcard
Easily integrate Credit Card payments module in iOS App. Swift 4.0
Stars: ✭ 356 (+37.45%)
Mutual labels:  validation, credit-card
Credit Card
Credit Card Validation
Stars: ✭ 150 (-42.08%)
Mutual labels:  validation, credit-card
Pycard
A simple credit card validation Python library with no dependencies
Stars: ✭ 40 (-84.56%)
Mutual labels:  validation, credit-card
frames-android
Checkout API Client, Payment Form UI and Utilities
Stars: ✭ 26 (-89.96%)
Mutual labels:  validation, credit-card
apple-receipt
Apple InAppPurchase Receipt - Models, Parser, Validator
Stars: ✭ 25 (-90.35%)
Mutual labels:  validation
validate
Modern lightweight library without dependencies for the data validation from single input tag
Stars: ✭ 24 (-90.73%)
Mutual labels:  validation
fefe
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.
Stars: ✭ 34 (-86.87%)
Mutual labels:  validation
vgs-collect-ios
VGS Collect iOS SDK
Stars: ✭ 17 (-93.44%)
Mutual labels:  credit-card
Luhn
Smooth UI for Credit Card Entry on Android device, perform check for supported credit card types , pan length and luhn check. Inspired by Uber credit card entry interface
Stars: ✭ 257 (-0.77%)
Mutual labels:  credit-card
FluentValidation.Extensions.Br
An extension of the fluent validation with a set of Brazilian validations
Stars: ✭ 23 (-91.12%)
Mutual labels:  validation
strickland
Strickland is a JavaScript validation framework with a focus on extensibility and composition
Stars: ✭ 16 (-93.82%)
Mutual labels:  validation
nexus-validate
🔑 Add argument validation to your GraphQL Nexus API.
Stars: ✭ 29 (-88.8%)
Mutual labels:  validation
magic-bytes
A library for detecting file types.
Stars: ✭ 20 (-92.28%)
Mutual labels:  validation
flask-pydantic
flask extension for integration with the awesome pydantic package
Stars: ✭ 181 (-30.12%)
Mutual labels:  validation
scrupulous
Simple inline form validation using HTML5 attributes that plays nicely with Bootstrap
Stars: ✭ 12 (-95.37%)
Mutual labels:  validation
ttv
A command line tool for splitting files into test, train, and validation sets.
Stars: ✭ 38 (-85.33%)
Mutual labels:  validation
is-valid-domain
Validate domain name in JavaScript
Stars: ✭ 50 (-80.69%)
Mutual labels:  validation
ngx-messages
Angular directives for displaying validation messages similar to these from AngularJs
Stars: ✭ 17 (-93.44%)
Mutual labels:  validation
gnt
🍸 GraphQL Normalized Types
Stars: ✭ 32 (-87.64%)
Mutual labels:  credit-card

creditcard.js

Build Status Dependency Status devDependency Status npm

A simple credit cards validation library in JavaScript.

Project website: https://contaazul.github.io/creditcard.js

Install

creditcard.js is available as a NPM package. You can install through Yarn or NPM:

Yarn

$ yarn add creditcard.js

NPM

$ npm install creditcard.js

Usage

import {
  isValid,
  isExpirationDateValid,
  isSecurityCodeValid,
  getCreditCardNameByNumber,
} from 'creditcard.js';

isValid('4916108926268679'); // returns true
isExpirationDateValid('02', '2020'); // returns true
isSecurityCodeValid('4556603578296676', '250'); // returns true
getCreditCardNameByNumber('4539578763621486'); // returns 'Visa'

Methods

isValid(number) -> boolean

Checks whether the credit card number format is valid. (See the full list of currently supported cards)

number

Required
Type: string

options

Optional
Type: { cards: string[] }


isExpirationDateValid(month, year) -> boolean

Checks that the expiration date is valid and not expired. (2 or 4 digit years are accepted)

month

Required
Type: string

year

Required
Type: string


isSecurityCodeValid(creditCardNumber, securityCode) -> boolean

Check that the security code is valid according to the type of credit card.

creditCardNumber

Required
Type: string

securityCode

Required
Type: string


getCreditCardNameByNumber(number) -> string

Returns the credit card type from the card number. (See the full list of currently supported cards)

number

Required
Type: string


Suportted credit card types

  • American Express
  • Aura
  • Banescard
  • Cabal
  • Diners
  • Discover
  • Elo
  • Goodcard
  • Hipercard
  • Mastercard
  • Maxxvan
  • Visa

License

MIT © Conta Azul

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].