auroban / CardValidator

A simple Card Validator written in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Card Validator

Generic helper for Card number validation.

Build Status

Usage:

Add & import the library to your project.

Use isCardValid method to run a validation on the Card & the getCardBrand method to get the brand of the Card

Both the methods are static methods, so simply invoke them with their Class name.

Validate the Card:

Pass the card number as String to the method & it returns a Boolean value on the basis of the input

CardValidation.isCardValid("4242424242424242");

Get the Card brand

Pass the card number as String to the method. The method returns the name of the Card. In case of Card brand not found, the method returns null

CardValidation.getCardBrand("4242424242424242");

About

A simple Card Validator written in Java


Languages

Language:Java 100.0%