public enum CardType extends Enum<CardType>
Enum Constant and Description |
---|
AMEX
American Express cards start in 34 or 37
|
DINERSCLUB
Diners Club
|
DISCOVER
Discover starts with 6x for some values of x.
|
INSUFFICIENT_DIGITS
Not enough information given.
|
JCB
JCB (see http://www.jcbusa.com/) cards start with 35
|
MAESTRO
Maestro
|
MASTERCARD
Mastercard starts with 51-55
|
UNKNOWN
Unknown card type.
|
VISA
Visa starts with 4
|
Modifier and Type | Method and Description |
---|---|
int |
cvvLength() |
static CardType |
fromCardNumber(String numStr)
Infer the CardType from the number string.
|
static CardType |
fromString(String typeStr)
Infer the card type from a string.
|
String |
getDisplayName(String languageOrLocale)
Convenience method to return a CardType string (e.g.
|
Bitmap |
imageBitmap(Context context)
Returns the
Bitmap of the card logo (e.g. |
int |
numberLength() |
String |
toString() |
static CardType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CardType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CardType AMEX
public static final CardType DINERSCLUB
public static final CardType DISCOVER
public static final CardType JCB
public static final CardType MASTERCARD
public static final CardType VISA
public static final CardType MAESTRO
public static final CardType UNKNOWN
public static final CardType INSUFFICIENT_DIGITS
public final String name
public static CardType[] values()
for (CardType c : CardType.values()) System.out.println(c);
public static CardType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getDisplayName(String languageOrLocale)
CardIOActivity.EXTRA_LANGUAGE_OR_LOCALE
for a
detailed explanation of languageOrLocale.languageOrLocale
- See CardIOActivity.EXTRA_LANGUAGE_OR_LOCALE
.public int numberLength()
public int cvvLength()
public Bitmap imageBitmap(Context context)
Bitmap
of the card logo (e.g. Visa, MC, etc.), if known. Otherwise, returns null.
context
- The application context for retrieving the image densitypublic static CardType fromString(String typeStr)
typeStr
- The String value of this enumpublic static CardType fromCardNumber(String numStr)
numStr
- A string containing only the card number.Copyright © 2012-2016 PayPal, Inc. All Rights Reserved.