|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.integrations.cybersource.CyberSourceCreditCard
public class CyberSourceCreditCard
This class manages the communications to a CyberSource payment server.
Currently only credit card transactions are supported, no CyberSource coins or checks.
All information on the CyberSource API was aquired from 19991112_ICS2_DG.pdf version 2.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static java.lang.String |
CMD_AUTHORIZE
|
static java.lang.String |
CMD_CAPTURE
|
static java.lang.String |
CMD_RETURN
|
static java.lang.String |
CV_NUMBER_FIELD_NAME
The name of the Cybersource field representing the credit card verification number. |
static java.lang.String |
CV_NUMBER_INDICATOR_FIELD_NAME
The name of the Cybersource field representing the credit card verification number. |
CyberSourceConnection |
mCsCon
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
CyberSourceCreditCard()
Determines if the credit card verification number is used for authorizations. |
Method Summary | |
---|---|
protected void |
addAmount(com.cybersource.ics.client.message.ICSClientRequest pRequest,
com.cybersource.ics.client.message.ICSClientOffer pOffer,
CreditCardInfo pInfo)
Copy the amount to authorize, debit, or credit from the credit card info into the CyberSource client offer, then add the offer to the request. |
protected void |
addBillingAddress(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the billing address information from the credit card info into the CyberSource client request. |
protected void |
addContactInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the user's first and last name, phone number, and email address from the credit card info's billing address to the CyberSource client request. |
protected void |
addCreditCardInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the credit card number and expiration date from the credit card info info the CyberSource client request. |
protected void |
addCurrencyCode(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the currencyCode from the credit card info into the CyberSource client request. |
protected void |
addExtendedInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
com.cybersource.ics.client.message.ICSClientOffer pOffer,
CreditCardInfo pInfo,
java.lang.String pCommand)
Copy any additional information required from the credit card info into the CyberSource request or the CyberSource client offer. |
protected void |
addMerchantId(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the merchantId from the CyberSource connection into the client request. |
protected void |
addPaymentId(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Copy the paymentId property from the CreditCardInfo into the client request. |
protected boolean |
addressRequiresPostalCode(CreditCardInfo pInfo)
Return true if the billing address in pInfo requires a non-null value for postalCode property. |
protected boolean |
addressRequiresState(CreditCardInfo pInfo)
Return true if the billing address in pInfo requires a non-null value for state property. |
protected void |
addSecurityCode(com.cybersource.ics.client.message.ICSClientRequest pRequest,
com.cybersource.ics.client.message.ICSClientOffer pOffer,
CreditCardInfo pInfo,
java.lang.String pCommand)
Copy the security code (CVV number) from the credit card info into the CyberSource client offer, then add the offer to the request. |
CreditCardStatus |
authorize(CreditCardInfo ccinfo)
Authorize the amount on the credit card |
CreditCardStatus |
credit(CreditCardInfo ccinfo)
Credit the amount on the credit card as a new order |
CreditCardStatus |
credit(CreditCardInfo ccinfo,
CreditCardStatus pStatus)
Credit the amount on the credit card after debiting. |
CreditCardStatus |
debit(CreditCardInfo ccinfo,
CreditCardStatus pStatus)
Debit the amount on the credit card after authorization |
CreditCardStatus |
decreaseAuthorization(CreditCardInfo pCreditCardInfo,
PaymentStatus pAuthStatus)
Decreases the authorized amount for the credit card. |
void |
doStartService()
Verify that the Cybersource connection is non-null |
CyberSourceConnection |
getCsCon()
|
boolean |
isSecurityCodeEnabled()
|
protected void |
modifyCreditCardInfo4digits(com.cybersource.ics.client.message.ICSClientRequest pRequest,
CreditCardInfo pInfo)
Modify the credit card number for Payment Card Industry (PCI) purposes to only display the last 4 digits. |
CreditCardStatus |
performAuthORCredit(CreditCardInfo ccinfo,
java.lang.String pCommand)
This either authorizes an amount on a credit card which is a required operation before billing or credits an amount on a card as a new order (no record of a previous billing) The following list of properties of the CreditCardInfo are required. |
CreditCardStatus |
performDebitORCredit(CreditCardInfo ccinfo,
java.lang.String pTransId,
java.lang.String pCommand)
Deprecated. Please use performDebitORCredit(CreditCardInfo ccinfo, String pTransId, String pRequestToken, String pCommand) instead. |
CreditCardStatus |
performDebitORCredit(CreditCardInfo ccinfo,
java.lang.String pTransId,
java.lang.String pRequestToken,
java.lang.String pCommand)
This performs either billing following an authorize, actually charging a credit card or credit a card following an already issued billing operation |
void |
setCsCon(CyberSourceConnection pCsCon)
|
void |
setSecurityCodeEnabled(boolean pSecurityCodeEnabled)
|
java.lang.String |
toString()
|
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String CMD_AUTHORIZE
public static final java.lang.String CMD_RETURN
public static final java.lang.String CMD_CAPTURE
public static final java.lang.String CV_NUMBER_FIELD_NAME
public static final java.lang.String CV_NUMBER_INDICATOR_FIELD_NAME
public CyberSourceConnection mCsCon
Constructor Detail |
---|
public CyberSourceCreditCard()
Method Detail |
---|
public void setCsCon(CyberSourceConnection pCsCon)
public CyberSourceConnection getCsCon()
public boolean isSecurityCodeEnabled()
public void setSecurityCodeEnabled(boolean pSecurityCodeEnabled)
pSecurityCodeEnabled
- -true if credit card security code should be added to an authorization
request, false - otherwise.public CreditCardStatus credit(CreditCardInfo ccinfo, CreditCardStatus pStatus)
CreditCardProcessor
credit
in interface CreditCardProcessor
ccinfo
- the CreditCardInfo reference which contains all the credit datapStatus
- the CreditCardStatus object which contains information about the transaction. This
should be the object which was returned from debit().
public CreditCardStatus credit(CreditCardInfo ccinfo)
CreditCardProcessor
credit
in interface CreditCardProcessor
ccinfo
- the CreditCardInfo reference which contains all the credit data
public CreditCardStatus debit(CreditCardInfo ccinfo, CreditCardStatus pStatus)
CreditCardProcessor
debit
in interface CreditCardProcessor
ccinfo
- the CreditCardInfo reference which contains all the debit datapStatus
- the CreditCardStatus object which contains information about the transaction. This
should be the object which was returned from authorize().
public CreditCardStatus authorize(CreditCardInfo ccinfo)
CreditCardProcessor
authorize
in interface CreditCardProcessor
ccinfo
- the CreditCardInfo reference which contains all the authorization data
public CreditCardStatus performDebitORCredit(CreditCardInfo ccinfo, java.lang.String pTransId, java.lang.String pCommand) throws com.cybersource.ics.base.exception.ICSException
The below paramaters come from CreditCardInfo
pPaymentId
- The orderid of the order this is a return or debit for.(REQUIRED)pMerchantId
- The id that identifies the merchant (comes from the props file)pAmount
- Amount of money to return or debit (REQUIRED)pCurrency
- Type of currency, currently usd | cad | frf.(REQUIRED)pTransId
- The transaction id returned from auth or debit, to be used
for debit or credit
com.cybersource.ics.base.exception.ICSException
public CreditCardStatus performDebitORCredit(CreditCardInfo ccinfo, java.lang.String pTransId, java.lang.String pRequestToken, java.lang.String pCommand) throws com.cybersource.ics.base.exception.ICSException
The below paramaters come from CreditCardInfo
pPaymentId
- The orderid of the order this is a return or debit for.(REQUIRED)pMerchantId
- The id that identifies the merchant (comes from the props file)pAmount
- Amount of money to return or debit (REQUIRED)pCurrency
- Type of currency, currently usd | cad | frf.(REQUIRED)pTransId
- The transaction id returned from auth or debit, to be used
for debit or creditpRequestToken
- The request token returned from auth or debit, to be used
for debit or credit
com.cybersource.ics.base.exception.ICSException
public CreditCardStatus performAuthORCredit(CreditCardInfo ccinfo, java.lang.String pCommand) throws com.cybersource.ics.base.exception.ICSException
com.cybersource.ics.base.exception.ICSException
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic java.lang.String toString()
toString
in class java.lang.Object
protected void addPaymentId(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addMerchantId(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addCurrencyCode(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addBillingAddress(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
addressRequiresState
and addressRequiresPostalCode
methods in the subclass.
CyberSourceException
protected void addContactInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addCreditCardInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void modifyCreditCardInfo4digits(com.cybersource.ics.client.message.ICSClientRequest pRequest, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addAmount(com.cybersource.ics.client.message.ICSClientRequest pRequest, com.cybersource.ics.client.message.ICSClientOffer pOffer, CreditCardInfo pInfo) throws CyberSourceException
CyberSourceException
protected void addSecurityCode(com.cybersource.ics.client.message.ICSClientRequest pRequest, com.cybersource.ics.client.message.ICSClientOffer pOffer, CreditCardInfo pInfo, java.lang.String pCommand) throws CyberSourceException
CyberSourceException
protected void addExtendedInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, com.cybersource.ics.client.message.ICSClientOffer pOffer, CreditCardInfo pInfo, java.lang.String pCommand) throws CyberSourceException
pCommand>
will be set to
CMD_AUTHORIZE
,
CMD_CAPTURE
, or CMD_RETURN
depending on the
operation being performed. Subclasses can test this value if they have to
add different extended information to the request for different operations.
CyberSourceException
protected boolean addressRequiresState(CreditCardInfo pInfo)
state
property. By default this returns true if the billing
address's country is US or CA, and false otherwise.
protected boolean addressRequiresPostalCode(CreditCardInfo pInfo)
postalCode
property. By default this returns true if the billing
address's country is US or CA, and false otherwise.
public CreditCardStatus decreaseAuthorization(CreditCardInfo pCreditCardInfo, PaymentStatus pAuthStatus)
This implementation does nothing but return a successful CreditCardStatus object.
Extend this method to do any cyber source credit card specific processing.
decreaseAuthorization
in interface atg.payment.creditcard.DecreaseCreditCardAuthorizationProcessor
pCreditCardInfo
- the CreditCardInfo reference which contains all the credit data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |