|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.integrations.cybercash.CyberCashConnection
public class CyberCashConnection
This class manages the communications to a CyberCash payment server.
Currently only credit card transactions are supported, no cybercash coins, checks or Microsoft Wallet support.
All information on the CyberCash communication protocol was acquired from: CashRegister Service -- Merchant Connection Kit Guide version 3.2 CashRegister Service -- Development Guide version 1.1
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static java.lang.String |
CMD_AUTH_CAPTURE
Authorize and charge a credit card. |
static java.lang.String |
CMD_AUTHORIZE
Authorize a credit card, does not charge. |
static java.lang.String |
CMD_CAPTURE
Charge a credit card that has been authorized. |
static java.lang.String |
CMD_QUERY
Check the local state of an order, this is only useful to see if/how a transaction completed. |
static java.lang.String |
CMD_RETRY
Retry a transaction that is in the pending state, as indeicated in query. |
static java.lang.String |
CMD_RETURN
Return money to a card holder that has been charged. |
static java.lang.String |
CMD_VOID
Void any transaction. |
static java.lang.String |
CURRENCY_US_DOLLARS
United States Dollars. |
static int |
INITIAL_REQUEST_SIZE
A guess at how big a request buffer needs to be, reduces StringBuffers resizings, hopefully. |
static java.lang.String |
KEY_AVS_CODE
The key for the avs status code |
static java.lang.String |
KEY_CASH_AMOUNT
The key for the amount of money to apply this transaction to. |
static java.lang.String |
KEY_CC_ACT_CODE
The key for the credit card action code. |
static java.lang.String |
KEY_CC_ADDRESS
The key for the address on the credit card, everything not city, state, zip, country, or name. |
static java.lang.String |
KEY_CC_AMOUNT
The amount to apply to the transaction, be it authorize,return... |
static java.lang.String |
KEY_CC_AUTH_CODE
The key for the credit card authorization code. |
static java.lang.String |
KEY_CC_CITY
The key for the city on the credit card billing address. |
static java.lang.String |
KEY_CC_COUNTRY
The key for the country on the credit card billing address. |
static java.lang.String |
KEY_CC_EXPIRE
The key for the credit card expiration date, MM/YY. |
static java.lang.String |
KEY_CC_NAME
The key for the name on the credit card billing address. |
static java.lang.String |
KEY_CC_NUMBER
The key for the credit card number. |
static java.lang.String |
KEY_CC_STATE
The key for the state on the credit card billing address. |
static java.lang.String |
KEY_CC_TYPE
The key for the credit card type. |
static java.lang.String |
KEY_CC_ZIP
The key for the zip on the credit card billing address. |
static java.lang.String |
KEY_ERROR_CODE
The key for error code. |
static java.lang.String |
KEY_ERROR_MSG
The key for error message. |
static java.lang.String |
KEY_ERROR_MSG_PROC
The key for our processing error message. |
static java.lang.String |
KEY_LOCATION
The key for raw error location data. |
static java.lang.String |
KEY_ORDER_ID
The key for the order id that the command is applied to. |
static java.lang.String |
KEY_REF_CODE
The key for the Retrieval reference number. |
static java.lang.String |
KEY_STATUS
The key for raw status data. |
static java.lang.String |
KEY_TOTAL
|
static java.lang.String |
KEY_TRANS_TYPE
The key for the type of transaction. |
static java.lang.String |
KEY_TRANSACTION_ID
The key for the transaction id from the CyberCash gateway. |
java.lang.String |
mCc3ConfigFile
Configuration file containing name=value pair info |
static java.lang.String |
mResourceBundle
|
atg.payment.Message |
msg
|
static java.lang.String |
TRANSACTION_CAPTURE
A value for KEY_TRANS_TYPE. |
static java.lang.String |
TRANSACTION_MARKED
A value for KEY_TRANS_TYPE; for terminal capture |
static java.lang.String |
TRANSACTION_MARKRET
A value for KEY_TRANS_TYPE; for terminal capture |
static java.lang.String |
TRANSACTION_RETURN
A value for KEY_TRANS_TYPE; for host capture |
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 | |
---|---|
CyberCashConnection()
Constructs a null CyberCashConnection. |
Method Summary | |
---|---|
CreditCardStatus |
authorize(CreditCardInfo ccinfo)
Authorize the amount on the credit card |
float |
convertToUSD(float pAmount,
java.lang.String pCurrency)
This function is used to convert from non USD currency to USD currency. |
CreditCardStatus |
credit(CreditCardInfo ccinfo)
Credit when no previous debit exists (a new order) |
CreditCardStatus |
credit(CreditCardInfo ccinfo,
CreditCardStatus pStatus)
Credit after the capture (debit) was processed |
CreditCardStatus |
debit(CreditCardInfo ccinfo,
CreditCardStatus pStatus)
Capture the amount after the authorization was processed |
CreditCardStatus |
decreaseAuthorization(CreditCardInfo pCreditCardInfo,
PaymentStatus pAuthStatus)
Decreases the authorized amount for the credit card. |
void |
doStartService()
Initialize data structures when service is started. |
java.lang.String |
getCc3ConfigFile()
Gets configuration file name. |
static void |
main(java.lang.String[] args)
|
CreditCardStatus |
performAuthORCredit(CreditCardInfo ccinfo,
java.lang.String pCommand)
Implements the functionality to CreditCardProcessor Interface This wraps a call to sendCommand with an authorize or credit command. |
CreditCardStatus |
performDebitORCredit(CreditCardInfo ccinfo,
java.lang.String pCommand)
Implements the functionality to CreditCardProcessor Interface This wraps a call to sendCommand with a capture or return. |
CyberCashStatus |
processError(java.lang.String pKey,
java.lang.String pMessage,
double totald)
|
protected CreditCardStatus |
sendCommand(java.lang.String pCommand,
java.util.Dictionary pParams,
double totald)
This is the primary interface to CyberCash CashRegister. |
void |
setCc3ConfigFile(java.lang.String pCc3ConfigFile)
Sets configuration file name. |
java.lang.String |
toString()
|
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 final java.lang.String CLASS_VERSION
public static final java.lang.String KEY_STATUS
public static final java.lang.String KEY_LOCATION
public static final java.lang.String KEY_ERROR_MSG
public static final java.lang.String KEY_ERROR_MSG_PROC
public static final java.lang.String KEY_ERROR_CODE
public static final java.lang.String KEY_TRANSACTION_ID
public static final java.lang.String KEY_AVS_CODE
public static final java.lang.String KEY_TOTAL
public static final java.lang.String KEY_ORDER_ID
public static final java.lang.String KEY_CC_TYPE
public static final java.lang.String KEY_CC_NUMBER
public static final java.lang.String KEY_CC_EXPIRE
public static final java.lang.String KEY_CC_AMOUNT
public static final java.lang.String KEY_CC_NAME
public static final java.lang.String KEY_CC_ADDRESS
public static final java.lang.String KEY_CC_CITY
public static final java.lang.String KEY_CC_ZIP
public static final java.lang.String KEY_CC_STATE
public static final java.lang.String KEY_CC_COUNTRY
public static final java.lang.String KEY_CC_AUTH_CODE
public static final java.lang.String KEY_CC_ACT_CODE
public static final java.lang.String KEY_REF_CODE
public static final java.lang.String KEY_CASH_AMOUNT
public static final java.lang.String KEY_TRANS_TYPE
public static final java.lang.String TRANSACTION_CAPTURE
public static final java.lang.String TRANSACTION_MARKED
public static final java.lang.String TRANSACTION_RETURN
public static final java.lang.String TRANSACTION_MARKRET
public static final java.lang.String CMD_AUTHORIZE
public static final java.lang.String CMD_AUTH_CAPTURE
public static final java.lang.String CMD_CAPTURE
public static final java.lang.String CMD_VOID
public static final java.lang.String CMD_RETURN
public static final java.lang.String CMD_QUERY
public static final java.lang.String CMD_RETRY
public static final java.lang.String CURRENCY_US_DOLLARS
public static final int INITIAL_REQUEST_SIZE
public static java.lang.String mResourceBundle
public atg.payment.Message msg
public java.lang.String mCc3ConfigFile
Constructor Detail |
---|
public CyberCashConnection()
Method Detail |
---|
public void setCc3ConfigFile(java.lang.String pCc3ConfigFile)
public java.lang.String getCc3ConfigFile()
public float convertToUSD(float pAmount, java.lang.String pCurrency)
pAmount
- The amount of the order.pCurrency
- The currency code of the order.
This currently is a dummy call, which returns what is passed in. The user needs to override this.
public CreditCardStatus credit(CreditCardInfo ccinfo, CreditCardStatus pStatus)
credit
in interface CreditCardProcessor
ccinfo
- The credit card data and customer informationpStatus
- The status object from a previous billing call
public CreditCardStatus credit(CreditCardInfo ccinfo)
credit
in interface CreditCardProcessor
ccinfo
- The credit card data and customer information
public CreditCardStatus debit(CreditCardInfo ccinfo, CreditCardStatus pStatus)
debit
in interface CreditCardProcessor
ccinfo
- The credit card data and customer informationpStatus
- The status object from a previous authorization call
public CreditCardStatus authorize(CreditCardInfo ccinfo)
authorize
in interface CreditCardProcessor
ccinfo
- The credit card data and customer information
public CreditCardStatus performAuthORCredit(CreditCardInfo ccinfo, java.lang.String pCommand) throws CyberCashException
pPaymentId
- Arbitrary string associated with order.(REQUIRED)pAmount
- Amount of money to authorize or credit(REQUIRED)pCardNumber
- Credit card to operate on.(REQUIRED)pExpires
- When card expires, time and day are ignored.(REQUIRED)pCurrency
- Type of currency, currently usd | cad | frf.(REQUIRED)pName
- Name on CC.(OPTIONAL)pAddress
- Billing address.(OPTIONAL)pCity
- Billing city.(OPTIONAL)pState
- Billing state.(OPTIONAL)pZip
- Billing zip.(OPTIONAL)pCountry
- Billing country(OPTIONAL)
CyberCashException
public CreditCardStatus performDebitORCredit(CreditCardInfo ccinfo, java.lang.String pCommand) throws CyberCashException
NOTE: The entire amount of the charge does not need to be returned.
pPaymentId
- The orderid of the order this is a return or debit for.(REQUIRED)pAmount
- Amount of money to debit or credit.(REQUIRED)pCurrency
- Type of currency, currently usd | cad | frf.(REQUIRED)
CyberCashException
protected CreditCardStatus sendCommand(java.lang.String pCommand, java.util.Dictionary pParams, double totald) throws CyberCashException
pCommand
- The CyberCash command to be sent to CashRegister.pParams
- The parameter set to be sent along with the CyberCash command.
CyberCashException
public java.lang.String toString()
toString
in class java.lang.Object
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if something went wrongpublic CyberCashStatus processError(java.lang.String pKey, java.lang.String pMessage, double totald)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public CreditCardStatus decreaseAuthorization(CreditCardInfo pCreditCardInfo, PaymentStatus pAuthStatus)
This implementation does nothing but return a successful CreditCardStatus object.
Extend this method to do any cyber cash 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 |