public class Card
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Card.Builder
Builder class for a
Card model. |
static interface |
Card.CardBrand |
static interface |
Card.FundingType |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AMERICAN_EXPRESS |
static java.lang.String |
DINERS_CLUB |
static java.lang.String |
DISCOVER |
static java.lang.String |
FUNDING_CREDIT |
static java.lang.String |
FUNDING_DEBIT |
static java.lang.String |
FUNDING_PREPAID |
static java.lang.String |
FUNDING_UNKNOWN |
static java.lang.String |
JCB |
static java.lang.String |
MASTERCARD |
static int |
MAX_LENGTH_AMERICAN_EXPRESS |
static int |
MAX_LENGTH_DINERS_CLUB |
static int |
MAX_LENGTH_STANDARD |
static java.lang.String[] |
PREFIXES_AMERICAN_EXPRESS |
static java.lang.String[] |
PREFIXES_DINERS_CLUB |
static java.lang.String[] |
PREFIXES_DISCOVER |
static java.lang.String[] |
PREFIXES_JCB |
static java.lang.String[] |
PREFIXES_MASTERCARD |
static java.lang.String[] |
PREFIXES_VISA |
static java.lang.String |
UNKNOWN |
static java.lang.String |
VISA |
| Constructor and Description |
|---|
Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc)
Convenience constructor for a Card object with a minimum number of inputs.
|
Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc,
java.lang.String name,
java.lang.String addressLine1,
java.lang.String addressLine2,
java.lang.String addressCity,
java.lang.String addressState,
java.lang.String addressZip,
java.lang.String addressCountry,
java.lang.String currency)
Convenience constructor with address and currency.
|
Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc,
java.lang.String name,
java.lang.String addressLine1,
java.lang.String addressLine2,
java.lang.String addressCity,
java.lang.String addressState,
java.lang.String addressZip,
java.lang.String addressCountry,
java.lang.String brand,
java.lang.String last4,
java.lang.String fingerprint,
java.lang.String funding,
java.lang.String country,
java.lang.String currency)
Card constructor with all available fields.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAddressCity() |
java.lang.String |
getAddressCountry() |
java.lang.String |
getAddressLine1() |
java.lang.String |
getAddressLine2() |
java.lang.String |
getAddressState() |
java.lang.String |
getAddressZip() |
java.lang.String |
getBrand()
Gets the
brand of this card. |
java.lang.String |
getCountry() |
java.lang.String |
getCurrency() |
java.lang.String |
getCVC() |
java.lang.Integer |
getExpMonth() |
java.lang.Integer |
getExpYear() |
java.lang.String |
getFingerprint() |
java.lang.String |
getFunding() |
java.lang.String |
getLast4() |
java.lang.String |
getName() |
java.lang.String |
getNumber() |
java.lang.String |
getType()
Deprecated.
|
void |
setAddressCity(java.lang.String addressCity)
Deprecated.
|
void |
setAddressCountry(java.lang.String addressCountry)
Deprecated.
|
void |
setAddressLine1(java.lang.String addressLine1)
Deprecated.
|
void |
setAddressLine2(java.lang.String addressLine2)
Deprecated.
|
void |
setAddressState(java.lang.String addressState)
Deprecated.
|
void |
setAddressZip(java.lang.String addressZip)
Deprecated.
|
void |
setCurrency(java.lang.String currency)
Deprecated.
|
void |
setCVC(java.lang.String cvc)
Deprecated.
|
void |
setExpMonth(java.lang.Integer expMonth)
Deprecated.
|
void |
setExpYear(java.lang.Integer expYear)
Deprecated.
|
void |
setName(java.lang.String name)
Deprecated.
|
void |
setNumber(java.lang.String number)
Deprecated.
|
boolean |
validateCard()
Checks whether
this represents a valid card. |
boolean |
validateCVC()
Checks whether or not the
cvc field is valid. |
boolean |
validateExpiryDate()
|
boolean |
validateExpMonth()
Checks whether or not the
expMonth field is valid. |
boolean |
validateExpYear()
Checks whether or not the
expYear field is valid. |
boolean |
validateNumber()
Checks whether or not the
number field is valid. |
public static final java.lang.String AMERICAN_EXPRESS
public static final java.lang.String DISCOVER
public static final java.lang.String JCB
public static final java.lang.String DINERS_CLUB
public static final java.lang.String VISA
public static final java.lang.String MASTERCARD
public static final java.lang.String UNKNOWN
public static final java.lang.String FUNDING_CREDIT
public static final java.lang.String FUNDING_DEBIT
public static final java.lang.String FUNDING_PREPAID
public static final java.lang.String FUNDING_UNKNOWN
public static final java.lang.String[] PREFIXES_AMERICAN_EXPRESS
public static final java.lang.String[] PREFIXES_DISCOVER
public static final java.lang.String[] PREFIXES_JCB
public static final java.lang.String[] PREFIXES_DINERS_CLUB
public static final java.lang.String[] PREFIXES_VISA
public static final java.lang.String[] PREFIXES_MASTERCARD
public static final int MAX_LENGTH_STANDARD
public static final int MAX_LENGTH_AMERICAN_EXPRESS
public static final int MAX_LENGTH_DINERS_CLUB
public Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc,
java.lang.String name,
java.lang.String addressLine1,
java.lang.String addressLine2,
java.lang.String addressCity,
java.lang.String addressState,
java.lang.String addressZip,
java.lang.String addressCountry,
java.lang.String brand,
java.lang.String last4,
java.lang.String fingerprint,
java.lang.String funding,
java.lang.String country,
java.lang.String currency)
number - the credit card numberexpMonth - the expiry monthexpYear - the expiry yearcvc - the CVC numbername - the card nameaddressLine1 - first line of the billing addressaddressLine2 - second line of the billing addressaddressCity - city of the billing addressaddressState - state of the billing addressaddressZip - zip code of the billing addressaddressCountry - country for the billing addressbrand - brand of this cardlast4 - last 4 digits of the cardfingerprint - the card fingerprintfunding - the funding type of the cardcountry - ISO country code of the card itselfcurrency - currency used by the cardpublic Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc,
java.lang.String name,
java.lang.String addressLine1,
java.lang.String addressLine2,
java.lang.String addressCity,
java.lang.String addressState,
java.lang.String addressZip,
java.lang.String addressCountry,
java.lang.String currency)
number - the card numberexpMonth - the expiry monthexpYear - the expiry yearcvc - the CVC codename - the cardholder nameaddressLine1 - the first line of the billing addressaddressLine2 - the second line of the billing addressaddressCity - the city of the billing addressaddressState - the state of the billing addressaddressZip - the zip code of the billing addressaddressCountry - the country of the billing addresscurrency - the currency of the cardpublic Card(java.lang.String number,
java.lang.Integer expMonth,
java.lang.Integer expYear,
java.lang.String cvc)
number - the card numberexpMonth - the expiry monthexpYear - the expiry yearcvc - the CVC codepublic boolean validateCard()
this represents a valid card.true if valid, false otherwise.public boolean validateNumber()
number field is valid.true if valid, false otherwise.public boolean validateExpiryDate()
true if valid, false otherwisepublic boolean validateCVC()
cvc field is valid.true if valid, false otherwisepublic boolean validateExpMonth()
expMonth field is valid.true if valid, false otherwise.public boolean validateExpYear()
expYear field is valid.true if valid, false otherwise.public java.lang.String getNumber()
number of this card@Deprecated public void setNumber(java.lang.String number)
brand and last4.number - the new numberpublic java.lang.String getCVC()
cvc for this card@Deprecated public void setCVC(java.lang.String cvc)
cvc - the new cvc code for this card@Nullable public java.lang.Integer getExpMonth()
expMonth for this card@Deprecated
public void setExpMonth(@Nullable
java.lang.Integer expMonth)
expMonth - sets the expMonth for this cardpublic java.lang.Integer getExpYear()
expYear for this card@Deprecated public void setExpYear(java.lang.Integer expYear)
expYear - sets the expYear for this cardpublic java.lang.String getName()
name for this card@Deprecated public void setName(java.lang.String name)
name - sets the cardholder name for this cardpublic java.lang.String getAddressLine1()
addressLine1 of this card@Deprecated public void setAddressLine1(java.lang.String addressLine1)
addressLine1 - sets the addressLine1 for this cardpublic java.lang.String getAddressLine2()
addressLine2 of this card@Deprecated public void setAddressLine2(java.lang.String addressLine2)
addressLine2 - sets the addressLine2 for this cardpublic java.lang.String getAddressCity()
addressCity for this card@Deprecated public void setAddressCity(java.lang.String addressCity)
addressCity - sets the addressCity for this cardpublic java.lang.String getAddressZip()
addressZip of this card@Deprecated public void setAddressZip(java.lang.String addressZip)
addressZip - sets the addressZip for this cardpublic java.lang.String getAddressState()
addressState of this card@Deprecated public void setAddressState(java.lang.String addressState)
addressState - sets the addressState for this cardpublic java.lang.String getAddressCountry()
addressCountry of this card@Deprecated public void setAddressCountry(java.lang.String addressCountry)
addressCountry - sets the addressCountry for this cardpublic java.lang.String getCurrency()
currency of this card. Only supported for Managed accounts.@Deprecated public void setCurrency(java.lang.String currency)
currency - sets the currency of this card. Only supported for Managed accounts.public java.lang.String getLast4()
@Deprecated public java.lang.String getType()
brand of this card, changed from the "type" field. Use getBrand()
instead.brand of this cardpublic java.lang.String getBrand()
brand of this card. Updates the value if none has yet been set, or
if the number has been changed.brand of this cardpublic java.lang.String getFingerprint()
fingerprint of this card@Nullable public java.lang.String getFunding()
funding type of this cardpublic java.lang.String getCountry()
country of this card