com.ibm.etill.ldbcardcassette
Class LdbCardOrder

com.ibm.etill.ldbcardcassette.LdbCardOrder

public final class LdbCardOrder
implements LdbCardConstants

The cassette order object is responsible for recording all the relevent protocol data passed when the order is created, managing the state of the framework object, and routing all the order requests.


Field Summary
private static java.lang.String COPYRIGHT
           
private  LdbCardAccount objAccount
          This cassette order attribute contains the reference to the cassette account object that will be used to perform transactions for this order.
private  java.lang.String objAddress
          This cassette order attribute contains the shopper's street address (used for address verification systems).
private  int objAmount
          This cassette order attribute contains the running total of all approved payments associated with this order.
private  java.lang.String objBrand
          This cassette order attribute contains the brand name of the shopper's card.
private  LdbCardCassette objCassette
          This cassette order attribute contains the reference back to the cassette that owns the order.
private  java.lang.String objExpiry
          This cassette order attribute contains the expiration date of the shopper's card in YYYYMM format.
private  com.ibm.etill.framework.payapi.Order objFrameworkOrder
          This cassette order attribute contains the reference back to the associated framework order object.
private  java.lang.String objPan
          This cassette order attribute contains the shopper's personal account number (also known as the credit/debit card number).
private  java.lang.String objPostalCode
          This cassette order attribute contains the shopper's postal code (used for address verification systems).
 
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
LdbCardOrder(LdbCardCassette argCassette, com.ibm.etill.framework.payapi.Order argFrameworkOrder)
          This constructor initializes an existing cassette order object by resurrecting its attributes from the cassette's order database table.
LdbCardOrder(LdbCardCassette argCassette, com.ibm.etill.framework.payapi.Order argFrameworkOrder, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This constructor initializes a new cassette order object using attributes passed by the merchant as protocol data.
 
Method Summary
 void acceptPayment(com.ibm.etill.framework.cassette.AcceptPaymentRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service an AcceptPayment request.
 java.lang.String accountNumber()
          This method is used to obtain the account number for the account that will process the order's payments and credits.
 void approve(com.ibm.etill.framework.cassette.ApproveRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service an Approve request.
 void approveReversal(com.ibm.etill.framework.cassette.ApproveReversalRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service an ApproveReversal request.
 short batchRequired()
          The method is used by the framework to determine if a batch ID is required on a Deposit or Refund request.
 void cancelOrder(com.ibm.etill.framework.cassette.CancelOrderRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service a CancelOrder request.
 com.ibm.etill.framework.cassette.Cassette cassette()
          This method is used to obtain the cassette object for the cassette that owns this order.
 void closeCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
          This method is used by the cassette batch when it is asked to close an open batch.
 void closeOrder(com.ibm.etill.framework.cassette.CloseOrderRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service a CloseOrder request.
 void closePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
          This method is used by the cassette batch when it is asked to close an open 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 order 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 order object on the framework order's delete list.
 void deposit(com.ibm.etill.framework.cassette.DepositRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service a Deposit request.
 void depositReversal(com.ibm.etill.framework.cassette.DepositReversalRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service a DepositReversal request.
 LdbCardAccount getAccount()
          This method is used to obtain the account object that is used to process transactions for this order.
 java.lang.String getAccountNumber()
          This method is used to obtain the account number that is used to process transactions for this order.
 java.lang.String getAddress()
          This method is used to obtain the shopper's street address.
 int getAmount()
          This method is used to obtain the current approved amount.
 java.lang.String getBrand()
          This method is used to obtain the brand of the shopper's credit card number.
 java.lang.String getExpiry()
          This method is used to obtain the expiration data of the shopper's credit card.
 java.lang.String getObscurePan()
          This method is used to obtain the shopper's credit card number when it will be displayed in a trace.
 java.lang.String getPan()
          This method is used to obtain the shopper's credit card number
 java.lang.String getPostalCode()
          This method is used to obtain the shopper's postal code.
private  boolean isCancelOrderAllowed()
          This method is used to determine if a CancelOrder command is allowed.
private  boolean isCloseOrderAllowed()
          This method is used to determine if a CloseOrder command is allowed.
 void receivePayment(com.ibm.etill.framework.cassette.ReceivePaymentRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette when it is asked to service a ReceivePayment request.
 void refund(com.ibm.etill.framework.cassette.RefundRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette 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 cassette when it is asked to service a RefundReversal request.
private  void resurrectOrder()
          This method is used by the cassette order object to resurrect an existing cassette order from the cassette order database table.
 void setAccount(java.lang.String argMerchant, java.lang.String argAccountNumber)
          This method is used to find and set the cassette account object that will be used to process the transactions for this order.
 void setAddress(java.lang.String argAddress)
          This method is used to set the shopper's street address.
 void setAmount(int argAmount)
          This method is used to set total approved payment amount.
 void setBrand(java.lang.String argBrand)
          This method is used to set the brand of the shopper's credit card.
 void setExpiry(java.lang.String argExpiry)
          This method is used to set the expiration data of the shopper's credit card.
 void setPan(java.lang.String argPan)
          This method is used to set the shopper's credit card number
 void setPostalCode(java.lang.String argPostalCode)
          This method is used to set the shopper's postal code.
 void updateRecord(java.sql.Connection argConnection)
          This method is used by the framework order (a commitable object) when its commit() method discovers the cassette order object on the framework order's update list.
 

Field Detail

COPYRIGHT

private static final java.lang.String COPYRIGHT

objCassette

private LdbCardCassette objCassette
This cassette order attribute contains the reference back to the cassette that owns the order.

objFrameworkOrder

private com.ibm.etill.framework.payapi.Order objFrameworkOrder
This cassette order attribute contains the reference back to the associated framework order object.

objAccount

private LdbCardAccount objAccount
This cassette order attribute contains the reference to the cassette account object that will be used to perform transactions for this order.

objAmount

private int objAmount
This cassette order attribute contains the running total of all approved payments associated with this order. Note that this is a convience attribute since the amount could also be obtained by examining each payment in this order's payment list.

objPan

private java.lang.String objPan
This cassette order attribute contains the shopper's personal account number (also known as the credit/debit card number).

objExpiry

private java.lang.String objExpiry
This cassette order attribute contains the expiration date of the shopper's card in YYYYMM format.

objBrand

private java.lang.String objBrand
This cassette order attribute contains the brand name of the shopper's card.

objAddress

private java.lang.String objAddress
This cassette order attribute contains the shopper's street address (used for address verification systems).

objPostalCode

private java.lang.String objPostalCode
This cassette order attribute contains the shopper's postal code (used for address verification systems).
Constructor Detail

LdbCardOrder

public LdbCardOrder(LdbCardCassette argCassette,
                    com.ibm.etill.framework.payapi.Order argFrameworkOrder,
                    com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This constructor initializes a new cassette order object using attributes passed by the merchant as protocol data.
Parameters:
argCassette - - The cassette that owns the order.
argFrameworkOrder - - The framework's order object.
argProtocolData - - The protocol data parameter values provided by the merchant system.
Throws:
ETillAbortOperation - - any failure results in this exception.

LdbCardOrder

public LdbCardOrder(LdbCardCassette argCassette,
                    com.ibm.etill.framework.payapi.Order argFrameworkOrder)
             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This constructor initializes an existing cassette order object by resurrecting its attributes from the cassette's order database table.
Parameters:
argCassette - - The cassette that owns the order.
argFrameworkOrder - - The framework's order object.
Throws:
ETillAbortOperation - - any failure results in this exception.
Method Detail

cassette

public com.ibm.etill.framework.cassette.Cassette cassette()
This method is used to obtain the cassette object for the cassette that owns this order.
Returns:
- The cassette object for the cassette that owns this order

accountNumber

public java.lang.String accountNumber()
This method is used to obtain the account number for the account that will process the order's payments and credits.
Returns:
- The account number for the account that will process this order's payments and credits.

batchRequired

public short batchRequired()
The method is used by the framework to determine if a batch ID is required on a Deposit or Refund request.

For this cassette, 0 (False) is returned in all cases. By definition there is only one open batch for each account so there is no need for the merchant to choose a batch with a batch ID.

Returns:
1 (True) if a batch ID is required on Deposit and Refund requests; 0 (False) otherwise.

resurrectOrder

private void resurrectOrder()
                     throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette order object to resurrect an existing cassette order from the cassette order 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 order 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 order 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 order 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.

receivePayment

public void receivePayment(com.ibm.etill.framework.cassette.ReceivePaymentRequest argRequest,
                           com.ibm.etill.framework.cassette.APIResponse argResponse)
                    throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service a ReceivePayment request.

For this cassette, the payment engine does not support shopper interaction to obtain payment information after the order is created. The operation is always aborted.

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

acceptPayment

public void acceptPayment(com.ibm.etill.framework.cassette.AcceptPaymentRequest argRequest,
                          com.ibm.etill.framework.cassette.APIResponse argResponse)
                   throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service an AcceptPayment request.

For this cassette, required and optional protocol data values have already been saved by the constructor. This method peforms the state checks, assignes an account to process subsequent financial requests, updates the framework order's state, and adds the framework order to the current commit point. In an automatic approval has been requested, it is performed.

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

approve

public void approve(com.ibm.etill.framework.cassette.ApproveRequest argRequest,
                    com.ibm.etill.framework.cassette.APIResponse argResponse)
             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service an Approve request.

For this cassette, the cassette order object knows that the cassette payment object is responsible for performing the approval. The framework's payment object is found in the request. The cassette's payment object is obtained and its approve() method is called.

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

approveReversal

public void approveReversal(com.ibm.etill.framework.cassette.ApproveReversalRequest argRequest,
                            com.ibm.etill.framework.cassette.APIResponse argResponse)
                     throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service an ApproveReversal request.

For this cassette, the cassette order object knows that the cassette payment object is responsible for performing the reversal. The framework's payment object is found in the request. The cassette's payment object is obtained and its approveReversal() method is called.

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

deposit

public void deposit(com.ibm.etill.framework.cassette.DepositRequest argRequest,
                    com.ibm.etill.framework.cassette.APIResponse argResponse)
             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service a Deposit request.

For this cassette, the cassette order object knows that the cassette payment object is responsible for performing the deposit. The framework's payment object is found in the request. The cassette's payment object is obtained and its deposit() method is called.

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

depositReversal

public void depositReversal(com.ibm.etill.framework.cassette.DepositReversalRequest argRequest,
                            com.ibm.etill.framework.cassette.APIResponse argResponse)
                     throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service a DepositReversal request.

For this cassette, the cassette order object knows that the cassette payment object is responsible for performing the reversal. The framework's payment object is found in the request. The cassette's payment object is obtained and its depositReversal() method is called.

Parameters:
argRequest - - A DepositReversal order request.
argResponse - - The response object to hold the result.
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 cassette when it is asked to service a Refund request.

For this cassette, the cassette order object knows that the cassette credit object is responsible for performing the refund. The framework's credit object is found in the request. The cassette's credit object is obtained and its refund() method is called.

Parameters:
argRequest - - A Refund 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 cassette when it is asked to service a RefundReversal request.

For this cassette, the cassette order object knows that the cassette credit object is responsible for performing the reversal. The framework's credit object is found in the request. The cassette's credit object is obtained and its refundReversal() method is called.

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

closeOrder

public void closeOrder(com.ibm.etill.framework.cassette.CloseOrderRequest argRequest,
                       com.ibm.etill.framework.cassette.APIResponse argResponse)
                throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service a CloseOrder request.

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

isCloseOrderAllowed

private boolean isCloseOrderAllowed()
This method is used to determine if a CloseOrder command is allowed. By definition, a CloseOrder is allowed if there are no active payments or credits.

Note: At the time of this implementation, this definition is contrary to the definition in the programmer's guide. The programmer's guide contains a much stricter definition: "You can invoke the CLOSEORDER command when there is at least one payment or credit in Closed state [and there are no active payments or credits]." I cannot justify this definition. If this definition is used, a merchant who is pruning their orders would need to issue a CloseOrder for every order that contains a closed payment or credit and a CancelOrder for everything else. Imagine the complicated code required to choose which verb should be issued for hundreds of orders. When compared to this complication, the feeble attempt to prevent a merchant from closing an order too soon by requiring a closed payment or credit seems pointless. The active transaction check is both necessary and sufficient. In the near future, the definition will be changed.

Returns:
True if a CloseOrder command is allowed, false otherwise.

cancelOrder

public void cancelOrder(com.ibm.etill.framework.cassette.CancelOrderRequest argRequest,
                        com.ibm.etill.framework.cassette.APIResponse argResponse)
                 throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette when it is asked to service a CancelOrder request.

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

isCancelOrderAllowed

private boolean isCancelOrderAllowed()
This method is used to determine if a CancelOrder command is allowed. By definition, a CancelOrder is allowed if there are no active payements or credits.
Returns:
True if a CancelOrder command is allowed, false otherwise.

closePayment

public void closePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
This method is used by the cassette batch when it is asked to close an open batch. It is called for every payment found in the open batch.

Parameters:
argFrameworkPayment - - A framework payment to be closed.

closeCredit

public void closeCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
This method is used by the cassette batch when it is asked to close an open batch. It is called for every credit found in the open batch.

Parameters:
argFrameworkCredit - - A framework credit to be closed.

getAccount

public LdbCardAccount getAccount()
This method is used to obtain the account object that is used to process transactions for this order.
Returns:
- The cassette account object that is used to process transactions for this order.

getAccountNumber

public java.lang.String getAccountNumber()
This method is used to obtain the account number that is used to process transactions for this order.
Returns:
- The account number of the account that is used to process transactions for this order.

getAmount

public int getAmount()
This method is used to obtain the current approved amount.
Returns:
- The current approved amount.

getPan

public java.lang.String getPan()
This method is used to obtain the shopper's credit card number
Returns:
- The shopper's credit card number.

getObscurePan

public java.lang.String getObscurePan()
This method is used to obtain the shopper's credit card number when it will be displayed in a trace.
Returns:
- A string with all but the first 4 and the last 4 characters masked.

getBrand

public java.lang.String getBrand()
This method is used to obtain the brand of the shopper's credit card number.
Returns:
- The brand of the shopper's credit card

getExpiry

public java.lang.String getExpiry()
This method is used to obtain the expiration data of the shopper's credit card. Note that this data is in the framework format: YYYYMM. In this case, the first two characters must be removed before it can be sent to the payment engine.
Returns:
- The expiration data of the shopper's credit card.

getAddress

public java.lang.String getAddress()
This method is used to obtain the shopper's street address. In this case, the payment engine only uses the street address and the postal code. Other address verifcation parameters are ignored.
Returns:
- The shopper's street address.

getPostalCode

public java.lang.String getPostalCode()
This method is used to obtain the shopper's postal code.
Returns:
- The shopper's postal code.

setAccount

public void setAccount(java.lang.String argMerchant,
                       java.lang.String argAccountNumber)
This method is used to find and set the cassette account object that will be used to process the transactions for this order. Note that the cassette account's retrieveAccount() method is used to find the account object.
Parameters:
argMerchant - - The merchant number of the account that will be used to process this order.
argAccountNumber - - The account number of the account that will be used to process this order.

setAmount

public void setAmount(int argAmount)
This method is used to set total approved payment amount.
Parameters:
argAmount - - The total approved amount.

setPan

public void setPan(java.lang.String argPan)
This method is used to set the shopper's credit card number
Parameters:
argPan - - The shopper's credit card number.

setBrand

public void setBrand(java.lang.String argBrand)
This method is used to set the brand of the shopper's credit card.
Parameters:
argBrand - - The brand of the shopper's credit card.

setExpiry

public void setExpiry(java.lang.String argExpiry)
This method is used to set the expiration data of the shopper's credit card. Note that the data is saved in framework format: YYYYMM. In this case, the first two characters must be removed before it can be sent to the payment engine.
Parameters:
argExpiry - - The expiration data of the shopper's credit card.

setAddress

public void setAddress(java.lang.String argAddress)
This method is used to set the shopper's street address.
Parameters:
argAddress - - The shopper's street address.

setPostalCode

public void setPostalCode(java.lang.String argPostalCode)
This method is used to set the shopper's postal code.
Parameters:
argPostalCode - - The shopper's postal code.