|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.pay.util.PaymentCredential
public class PaymentCredential
| Field Summary | |
|---|---|
private UserAddress |
address
WRITEME |
private String |
buyerCompany
WRITEME |
private String |
buyerFamilyName
WRITEME |
private String |
buyerGivenName
WRITEME |
private BigDecimal |
cardCode
The CCV, Card Code. |
private String |
cardCodeString
Deprecated. |
private BigInteger |
cardNumber
The credit-card number |
private CredentialType |
credentialType
The type of credentials presented. |
private Date |
expiry
The expiry date of a credit card (used for validation) |
| Constructor Summary | |
|---|---|
PaymentCredential()
|
|
| Method Summary | |
|---|---|
void |
applyTo(AimTransaction xact)
Apply a (credit-card only) set of payment credentials to an Authorize.Net one-time-purchase (AIM, Advanced Integration Method) object. |
void |
applyTo(ARBNameAndAddress billTo)
Apply these payment credentials' data to an Authorize.Net Automatic Recurring Billing name and address object, needed for Auth-net-ARB submission. |
void |
applyTo(ARBPayment payment)
Apply the credit-card information to the Authorize.net ARBPayment object. |
private static boolean |
doesNumberMatchLuhnChecksum(BigInteger number)
Perform Luhn algorithm validation upon the credit-card number supplied. |
UserAddress |
getAddress()
|
String |
getBuyerCompany()
|
String |
getBuyerFamilyName()
|
String |
getBuyerGivenName()
|
CredentialType |
getCredentialType()
|
int |
getExpiryMonth()
WRITEME: document this method (brpocock@star-hope.org, Sep 11, 2009) |
int |
getExpiryYear()
WRITEME: document this method (brpocock@star-hope.org, Sep 11, 2009) |
static String |
getFriendlyName(CredentialType type)
|
private String |
getLastFour()
|
boolean |
isReadyToGo()
|
void |
setBuyerCompany(String company)
WRITEME: document this method (brpocock@star-hope.org, Sep 11, 2009) |
void |
setBuyerFamilyName(String parameter)
|
void |
setBuyerGivenName(String parameter)
|
void |
setBuyerInfo(String buyerGivenName1,
String buyerFamilyName1,
UserAddress address1)
WRITEME: document this method (brpocock@star-hope.org, Sep 23, 2009) |
void |
setCardCode(BigDecimal num)
|
void |
setCardCode(String num)
|
void |
setCardCodeAsString(String code)
Deprecated. use setCardCode(BigDecimal) |
void |
setCardNumber(BigInteger newCardNumber)
|
void |
setCardNumber(String num)
Set a card number from a user-supplied string. |
void |
setCredentialType(CredentialType credentialType1)
|
void |
setExpiry(Date d)
|
void |
setExpiryMonth(int expiryMonth)
|
void |
setExpiryYear(int expiryYear)
|
void |
setIBCCard(String ibcCode)
This was to have been part of Project Risqué and was never implemented. |
void |
shred()
Discard all credential information |
String |
toString()
This is an overriding method. |
void |
verifyCredentials()
Perform basic validation upon the credentials. |
static int |
verifyIBC(String ibcCode)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private volatile UserAddress address
private volatile String buyerCompany
private volatile String buyerFamilyName
private volatile String buyerGivenName
private volatile BigDecimal cardCode
@Deprecated private volatile String cardCodeString
private volatile BigInteger cardNumber
private CredentialType credentialType
CredentialType for
all valid values. Note that at present we only actually support
credit cards and gift cards.
private Date expiry
| Constructor Detail |
|---|
public PaymentCredential()
| Method Detail |
|---|
private static boolean doesNumberMatchLuhnChecksum(BigInteger number)
number - An arbitrary-length credit-card number
public static String getFriendlyName(CredentialType type)
type - a type of credentials
public static int verifyIBC(String ibcCode)
throws NotImplementedException,
AlreadyUsedException,
NotFoundException
ibcCode - WRITEME
NotImplementedException - WRITEME
AlreadyUsedException - WRITEME
NotFoundException - WRITEME
public void applyTo(AimTransaction xact)
throws UnsupportedCredentialException
Apply a (credit-card only) set of payment credentials to an Authorize.Net one-time-purchase (AIM, Advanced Integration Method) object.
At present, this (or applyTo(ARBPayment)) are the
only supported way to extract the card information once
it's entered into this object; however, the last 4 digits of the
card number are visible via #toString()
xact - An Authorize.Net transaction in the form of
AimTransaction
UnsupportedCredentialException - if attempting to apply a
credential type other than MasterCard or VISApublic void applyTo(ARBNameAndAddress billTo)
billTo - The ARBNameAndAddress object, which will be
a part of the billing submission
public void applyTo(ARBPayment payment)
throws UnsupportedCredentialException
Apply the credit-card information to the Authorize.net ARBPayment object.
At present, this (or applyTo(AimTransaction)) are the
only supported way to extract the card information once
it's entered into this object; however, the last 4 digits of the
card number are visible via #toString()
payment - The ARB Payment object to which we want to append
the card information.
UnsupportedCredentialException - if this is not a
credit-card credentials bundlepublic UserAddress getAddress()
public String getBuyerCompany()
public String getBuyerFamilyName()
public String getBuyerGivenName()
public CredentialType getCredentialType()
public int getExpiryMonth()
public int getExpiryYear()
private String getLastFour()
toString() and only accessible thereby.public boolean isReadyToGo()
public void setBuyerCompany(String company)
company - WRITEMEpublic void setBuyerFamilyName(String parameter)
parameter - the buyerFamilyName to setpublic void setBuyerGivenName(String parameter)
parameter - buyer's given name
public void setBuyerInfo(String buyerGivenName1,
String buyerFamilyName1,
UserAddress address1)
buyerGivenName1 - WRITEMEbuyerFamilyName1 - WRITEMEaddress1 - WRITEMEpublic void setCardCode(BigDecimal num)
num - The CCV, Card Code Verification, number (3 or 4
digits)public void setCardCode(String num)
num - The CCV, Card Code Verification, number (3 or 4
digits)@Deprecated public void setCardCodeAsString(String code)
setCardCode(BigDecimal)
code - The CCV, Card Code Verification, number (3 or 4
digits)
public void setCardNumber(BigInteger newCardNumber)
throws NumberFormatException
newCardNumber - The credit-card number (usually 16 digits)
NumberFormatException - if the card number does not match
checksum
public void setCardNumber(String num)
throws NumberFormatException
num - The presumed credit-card number, possibly containing
spaces or dashes.
NumberFormatException - if the card number has an invalid
length, non-digit contents, or does not match a
correct checksumming for the type of card providedpublic void setCredentialType(CredentialType credentialType1)
credentialType1 - the credentialType to set
public void setExpiry(Date d)
throws CredentialExpiredException
d - The expiration date. Only the month and year are used:
the day can be "1" for validity
CredentialExpiredException - if the expiry date is in the
pastpublic void setExpiryMonth(int expiryMonth)
expiryMonth - expiry monthpublic void setExpiryYear(int expiryYear)
expiryYear - expiry year
public void setIBCCard(String ibcCode)
throws NotImplementedException
ibcCode - WRITEME
NotImplementedException - WRITEMEpublic void shred()
public String toString()
toString in class ObjectObject.toString()
public void verifyCredentials()
throws DataException
Perform basic validation upon the credentials.
For credit-cards, verify that the credentials appear to have a valid credit-card number.
For electronic payments of other kinds, perform basic validation of credential values to ensure that they appear to be basically plausible.
XXX right now, this only actually checks the first digit against VISA/MasterCard selection. This should do proper checksum checks against the full number...
DataException - if the card number is invalid (impossible),
or the type of credentials for payment presented are
not set to a valid/supported type (currently VISA or
MasterCard)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||