Package com.irurueta.commons.validators
Class CreditCardValidator
- java.lang.Object
- 
- com.irurueta.commons.validators.CreditCardValidator
 
- 
 public class CreditCardValidator extends java.lang.ObjectClass to validate credit card PAN numbers. PAN numbers are formed by IIN (Issuer Identification Number) followed by a series of digits + the check digit (using Luhn algorithm), if available for a given credit card network. Notice that the first digit of the IIN corresponds to a MII (Major Industry Identifier). This class also provides functionality to detect network of a given credit card PAN number. Notice that network detection and validation is not 100% accurate, hence it is suggested to never prevent users from completing payments if validation does not pass or network cannot be detected. In those cases simply a warning can be shown to the user indicating that payment data might be wrong. Notice as well that if network is detected and validation passes, then it is almost certain that payment data is correct.
- 
- 
Field SummaryFields Modifier and Type Field Description private static byte[][]AMEX_GROUPINGConstant defining digit groups for American Express.protected static booleanAMEX_HAS_VALIDATIONConstant indicating whether American Express uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]AMEX_IINConstant containing IIN ranges reserved for American Express.protected static booleanAMEX_IS_ACTIVEConstant indicating whether American Express network is still being used.private static byte[][]AMEX_LENGTHConstant containing valid lengths for American Express.protected static booleanBANKCARD_HAS_VALIDATIONConstant indicating whether Bankcard uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]BANKCARD_IINConstant containing IIN ranges reserved for Bankcard.protected static booleanBANKCARD_IS_ACTIVEConstant indicating whether Bankcard network is still being used.private static byte[][]BANKCARD_LENGTHConstant containing valid lengths for Bankcard.protected static booleanCHINA_UNIONPAY_HAS_VALIDATIONConstant indicating whether China UnionPay uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]CHINA_UNIONPAY_IINConstant containing IIN ranges reserved for China UnionPay.protected static booleanCHINA_UNIONPAY_IS_ACTIVEConstant indicating whether China UnionPay network is still being used.private static byte[][]CHINA_UNIONPAY_LENGTHConstant containing valid lengths for China UnionPay.private static byte[][]DEFAULT_GROUPINGConstant defining digit groups for any other network or unknown networks.protected static booleanDINERS_CLUB_CARTE_BLANCHE_HAS_VALIDATIONConstant indicating whether Diners Club Carte Blanche uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]DINERS_CLUB_CARTE_BLANCHE_IINConstant containing IIN ranges reserved for Diners Club Carte Blanche.protected static booleanDINERS_CLUB_CARTE_BLANCHE_IS_ACTIVEConstant indicating whether Diners Club Carte Blanche network is still being used.private static byte[][]DINERS_CLUB_CARTE_BLANCHE_LENGTHConstant containing valid lengths for Diners Club Carte Blanche.private static byte[][]DINERS_CLUB_ENROUTE_GROUPINGConstant defining digit groups for Dinners club enroute.protected static booleanDINERS_CLUB_ENROUTE_HAS_VALIDATIONConstant indicating whether Diners Club enRoute uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]DINERS_CLUB_ENROUTE_IINConstant containing IIN ranges reserved for Diners Club enRoute.protected static booleanDINERS_CLUB_ENROUTE_IS_ACTIVEConstant indicating whether Diners Club enRoute network is still being used.private static byte[][]DINERS_CLUB_ENROUTE_LENGTHConstant containing valid lengths for Diners Club enRoute.private static byte[][]DINERS_CLUB_INTERATIONAL_GROUPINGConstant defining digit groups for Dinners club internacional.protected static booleanDINERS_CLUB_INTERATIONAL_HAS_VALIDATIONConstant indicating whether Diners Club International uses Luhn validation to ensure that PAN is valid.protected static booleanDINERS_CLUB_INTERATIONAL_IS_ACTIVEConstant indicating whether Diners Club International network is still being used.private static java.lang.String[][]DINERS_CLUB_INTERNATIONAL_IINConstant containing IIN ranges reserved for Diners Club International.private static byte[][]DINERS_CLUB_INTERNATIONAL_LENGTHConstant containing valid lengths for Diners Club International.protected static booleanDINERS_CLUB_USA_CA_HAS_VALIDATIONConstant indicating whether Diners Club USA and Canada uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]DINERS_CLUB_USA_CA_IINConstant containing IIN ranges reserved for Diners Club USA and Canada.protected static booleanDINERS_CLUB_USA_CA_IS_ACTIVEConstant indicating whether Diners Club USA and Canada network is still being used.private static byte[][]DINERS_CLUB_USA_CA_LENGTHConstant containing valid lengths for Diners Club USA and Canada.private static byte[][]DISCOVER_GROUPINGConstant defining digit groups for Discover.protected static booleanDISCOVER_HAS_VALIDATIONConstant indicating whether Discover uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]DISCOVER_IINConstant containing IIN ranges reserved for Discover.protected static booleanDISCOVER_IS_ACTIVEConstant indicating whether Discover network is still being used.private static byte[][]DISCOVER_LENGTHConstant containing valid lengths for Discover.protected static booleanINSTAPAYMENT_HAS_VALIDATIONConstant indicating whether InstaPayment uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]INSTAPAYMENT_IINConstant containing IIN ranges reserved for InstaPayment.protected static booleanINSTAPAYMENT_IS_ACTIVEConstant indicating whether InstaPayment network is still being used.private static byte[][]INSTAPAYMENT_LENGTHConstant containing valid lengths for InstaPayment.protected static booleanJCB_HAS_VALIDATIONConstant indicating whether JCB uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]JCB_IINConstant containing IIN ranges reserved for JCB.protected static booleanJCB_IS_ACTIVEConstant indicating whether JCB network is still being used.private static byte[][]JCB_LENGTHConstant containing valid lengths for JCB.protected static booleanLASER_HAS_VALIDATIONConstant indicating whether Laser uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]LASER_IINConstant containing IIN ranges reserved for Laser.protected static booleanLASER_IS_ACTIVEConstant indicating whether Laser network is still being used.private static byte[][]LASER_LENGTHConstant containing valid lengths for Laser.protected static booleanMAESTRO_HAS_VALIDATIONConstant indicating whether Maestro uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]MAESTRO_IINConstant containing IIN ranges reserved for Maestro.protected static booleanMAESTRO_IS_ACTIVEConstant indicating whether Maestro network is still being used.private static byte[][]MAESTRO_LENGTHConstant containing valid lengths for Maestro.private static byte[][]MASTERCARD_GROUPINGConstant defining digit groups for Mastercard.protected static booleanMASTERCARD_HAS_VALIDATIONConstant indicating whether MasterCard uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]MASTERCARD_IINConstant containing IIN ranges reserved for MasterCard.protected static booleanMASTERCARD_IS_ACTIVEConstant indicating whether MasterCard network is still being used.private static byte[][]MASTERCARD_LENGTHConstant containing valid lengths for MasterCard.static intMAX_LENGTHMaximum allowed length for a credit card PAN.static intMIN_LENGTHMinimum allowed length for a credit card PAN.protected static booleanSOLO_HAS_VALIDATIONConstant indicating whether Solo uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]SOLO_IINConstant containing IIN ranges reserved for Solo.protected static booleanSOLO_IS_ACTIVEConstant indicating whether Solo network is still being used.private static byte[][]SOLO_LENGTHConstant containing valid lengths for Solo.protected static booleanSWITCH_HAS_VALIDATIONConstant indicating whether Switch uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]SWITCH_IINConstant containing IIN ranges reserved for Switch.protected static booleanSWITCH_IS_ACTIVEConstant indicating whether Switch network is still being used.private static byte[][]SWITCH_LENGTHConstant containing valid lengths for Switch.private static byte[][]VISA_ELECTRON_GROUPINGConstant defining digit groups for VISA Electron.protected static booleanVISA_ELECTRON_HAS_VALIDATIONConstant indicating whether VISA Electron uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]VISA_ELECTRON_IINConstant containing IIN ranges reserved for VISA Electron.protected static booleanVISA_ELECTRON_IS_ACTIVEConstant indicating whether VISA Electron network is still being used.private static byte[][]VISA_ELECTRON_LENGTHConstant containing valid lengths for VISA Electron.private static byte[][]VISA_GROUPINGConstant defining digit groups for VISA.protected static booleanVISA_HAS_VALIDATIONConstant indicating whether VISA uses Luhn validation to ensure that PAN is valid.private static java.lang.String[][]VISA_IINConstant containing IIN ranges reserved for VISA.protected static booleanVISA_IS_ACTIVEConstant indicating whether VISA network is still being used.private static byte[][]VISA_LENGTHConstant containing valid lengths for VISA.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedCreditCardValidator()Constructor.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description protected static bytecomputeCheck(byte[] digitsWithoutCheck)Computes checksum using Luhn algorithm.protected static CreditCardNetworkdetectNetworkFromPAN(byte[] panDigits)Detects credit card network by using provided credit card PAN digits.static CreditCardNetworkdetectNetworkFromPAN(java.lang.String pan)Detects credit card network by using provided credit card PAN value.static intgetMaxDigitsForGroupAndNetwork(int groupPos, CreditCardNetwork network)Returns maximum number of allowed digits for provided group position (starting at zero until the maximum number of groups minus one).static intgetMinDigitsForGroupAndNetwork(int groupPos, CreditCardNetwork network)Returns minimum number of required digits for provided group position (starting at zero until the maximum number of groups minus one).static intgetNumberOfGroupsForNetwork(CreditCardNetwork network)Returns number of digit groups for provided credit card network.protected static byte[][]groupingsForNetwork(CreditCardNetwork network)Returns credit card digit groupings for provided credit card network.protected static booleanisAmericanExpressIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to American Express IIN (Issuer Identification Number).static booleanisAmericanExpressIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to American Express IIN (Issuer Identification Number).protected static booleanisAmericanExpressValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for American Express cards.static booleanisAmericanExpressValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for American Express cards.protected static booleanisBankcardIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to BankCard IIN (Issuer Identification Number).static booleanisBankcardIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to BankCard IIN (Issuer Identification Number).protected static booleanisBankcardValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for BankCard cards.static booleanisBankcardValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for BankCard cards.protected static booleanisChinaUnionPayIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to China UnionPay IIN (Issuer Identification Number).static booleanisChinaUnionPayIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to China UnionPay IIN (Issuer Identification Number).protected static booleanisChinaUnionPayValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for China UnionPay cards.static booleanisChinaUnionPayValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for China UnionPay cards.protected static booleanisDinersClubCarteBlancheIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to Diners Club Carte Blanche IIN (Issuer Identification Number).static booleanisDinersClubCarteBlancheIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Diners Club Carte Blanche IIN (Issuer Identification Number).protected static booleanisDinersClubCarteBlancheValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Diners Club Carte Blanche cards.static booleanisDinersClubCarteBlancheValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Diners Club Carte Blanche cards.protected static booleanisDinersClubEnrouteIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to Diners Club Enroute IIN (Issuer Identification Number).static booleanisDinersClubEnrouteIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Diners Club Enroute IIN (Issuer Identification Number).protected static booleanisDinersClubEnrouteValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Diners Club Enroute cards.static booleanisDinersClubEnrouteValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Diners Club Enroute cards.protected static booleanisDinersClubInternationalIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to Diners Club International IIN (Issuer Identification Number).static booleanisDinersClubInternationalIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Diners Club International IIN (Issuer Identification Number).protected static booleanisDinersClubInternationalValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Diners Club International cards.static booleanisDinersClubInternationalValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Diners Club International cards.protected static booleanisDinersClubUSACanadaIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to Diners Club USA and Canada IIN (Issuer Identification Number).static booleanisDinersClubUSACanadaIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Diners Club USA and Canada IIN (Issuer Identification Number).protected static booleanisDinersClubUSACanadaValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Diners Club USA and Canada cards.static booleanisDinersClubUSACanadaValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Diners Club USA and Canada cards.protected static booleanisDiscoverIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to Discover IIN (Issuer Identification Number).static booleanisDiscoverIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Discover IIN (Issuer Identification Number).protected static booleanisDiscoverValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Discover cards.static booleanisDiscoverValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Discover cards.protected static booleanisInstaPaymentIIN(byte[] panDigits)Indicates if provided credit card PAN digits corresponds to InstaPayment IIN (Issuer Identification Number).static booleanisInstaPaymentIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to InstaPayment IIN (Issuer Identification Number).protected static booleanisInstaPaymentValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for InstaPayment cards.static booleanisInstaPaymentValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for InstaPayment cards.protected static booleanisJCBIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to JCB IIN (Issuer Identification Number).static booleanisJCBIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to JCB IIN (Issuer Identification Number).protected static booleanisJCBValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for JCB cards.static booleanisJCBValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for JCB cards.protected static booleanisLaserIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to Laser IIN (Issuer Identification Number).static booleanisLaserIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Laser IIN (Issuer Identification Number).protected static booleanisLaserValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Laser cards.static booleanisLaserValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Laser cards.protected static booleanisMaestroIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to Maestro IIN (Issuer Identification Number).static booleanisMaestroIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Maestro IIN (Issuer Identification Number).protected static booleanisMaestroValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Maestro cards.static booleanisMaestroValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Maestro cards.protected static booleanisMastercardIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to Mastercard IIN (Issuer Identification Number).static booleanisMastercardIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Mastercard IIN (Issuer Identification Number).protected static booleanisMastercardValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Mastercard cards.static booleanisMastercardValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Mastercard cards.static booleanisNetworkActive(CreditCardNetwork network)Indicates if provided credit card network is still being used commercially.protected static booleanisSoloIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to Solo IIN (Issuer Identification Number).static booleanisSoloIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Solo IIN (Issuer Identification Number).protected static booleanisSoloValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Solo cards.static booleanisSoloValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Solo cards.protected static booleanisSwitchIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to Switch IIN (Issuer Identification Number).static booleanisSwitchIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to Switch IIN (Issuer Identification Number).protected static booleanisSwitchValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for Switch cards.static booleanisSwitchValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for Switch cards.protected static booleanisValid(byte[] panDigits)Indicates if provided credit card PAN is valid by detecting its assigned credit card network, checking its length and validating its checksum if network supports validation.static booleanisValid(java.lang.String pan)Indicates if provided credit card PAN is valid by detecting its assigned credit card network, checking its length and validating its checksum if network supports validation.static booleanisValidationEnabledForNetwork(CreditCardNetwork network)Indicates if a given credit card network uses Luhn algorithm to validate PAN values.protected static booleanisValidChecksumForPAN(byte[] panDigits)Validates provided credit card PAN using Luhn algorithm assuming that the last digit of provided PAN corresponds to its checksum value.static booleanisValidChecksumForPAN(java.lang.String pan)Validates provided credit card PAN using Luhn algorithm assuming that the last digit of provided PAN corresponds to its checksum value.protected static booleanisValidIIN(byte[] panDigits, java.lang.String[][] iins)Internal method to check whether provided array of PAN digits corresponds to a valid IIN by checking the array of valid IIN ranges.protected static booleanisValidIIN(java.lang.String pan, java.lang.String[][] iins)Internal method to check whether provided credit card PAN corresponds to a valid IIN by checking the array of valid IIN ranges.protected static booleanisValidLength(byte[] panDigits)Detects network for provided PAN digits and indicates if provided array of credit card PAN digits has an appropriate length for provided credit card network.protected static booleanisValidLength(byte[] panDigits, byte[][] lengths)Internal method to determine whether length of provided array of credit card PAN digits is valid based on array of valid length ranges.protected static booleanisValidLength(byte[] panDigits, CreditCardNetwork network)Indicates if provided array of credit card PAN digits has an appropriate length for provided credit card network.static booleanisValidLength(java.lang.String pan)Detects network for provided PAN and indicates if provided credit card PAN has an appropriate length for provided credit card network.protected static booleanisValidLength(java.lang.String pan, byte[][] lengths)Internal method to determine whether length of provided credit card PAN is valid based on array of valid length ranges.static booleanisValidLength(java.lang.String pan, CreditCardNetwork network)Indicates if provided credit card PAN has an appropriate length for provided credit card network.protected static booleanisValidMII(byte[] panDigits)Indicates if provided array of credit card PAN digits corresponds to any valid MII (Major Industry Identifier).static booleanisValidMII(java.lang.String pan)Indicates if provided credit card PAN value corresponds to any valid MII (Major Industry Identifier).protected static booleanisVISAElectronIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to VISA Electron IIN (Issuer Identification Number).static booleanisVISAElectronIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to VISA Electron IIN (Issuer Identification Number).protected static booleanisVISAElectronValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for VISA Electron cards.static booleanisVISAElectronValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for VISA Electron cards.protected static booleanisVISAIIN(byte[] panDigits)Indicates if provided credit card PAN digits correspond to VISA IIN (Issuer Identification Number).static booleanisVISAIIN(java.lang.String pan)Indicates if provided credit card PAN corresponds to VISA IIN (Issuer Identification Number).protected static booleanisVISAValidLength(byte[] panDigits)Indicates if provided credit card PAN digits have valid length for VISA cards.static booleanisVISAValidLength(java.lang.String pan)Indicates if provided credit card PAN has valid length for VISA cards.protected static intnumLeadingZeros(java.lang.String iin)Computes number of leading zeros on any given IIN.static byte[]toDigits(java.lang.String pan)Converts a credit card PAN from its string representation into an array containing PAN digits.
 
- 
- 
- 
Field Detail- 
MIN_LENGTHpublic static final int MIN_LENGTH Minimum allowed length for a credit card PAN.- See Also:
- Constant Field Values
 
 - 
MAX_LENGTHpublic static final int MAX_LENGTH Maximum allowed length for a credit card PAN.- See Also:
- Constant Field Values
 
 - 
AMEX_HAS_VALIDATIONprotected static final boolean AMEX_HAS_VALIDATION Constant indicating whether American Express uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
AMEX_IS_ACTIVEprotected static final boolean AMEX_IS_ACTIVE Constant indicating whether American Express network is still being used.- See Also:
- Constant Field Values
 
 - 
BANKCARD_HAS_VALIDATIONprotected static final boolean BANKCARD_HAS_VALIDATION Constant indicating whether Bankcard uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
BANKCARD_IS_ACTIVEprotected static final boolean BANKCARD_IS_ACTIVE Constant indicating whether Bankcard network is still being used.- See Also:
- Constant Field Values
 
 - 
CHINA_UNIONPAY_HAS_VALIDATIONprotected static final boolean CHINA_UNIONPAY_HAS_VALIDATION Constant indicating whether China UnionPay uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
CHINA_UNIONPAY_IS_ACTIVEprotected static final boolean CHINA_UNIONPAY_IS_ACTIVE Constant indicating whether China UnionPay network is still being used.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_CARTE_BLANCHE_HAS_VALIDATIONprotected static final boolean DINERS_CLUB_CARTE_BLANCHE_HAS_VALIDATION Constant indicating whether Diners Club Carte Blanche uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_CARTE_BLANCHE_IS_ACTIVEprotected static final boolean DINERS_CLUB_CARTE_BLANCHE_IS_ACTIVE Constant indicating whether Diners Club Carte Blanche network is still being used.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_ENROUTE_HAS_VALIDATIONprotected static final boolean DINERS_CLUB_ENROUTE_HAS_VALIDATION Constant indicating whether Diners Club enRoute uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_ENROUTE_IS_ACTIVEprotected static final boolean DINERS_CLUB_ENROUTE_IS_ACTIVE Constant indicating whether Diners Club enRoute network is still being used.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_INTERATIONAL_HAS_VALIDATIONprotected static final boolean DINERS_CLUB_INTERATIONAL_HAS_VALIDATION Constant indicating whether Diners Club International uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_INTERATIONAL_IS_ACTIVEprotected static final boolean DINERS_CLUB_INTERATIONAL_IS_ACTIVE Constant indicating whether Diners Club International network is still being used.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_USA_CA_HAS_VALIDATIONprotected static final boolean DINERS_CLUB_USA_CA_HAS_VALIDATION Constant indicating whether Diners Club USA and Canada uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
DINERS_CLUB_USA_CA_IS_ACTIVEprotected static final boolean DINERS_CLUB_USA_CA_IS_ACTIVE Constant indicating whether Diners Club USA and Canada network is still being used.- See Also:
- Constant Field Values
 
 - 
DISCOVER_HAS_VALIDATIONprotected static final boolean DISCOVER_HAS_VALIDATION Constant indicating whether Discover uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
DISCOVER_IS_ACTIVEprotected static final boolean DISCOVER_IS_ACTIVE Constant indicating whether Discover network is still being used.- See Also:
- Constant Field Values
 
 - 
INSTAPAYMENT_HAS_VALIDATIONprotected static final boolean INSTAPAYMENT_HAS_VALIDATION Constant indicating whether InstaPayment uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
INSTAPAYMENT_IS_ACTIVEprotected static final boolean INSTAPAYMENT_IS_ACTIVE Constant indicating whether InstaPayment network is still being used.- See Also:
- Constant Field Values
 
 - 
JCB_HAS_VALIDATIONprotected static final boolean JCB_HAS_VALIDATION Constant indicating whether JCB uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
JCB_IS_ACTIVEprotected static final boolean JCB_IS_ACTIVE Constant indicating whether JCB network is still being used.- See Also:
- Constant Field Values
 
 - 
LASER_HAS_VALIDATIONprotected static final boolean LASER_HAS_VALIDATION Constant indicating whether Laser uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
LASER_IS_ACTIVEprotected static final boolean LASER_IS_ACTIVE Constant indicating whether Laser network is still being used.- See Also:
- Constant Field Values
 
 - 
MAESTRO_HAS_VALIDATIONprotected static final boolean MAESTRO_HAS_VALIDATION Constant indicating whether Maestro uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
MAESTRO_IS_ACTIVEprotected static final boolean MAESTRO_IS_ACTIVE Constant indicating whether Maestro network is still being used.- See Also:
- Constant Field Values
 
 - 
MASTERCARD_HAS_VALIDATIONprotected static final boolean MASTERCARD_HAS_VALIDATION Constant indicating whether MasterCard uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
MASTERCARD_IS_ACTIVEprotected static final boolean MASTERCARD_IS_ACTIVE Constant indicating whether MasterCard network is still being used.- See Also:
- Constant Field Values
 
 - 
SOLO_HAS_VALIDATIONprotected static final boolean SOLO_HAS_VALIDATION Constant indicating whether Solo uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
SOLO_IS_ACTIVEprotected static final boolean SOLO_IS_ACTIVE Constant indicating whether Solo network is still being used.- See Also:
- Constant Field Values
 
 - 
SWITCH_HAS_VALIDATIONprotected static final boolean SWITCH_HAS_VALIDATION Constant indicating whether Switch uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
SWITCH_IS_ACTIVEprotected static final boolean SWITCH_IS_ACTIVE Constant indicating whether Switch network is still being used.- See Also:
- Constant Field Values
 
 - 
VISA_HAS_VALIDATIONprotected static final boolean VISA_HAS_VALIDATION Constant indicating whether VISA uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
VISA_IS_ACTIVEprotected static final boolean VISA_IS_ACTIVE Constant indicating whether VISA network is still being used.- See Also:
- Constant Field Values
 
 - 
VISA_ELECTRON_HAS_VALIDATIONprotected static final boolean VISA_ELECTRON_HAS_VALIDATION Constant indicating whether VISA Electron uses Luhn validation to ensure that PAN is valid.- See Also:
- Constant Field Values
 
 - 
VISA_ELECTRON_IS_ACTIVEprotected static final boolean VISA_ELECTRON_IS_ACTIVE Constant indicating whether VISA Electron network is still being used.- See Also:
- Constant Field Values
 
 - 
AMEX_IINprivate static final java.lang.String[][] AMEX_IIN Constant containing IIN ranges reserved for American Express.
 - 
AMEX_LENGTHprivate static final byte[][] AMEX_LENGTH Constant containing valid lengths for American Express.
 - 
AMEX_GROUPINGprivate static final byte[][] AMEX_GROUPING Constant defining digit groups for American Express.
 - 
BANKCARD_IINprivate static final java.lang.String[][] BANKCARD_IIN Constant containing IIN ranges reserved for Bankcard.
 - 
BANKCARD_LENGTHprivate static final byte[][] BANKCARD_LENGTH Constant containing valid lengths for Bankcard.
 - 
CHINA_UNIONPAY_IINprivate static final java.lang.String[][] CHINA_UNIONPAY_IIN Constant containing IIN ranges reserved for China UnionPay.
 - 
CHINA_UNIONPAY_LENGTHprivate static final byte[][] CHINA_UNIONPAY_LENGTH Constant containing valid lengths for China UnionPay.
 - 
DINERS_CLUB_CARTE_BLANCHE_IINprivate static final java.lang.String[][] DINERS_CLUB_CARTE_BLANCHE_IIN Constant containing IIN ranges reserved for Diners Club Carte Blanche.
 - 
DINERS_CLUB_CARTE_BLANCHE_LENGTHprivate static final byte[][] DINERS_CLUB_CARTE_BLANCHE_LENGTH Constant containing valid lengths for Diners Club Carte Blanche.
 - 
DINERS_CLUB_ENROUTE_IINprivate static final java.lang.String[][] DINERS_CLUB_ENROUTE_IIN Constant containing IIN ranges reserved for Diners Club enRoute.
 - 
DINERS_CLUB_ENROUTE_LENGTHprivate static final byte[][] DINERS_CLUB_ENROUTE_LENGTH Constant containing valid lengths for Diners Club enRoute.
 - 
DINERS_CLUB_ENROUTE_GROUPINGprivate static final byte[][] DINERS_CLUB_ENROUTE_GROUPING Constant defining digit groups for Dinners club enroute.
 - 
DINERS_CLUB_INTERNATIONAL_IINprivate static final java.lang.String[][] DINERS_CLUB_INTERNATIONAL_IIN Constant containing IIN ranges reserved for Diners Club International.
 - 
DINERS_CLUB_INTERNATIONAL_LENGTHprivate static final byte[][] DINERS_CLUB_INTERNATIONAL_LENGTH Constant containing valid lengths for Diners Club International.
 - 
DINERS_CLUB_INTERATIONAL_GROUPINGprivate static final byte[][] DINERS_CLUB_INTERATIONAL_GROUPING Constant defining digit groups for Dinners club internacional. This grouping is also used for DINERS_CLUB_CARTE_BLANCHE.
 - 
DINERS_CLUB_USA_CA_IINprivate static final java.lang.String[][] DINERS_CLUB_USA_CA_IIN Constant containing IIN ranges reserved for Diners Club USA and Canada.
 - 
DINERS_CLUB_USA_CA_LENGTHprivate static final byte[][] DINERS_CLUB_USA_CA_LENGTH Constant containing valid lengths for Diners Club USA and Canada.
 - 
DISCOVER_IINprivate static final java.lang.String[][] DISCOVER_IIN Constant containing IIN ranges reserved for Discover.
 - 
DISCOVER_LENGTHprivate static final byte[][] DISCOVER_LENGTH Constant containing valid lengths for Discover.
 - 
DISCOVER_GROUPINGprivate static final byte[][] DISCOVER_GROUPING Constant defining digit groups for Discover. This grouping is also used for all Diners Club cards.
 - 
INSTAPAYMENT_IINprivate static final java.lang.String[][] INSTAPAYMENT_IIN Constant containing IIN ranges reserved for InstaPayment.
 - 
INSTAPAYMENT_LENGTHprivate static final byte[][] INSTAPAYMENT_LENGTH Constant containing valid lengths for InstaPayment.
 - 
JCB_IINprivate static final java.lang.String[][] JCB_IIN Constant containing IIN ranges reserved for JCB.
 - 
JCB_LENGTHprivate static final byte[][] JCB_LENGTH Constant containing valid lengths for JCB.
 - 
LASER_IINprivate static final java.lang.String[][] LASER_IIN Constant containing IIN ranges reserved for Laser.
 - 
LASER_LENGTHprivate static final byte[][] LASER_LENGTH Constant containing valid lengths for Laser.
 - 
MAESTRO_IINprivate static final java.lang.String[][] MAESTRO_IIN Constant containing IIN ranges reserved for Maestro.
 - 
MAESTRO_LENGTHprivate static final byte[][] MAESTRO_LENGTH Constant containing valid lengths for Maestro.
 - 
MASTERCARD_IINprivate static final java.lang.String[][] MASTERCARD_IIN Constant containing IIN ranges reserved for MasterCard.
 - 
MASTERCARD_LENGTHprivate static final byte[][] MASTERCARD_LENGTH Constant containing valid lengths for MasterCard.
 - 
MASTERCARD_GROUPINGprivate static final byte[][] MASTERCARD_GROUPING Constant defining digit groups for Mastercard.
 - 
SOLO_IINprivate static final java.lang.String[][] SOLO_IIN Constant containing IIN ranges reserved for Solo.
 - 
SOLO_LENGTHprivate static final byte[][] SOLO_LENGTH Constant containing valid lengths for Solo.
 - 
SWITCH_IINprivate static final java.lang.String[][] SWITCH_IIN Constant containing IIN ranges reserved for Switch.
 - 
SWITCH_LENGTHprivate static final byte[][] SWITCH_LENGTH Constant containing valid lengths for Switch.
 - 
VISA_IINprivate static final java.lang.String[][] VISA_IIN Constant containing IIN ranges reserved for VISA.
 - 
VISA_LENGTHprivate static final byte[][] VISA_LENGTH Constant containing valid lengths for VISA.
 - 
VISA_GROUPINGprivate static final byte[][] VISA_GROUPING Constant defining digit groups for VISA.
 - 
VISA_ELECTRON_IINprivate static final java.lang.String[][] VISA_ELECTRON_IIN Constant containing IIN ranges reserved for VISA Electron.
 - 
VISA_ELECTRON_LENGTHprivate static final byte[][] VISA_ELECTRON_LENGTH Constant containing valid lengths for VISA Electron.
 - 
VISA_ELECTRON_GROUPINGprivate static final byte[][] VISA_ELECTRON_GROUPING Constant defining digit groups for VISA Electron.
 - 
DEFAULT_GROUPINGprivate static final byte[][] DEFAULT_GROUPING Constant defining digit groups for any other network or unknown networks.
 
- 
 - 
Method Detail- 
isValidMIIpublic static boolean isValidMII(java.lang.String pan) Indicates if provided credit card PAN value corresponds to any valid MII (Major Industry Identifier). All valid credit card PANs must start by 3, 4, 5 or 6, which correspond to all the assigned MII.- Parameters:
- pan- a credit card PAN value.
- Returns:
- true if PAN corresponds to a valid MII, false otherwise.
 
 - 
isValidMIIprotected static boolean isValidMII(byte[] panDigits) Indicates if provided array of credit card PAN digits corresponds to any valid MII (Major Industry Identifier). All valid credit card PANs must start by 3, 4, 5 or 6, which correspond to all the assigned MII.- Parameters:
- panDigits- an array of credit card PAN digits.
- Returns:
- true if PAN corresponds to a valid MII, false otherwise.
 
 - 
isValidationEnabledForNetworkpublic static boolean isValidationEnabledForNetwork(CreditCardNetwork network) Indicates if a given credit card network uses Luhn algorithm to validate PAN values. For unknown networks validation is assumed to be disabled.- Parameters:
- network- a credit card network.
- Returns:
- true if provided network uses PAN validation, false otherwise.
 
 - 
isNetworkActivepublic static boolean isNetworkActive(CreditCardNetwork network) Indicates if provided credit card network is still being used commercially. Unknown networks are assumed to be active.- Parameters:
- network- a credit card network.
- Returns:
- true if provided network is still being used, false otherwise.
 
 - 
detectNetworkFromPANpublic static CreditCardNetwork detectNetworkFromPAN(java.lang.String pan) Detects credit card network by using provided credit card PAN value. Detection is done by checking all known registered credit card IINs (Issuer Identification Number) against provided PAN until a match is found.- Parameters:
- pan- a credit card PAN number.
- Returns:
- detected credit card network.
 
 - 
detectNetworkFromPANprotected static CreditCardNetwork detectNetworkFromPAN(byte[] panDigits) Detects credit card network by using provided credit card PAN digits. Detection is done by checking all known registered credit card IINs (Issuer Identification Number) against provided PAN digits until a match is found.- Parameters:
- panDigits- an array containing a credit card PAN digits.
- Returns:
- detected credit card network.
 
 - 
isValidLengthpublic static boolean isValidLength(java.lang.String pan) Detects network for provided PAN and indicates if provided credit card PAN has an appropriate length for provided credit card network.- Parameters:
- pan- a credit card network.
- Returns:
- true if PAN has a valid length, false otherwise.
 
 - 
isValidLengthprotected static boolean isValidLength(byte[] panDigits) Detects network for provided PAN digits and indicates if provided array of credit card PAN digits has an appropriate length for provided credit card network. PAN for unknown network is assumed to always have a valid length.- Parameters:
- panDigits- an array of credit card PAN digits.
- Returns:
- true if PAN has a valid length, false otherwise.
 
 - 
isValidLengthpublic static boolean isValidLength(java.lang.String pan, CreditCardNetwork network)Indicates if provided credit card PAN has an appropriate length for provided credit card network. PAN for unknown network is assumed to always have a valid length.- Parameters:
- pan- a credit card PAN.
- network- a credit card network.
- Returns:
- true if PAN has a valid length, false otherwise.
 
 - 
isValidLengthprotected static boolean isValidLength(byte[] panDigits, CreditCardNetwork network)Indicates if provided array of credit card PAN digits has an appropriate length for provided credit card network. PAN for unknown networks is assumed to always have a valid length.- Parameters:
- panDigits- an array of credit card PAN digits.
- network- a credit card network.
- Returns:
- true if PAN has a valid length, false otherwise.
 
 - 
isValidpublic static boolean isValid(java.lang.String pan) Indicates if provided credit card PAN is valid by detecting its assigned credit card network, checking its length and validating its checksum if network supports validation.- Parameters:
- pan- a credit card pan.
- Returns:
- true if credit card PAN appears to be valid, false otherwise.
 
 - 
isValidprotected static boolean isValid(byte[] panDigits) Indicates if provided credit card PAN is valid by detecting its assigned credit card network, checking its length and validating its checksum if network supports validation.- Parameters:
- panDigits- an array containing credit card pan digits.
- Returns:
- true if credit card PAN appears to be valid, false otherwise.
 
 - 
isAmericanExpressIINpublic static boolean isAmericanExpressIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to American Express IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to American Express, false otherwise.
 
 - 
isAmericanExpressIINprotected static boolean isAmericanExpressIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to American Express IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to American Express, false otherwise.
 
 - 
isAmericanExpressValidLengthpublic static boolean isAmericanExpressValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for American Express cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid American Express length, false otherwise.
 
 - 
isAmericanExpressValidLengthprotected static boolean isAmericanExpressValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for American Express cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid American Express length, false otherwise.
 
 - 
isBankcardIINpublic static boolean isBankcardIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to BankCard IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to BankCard, false otherwise.
 
 - 
isBankcardIINprotected static boolean isBankcardIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to BankCard IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to BankCard, false otherwise.
 
 - 
isBankcardValidLengthpublic static boolean isBankcardValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for BankCard cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid BankCard length, false otherwise.
 
 - 
isBankcardValidLengthprotected static boolean isBankcardValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for BankCard cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid BankCard length, false otherwise.
 
 - 
isChinaUnionPayIINpublic static boolean isChinaUnionPayIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to China UnionPay IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to China UnionPay, false otherwise.
 
 - 
isChinaUnionPayIINprotected static boolean isChinaUnionPayIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to China UnionPay IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to China UnionPay, false otherwise.
 
 - 
isChinaUnionPayValidLengthpublic static boolean isChinaUnionPayValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for China UnionPay cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid China UnionPay length, false otherwise.
 
 - 
isChinaUnionPayValidLengthprotected static boolean isChinaUnionPayValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for China UnionPay cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid China UnionPay length, false otherwise.
 
 - 
isDinersClubCarteBlancheIINpublic static boolean isDinersClubCarteBlancheIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Diners Club Carte Blanche IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Diners Club Carte Blanche, false otherwise.
 
 - 
isDinersClubCarteBlancheIINprotected static boolean isDinersClubCarteBlancheIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to Diners Club Carte Blanche IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Diners Club Carte Blance, false otherwise.
 
 - 
isDinersClubCarteBlancheValidLengthpublic static boolean isDinersClubCarteBlancheValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Diners Club Carte Blanche cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Diners Club Carte Blanche length, false otherwise.
 
 - 
isDinersClubCarteBlancheValidLengthprotected static boolean isDinersClubCarteBlancheValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Diners Club Carte Blanche cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Diners Club Carte Blanche length, false otherwise.
 
 - 
isDinersClubEnrouteIINpublic static boolean isDinersClubEnrouteIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Diners Club Enroute IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Diners Club Enroute, false otherwise.
 
 - 
isDinersClubEnrouteIINprotected static boolean isDinersClubEnrouteIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to Diners Club Enroute IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Diners Club Enroute, false otherwise.
 
 - 
isDinersClubEnrouteValidLengthpublic static boolean isDinersClubEnrouteValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Diners Club Enroute cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Diners Club Enroute length, false otherwise.
 
 - 
isDinersClubEnrouteValidLengthprotected static boolean isDinersClubEnrouteValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Diners Club Enroute cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Diners Club Enroute length, false otherwise.
 
 - 
isDinersClubInternationalIINpublic static boolean isDinersClubInternationalIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Diners Club International IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Diners Club International, false otherwise.
 
 - 
isDinersClubInternationalIINprotected static boolean isDinersClubInternationalIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to Diners Club International IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Diners Club International, false otherwise.
 
 - 
isDinersClubInternationalValidLengthpublic static boolean isDinersClubInternationalValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Diners Club International cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Diners Club International length, false otherwise.
 
 - 
isDinersClubInternationalValidLengthprotected static boolean isDinersClubInternationalValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Diners Club International cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Diners Club International length, false otherwise.
 
 - 
isDinersClubUSACanadaIINpublic static boolean isDinersClubUSACanadaIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Diners Club USA and Canada IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Diners Club USA and Canada, false otherwise.
 
 - 
isDinersClubUSACanadaIINprotected static boolean isDinersClubUSACanadaIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to Diners Club USA and Canada IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Diners Club USA and Canada, false otherwise.
 
 - 
isDinersClubUSACanadaValidLengthpublic static boolean isDinersClubUSACanadaValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Diners Club USA and Canada cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Diners Club USA and Canada length, false otherwise.
 
 - 
isDinersClubUSACanadaValidLengthprotected static boolean isDinersClubUSACanadaValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Diners Club USA and Canada cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Diners Club USA and Canada length, false otherwise.
 
 - 
isDiscoverIINpublic static boolean isDiscoverIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Discover IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Discover, false otherwise.
 
 - 
isDiscoverIINprotected static boolean isDiscoverIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to Discover IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Discover, false otherwise.
 
 - 
isDiscoverValidLengthpublic static boolean isDiscoverValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Discover cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Discover length, false otherwise.
 
 - 
isDiscoverValidLengthprotected static boolean isDiscoverValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Discover cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Discover length, false otherwise.
 
 - 
isInstaPaymentIINpublic static boolean isInstaPaymentIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to InstaPayment IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to InstaPayment, false otherwise.
 
 - 
isInstaPaymentIINprotected static boolean isInstaPaymentIIN(byte[] panDigits) Indicates if provided credit card PAN digits corresponds to InstaPayment IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to InstaPayment, false otherwise.
 
 - 
isInstaPaymentValidLengthpublic static boolean isInstaPaymentValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for InstaPayment cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid InstaPayment length, false otherwise.
 
 - 
isInstaPaymentValidLengthprotected static boolean isInstaPaymentValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for InstaPayment cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid InstaPayment length, false otherwise.
 
 - 
isJCBIINpublic static boolean isJCBIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to JCB IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to JCB, false otherwise.
 
 - 
isJCBIINprotected static boolean isJCBIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to JCB IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to JCB, false otherwise.
 
 - 
isJCBValidLengthpublic static boolean isJCBValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for JCB cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid JCB length, false otherwise.
 
 - 
isJCBValidLengthprotected static boolean isJCBValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for JCB cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid JCB length, false otherwise.
 
 - 
isLaserIINpublic static boolean isLaserIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Laser IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Laser, false otherwise.
 
 - 
isLaserIINprotected static boolean isLaserIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to Laser IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Laser, false otherwise.
 
 - 
isLaserValidLengthpublic static boolean isLaserValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Laser cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Laser length, false otherwise.
 
 - 
isLaserValidLengthprotected static boolean isLaserValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Laser cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Laser length, false otherwise.
 
 - 
isMaestroIINpublic static boolean isMaestroIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Maestro IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Maestro, false otherwise.
 
 - 
isMaestroIINprotected static boolean isMaestroIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to Maestro IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Maestro, false otherwise.
 
 - 
isMaestroValidLengthpublic static boolean isMaestroValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Maestro cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Maestro length, false otherwise.
 
 - 
isMaestroValidLengthprotected static boolean isMaestroValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Maestro cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Maestro length, false otherwise.
 
 - 
isMastercardIINpublic static boolean isMastercardIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Mastercard IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Mastercard, false otherwise.
 
 - 
isMastercardIINprotected static boolean isMastercardIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to Mastercard IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Mastercard, false otherwise.
 
 - 
isMastercardValidLengthpublic static boolean isMastercardValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Mastercard cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Mastercard length, false otherwise.
 
 - 
isMastercardValidLengthprotected static boolean isMastercardValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Mastercard cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Mastercard length, false otherwise.
 
 - 
isSoloIINpublic static boolean isSoloIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Solo IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Solo, false otherwise.
 
 - 
isSoloIINprotected static boolean isSoloIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to Solo IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Solo, false otherwise.
 
 - 
isSoloValidLengthpublic static boolean isSoloValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Solo cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Solo length, false otherwise.
 
 - 
isSoloValidLengthprotected static boolean isSoloValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Solo cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Solo length, false otherwise.
 
 - 
isSwitchIINpublic static boolean isSwitchIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to Switch IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to Switch, false otherwise.
 
 - 
isSwitchIINprotected static boolean isSwitchIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to Switch IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to Switch, false otherwise.
 
 - 
isSwitchValidLengthpublic static boolean isSwitchValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for Switch cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid Switch length, false otherwise.
 
 - 
isSwitchValidLengthprotected static boolean isSwitchValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for Switch cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid Switch length, false otherwise.
 
 - 
isVISAIINpublic static boolean isVISAIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to VISA IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to VISA, false otherwise.
 
 - 
isVISAIINprotected static boolean isVISAIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to VISA IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to VISA, false otherwise.
 
 - 
isVISAValidLengthpublic static boolean isVISAValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for VISA cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid VISA length, false otherwise.
 
 - 
isVISAValidLengthprotected static boolean isVISAValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for VISA cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid VISA length, false otherwise.
 
 - 
isVISAElectronIINpublic static boolean isVISAElectronIIN(java.lang.String pan) Indicates if provided credit card PAN corresponds to VISA Electron IIN (Issuer Identification Number).- Parameters:
- pan- a credit card PAN.
- Returns:
- true if provided PAN corresponds to VISA Electron, false otherwise.
 
 - 
isVISAElectronIINprotected static boolean isVISAElectronIIN(byte[] panDigits) Indicates if provided credit card PAN digits correspond to VISA Electron IIN (Issuer Identification Number).- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if provided PAN corresponds to VISA Electron, false otherwise.
 
 - 
isVISAElectronValidLengthpublic static boolean isVISAElectronValidLength(java.lang.String pan) Indicates if provided credit card PAN has valid length for VISA Electron cards.- Parameters:
- pan- a credit card PAN.
- Returns:
- true if PAN has a valid VISA Electron length, false otherwise.
 
 - 
isVISAElectronValidLengthprotected static boolean isVISAElectronValidLength(byte[] panDigits) Indicates if provided credit card PAN digits have valid length for VISA Electron cards.- Parameters:
- panDigits- array containing credit card PAN digits.
- Returns:
- true if PAN has a valid VISA Electron length, false otherwise.
 
 - 
isValidChecksumForPANpublic static boolean isValidChecksumForPAN(java.lang.String pan) Validates provided credit card PAN using Luhn algorithm assuming that the last digit of provided PAN corresponds to its checksum value. This method computes the checksum value using Luhn algorithm and compares that with the last digit of provided PAN value, if both are equal PAN checksum is assumed to be valid.- Parameters:
- pan- a credit card PAN to validate its checksum.
- Returns:
- true if checksum is valid, false otherwise.
 
 - 
isValidChecksumForPANprotected static boolean isValidChecksumForPAN(byte[] panDigits) Validates provided credit card PAN using Luhn algorithm assuming that the last digit of provided PAN corresponds to its checksum value. This method computes the checksum value using Luhn algorithm and compares that with the last digit of provided PAN digits, if both are equal PAN checksum is assumed to be valid.- Parameters:
- panDigits- array of digits containing a credit card PAN.
- Returns:
- true if checksum is valid, false otherwise.
 
 - 
toDigitspublic static byte[] toDigits(java.lang.String pan) Converts a credit card PAN from its string representation into an array containing PAN digits. This method will strip away any spaces or punctuation marks, leaving only the digits found within provided PAN.- Parameters:
- pan- a credit card PAN.
- Returns:
- credit card PAN represented as an array of digits.
 
 - 
isValidIINprotected static boolean isValidIIN(java.lang.String pan, java.lang.String[][] iins)Internal method to check whether provided credit card PAN corresponds to a valid IIN by checking the array of valid IIN ranges.- Parameters:
- pan- a credit card PAN.
- iins- array of valid IIN ranges.
- Returns:
- true if PAN corresponds to a valid IIN, false otherwise.
 
 - 
isValidIINprotected static boolean isValidIIN(byte[] panDigits, java.lang.String[][] iins)Internal method to check whether provided array of PAN digits corresponds to a valid IIN by checking the array of valid IIN ranges.- Parameters:
- panDigits- array containing credit card PAN digits.
- iins- array of valid IIN ranges.
- Returns:
- true if PAN corresponds to valid IIN, false otherwise.
 
 - 
isValidLengthprotected static boolean isValidLength(java.lang.String pan, byte[][] lengths)Internal method to determine whether length of provided credit card PAN is valid based on array of valid length ranges.- Parameters:
- pan- a credit card PAN.
- lengths- array of valid length ranges.
- Returns:
- true if PAN length is valid, false otherwise.
 
 - 
isValidLengthprotected static boolean isValidLength(byte[] panDigits, byte[][] lengths)Internal method to determine whether length of provided array of credit card PAN digits is valid based on array of valid length ranges.- Parameters:
- panDigits- array containing credit card PAN digits.
- lengths- array of valid length ranges.
- Returns:
- true if PAN length is valid, false otherwise.
 
 - 
numLeadingZerosprotected static int numLeadingZeros(java.lang.String iin) Computes number of leading zeros on any given IIN.- Parameters:
- iin- a given IIN in string format.
- Returns:
- number of leading zeros.
 
 - 
computeCheckprotected static byte computeCheck(byte[] digitsWithoutCheck) Computes checksum using Luhn algorithm. Notice that this method will modify the values in provided array of digits.- Parameters:
- digitsWithoutCheck- array containing a credit card PAN number without its checksum value (which is the last digit).
- Returns:
- computed checksum value.
 
 - 
groupingsForNetworkprotected static byte[][] groupingsForNetwork(CreditCardNetwork network) Returns credit card digit groupings for provided credit card network.- Parameters:
- network- a credit card network.
- Returns:
- digit groupings.
 
 - 
getNumberOfGroupsForNetworkpublic static int getNumberOfGroupsForNetwork(CreditCardNetwork network) Returns number of digit groups for provided credit card network.- Parameters:
- network- a credit card network.
- Returns:
- number of digit groups for provided credit card network.
 
 - 
getMinDigitsForGroupAndNetworkpublic static int getMinDigitsForGroupAndNetwork(int groupPos, CreditCardNetwork network)Returns minimum number of required digits for provided group position (starting at zero until the maximum number of groups minus one).- Parameters:
- groupPos- position of group of digits.
- network- credit card network.
- Returns:
- minimum number of required digits.
- Throws:
- java.lang.IllegalArgumentException- if groupPos is negative or exceeds the maximum number of groups minus one for provided credit card network.
 
 - 
getMaxDigitsForGroupAndNetworkpublic static int getMaxDigitsForGroupAndNetwork(int groupPos, CreditCardNetwork network)Returns maximum number of allowed digits for provided group position (starting at zero until the maximum number of groups minus one).- Parameters:
- groupPos- position of group of digits.
- network- credit card network.
- Returns:
- maximum number of allowed digits.
- Throws:
- java.lang.IllegalArgumentException- if groupPos is negative or exceeds the maximum number of groups minus one for provided credit card network.
 
 
- 
 
-