com.ibm.etill.ldbcardcassette
Class LdbCardCredit

com.ibm.etill.ldbcardcassette.LdbCardCredit

public final class LdbCardCredit
implements LdbCardConstants

The cassette credit object is responsible for performing all the cassette's credit requests (Refund, RefundReversal) and to manage the state of the framework credit object.


Field Summary
private static java.lang.String COPYRIGHT
           
private  java.lang.String objApprovalCode
          This cassette credit attribute contains the approval code.
private  java.lang.String objDeclineReason
          This cassette credit attribute contains the decline reason.
private  com.ibm.etill.framework.payapi.Credit objFrameworkCredit
          This cassette credit attribute contains the reference back to the associated framework credit object.
 
Fields inherited from interface com.ibm.etill.ldbcardcassette.LdbCardConstants
ACC_ACCOUNT, ACC_CLOSE_TIME, ACC_CURRENCY, ACC_LDBCARD_ID, ACC_MAX_BATCH_SIZE, ACC_MERCHANT, ACC_MIN_BATCH_TOTAL, ACC_PASSWORD, ACC_URL, ACC_USER, BAT_APPROVAL, BAT_BATCH, BAT_CLOSED_TO_TRANS, BAT_MERCHANT, BAT_REASON, CASSETTE_NAME, COL_ACCOUNT, COL_ADDRESS, COL_AMOUNT, COL_APPROVAL, COL_BATCH, COL_BRAND, COL_CLOSE_TIME, COL_CLOSED_TO_TRANS, COL_CREDIT, COL_CURRENCY, COL_EXPIRY, COL_LDBCARD_ID, COL_MAX_BATCH_SIZE, COL_MERCHANT, COL_MERCHANT_NAME, COL_MIN_BATCH_TOTAL, COL_ORDER, COL_PAN, COL_PASSWORD, COL_PAYMENT, COL_POSTAL_CODE, COL_REASON, COL_URL, COL_USER, CRE_APPROVAL, CRE_CREDIT, CRE_MERCHANT, CRE_ORDER, CRE_REASON, MSG_ACCOUNT_CREATE_ROW_FAILURE, MSG_ACCOUNT_CREATE_SQL_FAILURE, MSG_ACCOUNT_DELETE_ROW_FAILURE, MSG_ACCOUNT_DELETE_SQL_FAILURE, MSG_ACCOUNT_ICV_CMD_FAILURE, MSG_ACCOUNT_ICV_FAILURE, MSG_ACCOUNT_MORE_THAN_ONE_BATCH, MSG_ACCOUNT_MULTIPLE_ACCOUNTS, MSG_ACCOUNT_NULL_BATCH_CLOSE_TIME, MSG_ACCOUNT_NULL_BATCH_NUMBER, MSG_ACCOUNT_NULL_MAX_BATCH_SIZE, MSG_ACCOUNT_NULL_MIN_BATCH_TOTAL, MSG_ACCOUNT_SELECT_CLOSE_FAILURE, MSG_ACCOUNT_SELECT_SQL_FAILURE, MSG_ACCOUNT_UPDATE_ROW_FAILURE, MSG_ACCOUNT_UPDATE_SQL_FAILURE, MSG_BATCH_AUTO_CLOSE_FAILURE, MSG_BATCH_BAD_ADD_CREDIT_STATE, MSG_BATCH_BAD_ADD_PAYMENT_STATE, MSG_BATCH_BAD_BATCH_IN_CREDIT, MSG_BATCH_BAD_BATCH_IN_PAYMENT, MSG_BATCH_CLOSE_WORK_ITEM_FAILURE, MSG_BATCH_CREATE_ROW_FAILURE, MSG_BATCH_CREATE_SQL_FAILURE, MSG_BATCH_CREDIT_RETRIEVAL_FAILURE, MSG_BATCH_DELETE_ROW_FAILURE, MSG_BATCH_DELETE_SQL_FAILURE, MSG_BATCH_DEPOSIT_REVERSAL_FAILURE, MSG_BATCH_NULL_CREDIT, MSG_BATCH_NULL_ORDER_FOR_CREDIT, MSG_BATCH_NULL_ORDER_FOR_PAYMENT, MSG_BATCH_NULL_PAYMENT, MSG_BATCH_PAYMENT_RETRIEVAL_FAILURE, MSG_BATCH_REFUND_REVERSAL_FAILURE, MSG_BATCH_SELECT_BATCH_MISSING, MSG_BATCH_SELECT_CLOSE_FAILURE, MSG_BATCH_SELECT_ROW_FAILURE, MSG_BATCH_SELECT_SQL_FAILURE, MSG_BATCH_TIMER_WORK_ITEM_FAILURE, MSG_BATCH_UPDATE_ROW_FAILURE, MSG_BATCH_UPDATE_SQL_FAILURE, MSG_CASSETTE_BUNDLE_ID_MISMATCH, MSG_CASSETTE_HAS_STARTED, MSG_CASSETTE_HAS_STOPPED, MSG_CASSETTE_METHOD_NOT_IMPLEMENTED, MSG_CREDIT_CLOSE_STATE_ERROR, MSG_CREDIT_CREATE_ROW_FAILURE, MSG_CREDIT_CREATE_SQL_FAILURE, MSG_CREDIT_DELETE_ROW_FAILURE, MSG_CREDIT_DELETE_SQL_FAILURE, MSG_CREDIT_SELECT_CLOSE_FAILURE, MSG_CREDIT_SELECT_CREDIT_MISSING, MSG_CREDIT_SELECT_ROW_FAILURE, MSG_CREDIT_SELECT_SQL_FAILURE, MSG_CREDIT_UPDATE_ROW_FAILURE, MSG_CREDIT_UPDATE_SQL_FAILURE, MSG_ORDER_CLOSE_CREDIT_STATE_ERROR, MSG_ORDER_CLOSE_PAYMENT_STATE_ERROR, MSG_ORDER_CREATE_ROW_FAILURE, MSG_ORDER_CREATE_SQL_FAILURE, MSG_ORDER_DELETE_ROW_FAILURE, MSG_ORDER_DELETE_SQL_FAILURE, MSG_ORDER_SELECT_CLOSE_FAILURE, MSG_ORDER_SELECT_ORDER_MISSING, MSG_ORDER_SELECT_ROW_FAILURE, MSG_ORDER_SELECT_SQL_FAILURE, MSG_ORDER_UPDATE_ROW_FAILURE, MSG_ORDER_UPDATE_SQL_FAILURE, MSG_PAYMENT_CLOSE_STATE_ERROR, MSG_PAYMENT_CREATE_ROW_FAILURE, MSG_PAYMENT_CREATE_SQL_FAILURE, MSG_PAYMENT_DELETE_ROW_FAILURE, MSG_PAYMENT_DELETE_SQL_FAILURE, MSG_PAYMENT_SELECT_CLOSE_FAILURE, MSG_PAYMENT_SELECT_PAYMENT_MISSING, MSG_PAYMENT_SELECT_ROW_FAILURE, MSG_PAYMENT_SELECT_SQL_FAILURE, MSG_PAYMENT_UPDATE_ROW_FAILURE, MSG_PAYMENT_UPDATE_SQL_FAILURE, MSG_QUERY_ACC_SELECT_SQL_FAILURE, MSG_QUERY_BAT_SELECT_SQL_FAILURE, MSG_QUERY_CRE_SELECT_SQL_FAILURE, MSG_QUERY_ORD_SELECT_SQL_FAILURE, MSG_QUERY_PAY_SELECT_SQL_FAILURE, ORD_ACCOUNT, ORD_ADDRESS, ORD_AMOUNT, ORD_BRAND, ORD_EXPIRY, ORD_MERCHANT, ORD_ORDER, ORD_PAN, ORD_POSTAL_CODE, PAY_APPROVAL, PAY_MERCHANT, PAY_ORDER, PAY_PAYMENT, PAY_REASON, PAYMENT_TYPE, PD_ACC_BATCH_CLOSE_TIME, PD_ACC_CURRENCY, PD_ACC_LDBCARDID, PD_ACC_MAX_BATCH_SIZE, PD_ACC_MIN_BATCH_TOTAL, PD_ACC_PASSWORD, PD_ACC_URL, PD_ACC_USER, PD_PAY_B_CITY, PD_PAY_B_COUNTRYCOD, PD_PAY_B_COUNTRYCODE, PD_PAY_B_POSTALCODE, PD_PAY_B_STATEPROV, PD_PAY_B_STATEPROVINCE, PD_PAY_B_STREETADDR, PD_PAY_B_STREETADDRESS, PD_PAY_BRAND, PD_PAY_CARDHOLDERNAME, PD_PAY_CITY, PD_PAY_COUNTRYCODE, PD_PAY_EXPIRY, PD_PAY_PAN, PD_PAY_POSTALCODE, PD_PAY_STATEPROV, PD_PAY_STATEPROVINCE, PD_PAY_STREETADDR, PD_PAY_STREETADDRESS, RB_ID, SRC_ACCOUNT_CREATE_ROW_FAILURE, SRC_ACCOUNT_CREATE_SQL_FAILURE, SRC_ACCOUNT_DELETE_ROW_FAILURE, SRC_ACCOUNT_DELETE_SQL_FAILURE, SRC_ACCOUNT_ICV_FAILURE, SRC_ACCOUNT_MORE_THAN_ONE_BATCH, SRC_ACCOUNT_NULL_BATCH_CLOSE_TIME, SRC_ACCOUNT_NULL_BATCH_NUMBER, SRC_ACCOUNT_NULL_MAX_BATCH_SIZE, SRC_ACCOUNT_NULL_MIN_BATCH_TOTAL, SRC_ACCOUNT_SELECT_CLOSE_FAILURE, SRC_ACCOUNT_SELECT_SQL_FAILURE, SRC_ACCOUNT_UPDATE_ROW_FAILURE, SRC_ACCOUNT_UPDATE_SQL_FAILURE, SRC_BATCH_BAD_ADD_CREDIT_STATE, SRC_BATCH_BAD_ADD_PAYMENT_STATE, SRC_BATCH_BAD_BATCH_IN_CREDIT, SRC_BATCH_BAD_BATCH_IN_PAYMENT, SRC_BATCH_CLOSE_WORK_ITEM_FAILURE, SRC_BATCH_CREATE_ROW_FAILURE, SRC_BATCH_CREATE_SQL_FAILURE, SRC_BATCH_DELETE_ROW_FAILURE, SRC_BATCH_DELETE_SQL_FAILURE, SRC_BATCH_NULL_CREDIT, SRC_BATCH_NULL_ORDER_FOR_CREDIT, SRC_BATCH_NULL_ORDER_FOR_PAYMENT, SRC_BATCH_NULL_PAYMENT, SRC_BATCH_PURGE_INCOMPLETE, SRC_BATCH_SELECT_BATCH_MISSING, SRC_BATCH_SELECT_CLOSE_FAILURE, SRC_BATCH_SELECT_ROW_FAILURE, SRC_BATCH_SELECT_SQL_FAILURE, SRC_BATCH_TIMER_WORK_ITEM_FAILURE, SRC_BATCH_UPDATE_ROW_FAILURE, SRC_BATCH_UPDATE_SQL_FAILURE, SRC_CASSETTE_BATCH_CLOSE_TIME, SRC_CASSETTE_BUNDLE_ID_MISMATCH, SRC_CASSETTE_CARDHOLDERNAME, SRC_CASSETTE_CURRENCY, SRC_CASSETTE_LDBCARDID, SRC_CASSETTE_LDBCARDRMIURL, SRC_CASSETTE_MAX_BATCH_SIZE, SRC_CASSETTE_MIN_BATCH_TOTAL, SRC_CASSETTE_PASSWORD, SRC_CASSETTE_USER, SRC_CREDIT_CREATE_ROW_FAILURE, SRC_CREDIT_CREATE_SQL_FAILURE, SRC_CREDIT_DELETE_ROW_FAILURE, SRC_CREDIT_DELETE_SQL_FAILURE, SRC_CREDIT_SELECT_CLOSE_FAILURE, SRC_CREDIT_SELECT_CREDIT_MISSING, SRC_CREDIT_SELECT_ROW_FAILURE, SRC_CREDIT_SELECT_SQL_FAILURE, SRC_CREDIT_UPDATE_ROW_FAILURE, SRC_CREDIT_UPDATE_SQL_FAILURE, SRC_METHOD_NOT_IMPLEMENTED, SRC_ORDER_CREATE_ROW_FAILURE, SRC_ORDER_CREATE_SQL_FAILURE, SRC_ORDER_DELETE_ROW_FAILURE, SRC_ORDER_DELETE_SQL_FAILURE, SRC_ORDER_SELECT_CLOSE_FAILURE, SRC_ORDER_SELECT_ORDER_MISSING, SRC_ORDER_SELECT_ROW_FAILURE, SRC_ORDER_SELECT_SQL_FAILURE, SRC_ORDER_UPDATE_ROW_FAILURE, SRC_ORDER_UPDATE_SQL_FAILURE, SRC_PAYMENT_CREATE_ROW_FAILURE, SRC_PAYMENT_CREATE_SQL_FAILURE, SRC_PAYMENT_DELETE_ROW_FAILURE, SRC_PAYMENT_DELETE_SQL_FAILURE, SRC_PAYMENT_SELECT_CLOSE_FAILURE, SRC_PAYMENT_SELECT_PAYMENT_MISSING, SRC_PAYMENT_SELECT_ROW_FAILURE, SRC_PAYMENT_SELECT_SQL_FAILURE, SRC_PAYMENT_UPDATE_ROW_FAILURE, SRC_PAYMENT_UPDATE_SQL_FAILURE, SRC_QUERY_ACC_SELECT_SQL_FAILURE, SRC_QUERY_BAT_SELECT_SQL_FAILURE, SRC_QUERY_CRE_SELECT_SQL_FAILURE, SRC_QUERY_ORD_SELECT_SQL_FAILURE, SRC_QUERY_PAY_SELECT_SQL_FAILURE, TBL_ACCOUNT, TBL_BATCH, TBL_CREDIT, TBL_ORDER, TBL_PAYMENT, TRACE_ID, VIEW_ACCOUNT, VIEW_ACCOUNTS, VIEW_ADDRESS, VIEW_AMOUNT, VIEW_APPROVAL, VIEW_BATCH, VIEW_BATCH_CREDITS, VIEW_BATCH_PAYMENTS, VIEW_BATCHES, VIEW_BRAND, VIEW_CLOSE_TIME, VIEW_CLOSED_TO_TRANS, VIEW_CREDIT, VIEW_CREDITS, VIEW_CURRENCY, VIEW_EXPIRY, VIEW_LDBCARD_ID, VIEW_MAX_BATCH_SIZE, VIEW_MERCHANT, VIEW_MERCHANT_NAME, VIEW_MIN_BATCH_TOTAL, VIEW_ORDER, VIEW_ORDERS, VIEW_PAN, VIEW_PASSWORD, VIEW_PAYMENT, VIEW_PAYMENTS, VIEW_POSTAL_CODE, VIEW_REASON, VIEW_URL, VIEW_USER, XDM_ACCOUNT, XDM_ADDRESS, XDM_AMOUNT, XDM_APPROVAL, XDM_BRAND, XDM_CLOSE_TIME, XDM_CLOSED_TO_TRANS, XDM_CURRENCY, XDM_EXPIRY, XDM_LDBCARD_ID, XDM_MAX_BATCH_SIZE, XDM_MIN_BATCH_TOTAL, XDM_PAN, XDM_PASSWORD, XDM_POSTAL_CODE, XDM_REASON, XDM_URL, XDM_USER
 
Constructor Summary
LdbCardCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
          This constructor initializes an existing cassette credit object.
LdbCardCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This constructor initializes a new cassette credit object.
 
Method Summary
 void closeCredit()
          This method is used by the cassette order object when it is asked to close a credit for a closing batch.
 void createRecord(java.sql.Connection argConnection)
          This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's create list.
 void deleteRecord(java.sql.Connection argConnection)
          This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's delete list.
 java.lang.String getApproval()
          This method is used to obtain the current approval code.
 com.ibm.etill.framework.payapi.Credit getFrameworkCredit()
          This method is used to obtain the framework's credit object.
 java.lang.String getReason()
          This method is used to obtain the current reason code.
 void refund(com.ibm.etill.framework.cassette.RefundRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the order object when it is asked to service a Refund request.
 void refundReversal(com.ibm.etill.framework.cassette.RefundReversalRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the order object when it is asked to service a RefundReversal request.
 void resetTransaction()
          This method is called by the framework when the merchant attempts to Refund a credit that has previously been declined.
private  void resurrectCredit()
          This method is used by the cassette object to resurrect an existing cassette credit from the cassette credit database table.
 void setApproval(java.lang.String argApprovalCode)
          This method is used to set the approval code for this credit.
 void setReason(java.lang.String argDeclineReason)
          This method is used to set the decline reason for this credit.
 void updateRecord(java.sql.Connection argConnection)
          This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's update list.
 

Field Detail

COPYRIGHT

private static final java.lang.String COPYRIGHT

objFrameworkCredit

private com.ibm.etill.framework.payapi.Credit objFrameworkCredit
This cassette credit attribute contains the reference back to the associated framework credit object.

objApprovalCode

private java.lang.String objApprovalCode
This cassette credit attribute contains the approval code. The approval code is supplied by the payment engine when a credit transaction is successfully created and is used in subsequent payment engine requests (like void) to reference this credit.

objDeclineReason

private java.lang.String objDeclineReason
This cassette credit attribute contains the decline reason. The decline reason, originally small and therefore cryptic, was designed to be displayed on a card swipe terminal at a point of sale terminal. In this cassette, it provides detailed information about the cause of the failure. (Since the text is provided by the financial network, different for each network, and not standardized in any way, it is impossible to translate these text strings into return codes.)
Constructor Detail

LdbCardCredit

public LdbCardCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit,
                     com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
This constructor initializes a new cassette credit object. A reference to the associated framework's credit object is set.
Parameters:
argFrameworkCredit - - The framework's credit object.
argProtocolData - - The protocol data parameter values provided by the merchant system.

LdbCardCredit

public LdbCardCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
              throws com.ibm.etill.framework.payapi.ETillAbortOperation
This constructor initializes an existing cassette credit object. A reference to the associated framework's credit object is set and the remaining attributes are resurrected from the cassette's credit database table.
Parameters:
argFrameworkCredit - - The framework's credit object.
Throws:
ETillAbortOperation - - any failure results in this exception.
Method Detail

resetTransaction

public void resetTransaction()
This method is called by the framework when the merchant attempts to Refund a credit that has previously been declined. Usually an Refund creates a new credit. In this case, the creidt exists and must be reset to its initial state so that the Refund can be attempted again.

resurrectCredit

private void resurrectCredit()
                      throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette object to resurrect an existing cassette credit from the cassette credit database table.

This method is not part of the Archivable interface. The methods for the Archivable interface are passed a JDBC database connection for the operation. In this case, an ETillArchive object is constructed to provide a JDBC databaes connection.

Throws:
ETillAbortOperation - - any failure results in this exception.

createRecord

public void createRecord(java.sql.Connection argConnection)
                  throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's create list.
Parameters:
argConnection - - The JDBC database connection to be used for this operation.
Throws:
ETillAbortOperation - - any failure results in this exception.

updateRecord

public void updateRecord(java.sql.Connection argConnection)
                  throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's update list.
Parameters:
argConnection - - The JDBC database connection to be used for this operation.
Throws:
ETillAbortOperation - - any failure results in this exception.

deleteRecord

public void deleteRecord(java.sql.Connection argConnection)
                  throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework order (a commitable object) when its commit() method discovers the cassette credit object on the framework order's delete list.
Parameters:
argConnection - - The JDBC database connection to be used for this operation.
Throws:
ETillAbortOperation - - any failure results in this exception.

refund

public void refund(com.ibm.etill.framework.cassette.RefundRequest argRequest,
                   com.ibm.etill.framework.cassette.APIResponse argResponse)
            throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the order object when it is asked to service a Refund request.

For this cassette, the account object is used to authorize the credit. The framework credit object's state is updated and return codes are placed in the provided response object.

Parameters:
argRequest - - An Credit order request.
argResponse - - The response object to hold the result.
Throws:
ETillAbortOperation - - any failure results in this exception.

refundReversal

public void refundReversal(com.ibm.etill.framework.cassette.RefundReversalRequest argRequest,
                           com.ibm.etill.framework.cassette.APIResponse argResponse)
                    throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the order object when it is asked to service a RefundReversal request.

For this cassette, the account object is used to void the credit. The framework credit object's state is updated and return codes are placed in the provided response object.

Parameters:
argRequest - - A RefundReversal order request.
argResponse - - The response object to hold the result.
Throws:
ETillAbortOperation - - any failure results in this exception.

closeCredit

public void closeCredit()
This method is used by the cassette order object when it is asked to close a credit for a closing batch.

getApproval

public java.lang.String getApproval()
This method is used to obtain the current approval code.
Returns:
- The approval code returned by the payment engine.

getFrameworkCredit

public com.ibm.etill.framework.payapi.Credit getFrameworkCredit()
This method is used to obtain the framework's credit object.
Returns:
- The framework's credit object for this credit.

getReason

public java.lang.String getReason()
This method is used to obtain the current reason code.
Returns:
- The reason code (usually a text message) returned by the payment engine when a transaction is declined.

setApproval

public void setApproval(java.lang.String argApprovalCode)
This method is used to set the approval code for this credit.
Parameters:
argApprovalCode - - The approval code returned by the payment engine.

setReason

public void setReason(java.lang.String argDeclineReason)
This method is used to set the decline reason for this credit.
Parameters:
argDeclineReason - - The decline reason returned by the payment engine.