paypalnvp.fields
Class CreditCard
java.lang.Object
paypalnvp.fields.CreditCard
- All Implemented Interfaces:
- java.io.Serializable, RequestFields
public final class CreditCard
- extends java.lang.Object
- implements RequestFields
Credit Card Details Fields
- See Also:
- Serialized Form
Nested Class Summary |
static class |
CreditCard.CreditCardType
Type of credit card
For UK, only Maestro, Solo, MasterCard, Discover, and Visa are
allowable. |
Method Summary |
java.util.Map<java.lang.String,java.lang.String> |
getNVPRequest()
Creates and returns part of the nvp (name value pair) request containing
request values |
void |
setCVV2(int cvv2)
|
void |
setExpiryDate(java.util.Date expiryDate)
|
void |
setIssueNumber(int issueNumber)
|
void |
setStartDate(java.util.Date startDate)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CreditCard
public CreditCard(CreditCard.CreditCardType cardType,
java.lang.String cardNumber)
throws java.lang.IllegalArgumentException
- Parameters:
cardType
- Type of credit card. For UK, only Maestro, Solo,
MasterCard, Discover, and Visa are allowable.
For Canada, only MasterCard and Visa are allowable;
Interac debit cards are not supported.
Note:
If the credit card type is Maestro or Solo, the
CURRENCYCODE must be GBP. In addition, either
STARTDATE or ISSUENUMBER must be specified.cardNumber
- Character length and limitations: numeric
characters only. No spaces or punctuation. Must
conform with modulo and length required by each
credit card type.
- Throws:
java.lang.IllegalArgumentException
setExpiryDate
public void setExpiryDate(java.util.Date expiryDate)
- Parameters:
expiryDate
- Credit card expiration date. This field is required
if you are using recurring payments with direct
payments. Only month and a year is used from
supplied Date argument.
setCVV2
public void setCVV2(int cvv2)
throws java.lang.IllegalArgumentException
- Parameters:
cvv2
- Card Verification Value, version 2. Your Merchant Account
settings determine whether this field is required.
Character length for Visa, MasterCard, and Discover:
exactly three digits.Character length for American Express:
exactly four digits.To comply with credit card processing
regulations, you must not store this value after a
transaction has been completed.
- Throws:
java.lang.IllegalArgumentException
setStartDate
public void setStartDate(java.util.Date startDate)
- Parameters:
startDate
- Month and year that Maestro or Solo card was issued.
Only month and a year is used from supplied Date
argument.
setIssueNumber
public void setIssueNumber(int issueNumber)
throws java.lang.IllegalArgumentException
- Parameters:
issueNumber
- Issue number of Maestro or Solo card. Character
length: two numeric digits maximum.
- Throws:
java.lang.IllegalArgumentException
getNVPRequest
public java.util.Map<java.lang.String,java.lang.String> getNVPRequest()
- Description copied from interface:
RequestFields
- Creates and returns part of the nvp (name value pair) request containing
request values
- Specified by:
getNVPRequest
in interface RequestFields
- Returns:
- part of the nvp request as a Map
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object