JIDE 3.5.15

com.jidesoft.field.creditcard
Class CreditCardValidator

java.lang.Object
  extended by com.jidesoft.field.creditcard.CreditCardValidator

public class CreditCardValidator
extends Object

Check if the input credit card number is valid depending on which credit card types are allowed.


Constructor Summary
CreditCardValidator()
          Creates a CreditCardValidator allowing all supported credit card issuers.
CreditCardValidator(String[] allowedIssuerNames)
          Creates a CreditCardValidator with an array of allowed credit card issuer names.
 
Method Summary
 CardIssuer getCardIssuer(String cardNumber)
          Check if the specified card number is 13-19 digits number format; check if the specified card number is valid based on the Luhn algorithm; check if the specified card number is valid based on the validation from one of the allowed card issuers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreditCardValidator

public CreditCardValidator()
Creates a CreditCardValidator allowing all supported credit card issuers.


CreditCardValidator

public CreditCardValidator(String[] allowedIssuerNames)
Creates a CreditCardValidator with an array of allowed credit card issuer names.

Parameters:
allowedIssuerNames - allowed card issuers' names.
Method Detail

getCardIssuer

public CardIssuer getCardIssuer(String cardNumber)
Check if the specified card number is 13-19 digits number format; check if the specified card number is valid based on the Luhn algorithm; check if the specified card number is valid based on the validation from one of the allowed card issuers.

Parameters:
cardNumber - number to be checked
Returns:
Issuer of specified card number, null if the number is invalid or it is not allowed by the _allowedCardIssuers.

JIDE 3.5.15