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 | Field and Description |
---|---|
java.lang.String |
name |
Modifier and Type | Method and Description |
---|---|
int |
cvvLength() |
static CardType |
fromCardNumber(java.lang.String numStr)
Infer the CardType from the number string.
|
static CardType |
fromString(java.lang.String typeStr)
Infer the card type from a string.
|
java.lang.String |
getDisplayName(java.lang.String languageOrLocale)
Convenience method to return a CardType string (e.g.
|
android.graphics.Bitmap |
imageBitmap(android.content.Context context)
Returns the
Bitmap of the card logo (e.g. |
int |
numberLength() |
java.lang.String |
toString() |
static CardType |
valueOf(java.lang.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 static CardType[] values()
for (CardType c : CardType.values()) System.out.println(c);
public static CardType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
in class java.lang.Enum<CardType>
public java.lang.String getDisplayName(java.lang.String languageOrLocale)
CardScannerActivity.EXTRA_LANGUAGE_OR_LOCALE
for a
detailed explanation of languageOrLocale.languageOrLocale
- See CardScannerActivity.EXTRA_LANGUAGE_OR_LOCALE
.public int numberLength()
public int cvvLength()
public android.graphics.Bitmap imageBitmap(android.content.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(java.lang.String typeStr)
typeStr
- The String value of this enumpublic static CardType fromCardNumber(java.lang.String numStr)
numStr
- A string containing only the card number.Copyright © 2012 PayPal, Inc. All Rights Reserved.