com.ibm.etill.ldbcardcassette
Class LdbCardCassette

com.ibm.etill.ldbcardcassette.LdbCardCassette

public final class LdbCardCassette
implements LdbCardConstants

The Cassette object is responsible for managing the cassettes resources within the framework. The framework uses Cassette methods for initialization, creating new objects, resurrecting existing objects from the database, and for servicing merchant requests.

In many cases the Cassette object uses other objects to perform its responsiblities. For example, AcceptPayment requests are sent to the cassette's Order object for processing.


Inner Class Summary
static class LdbCardCassette.LuhnStringValidationItem
          This class converts a parameter's value from a byte array into a string and then validates that the result passes the Luhn check.
 
Field Summary
private static java.util.Hashtable clsValidationTable
          This cassette class attribute contains the hashtable that defines the validation parameters for cassette dependent protocol data.
private static java.lang.String COPYRIGHT
           
 
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
LdbCardCassette()
          This constructor is used by the framework during initialization.
 
Method Summary
(package private) static void ()
           
 java.util.Vector createComPoints()
          This method is used by the framework during initialization.
 com.ibm.etill.framework.cassette.ProtocolRequest createProtocolRequest(com.ibm.etill.framework.io.ETillConnection argConnection)
          This method is called by the framework when a ComPoint object receives a new message.
 void destroyComPoints()
          This method is used by the framework when the cassette is stopped.
 java.util.Hashtable getParameterValidationTable()
          This method is used by the framework to obtain a hashtable that contains an element for each cassette dependent protocol data keyword that is to be validated and converted into the proper] data type by the framework before it is passed to the cassette in a parameter table.
 void initializeCassette()
          This method is used by the framework during initialization.
 com.ibm.etill.framework.cassette.CassetteBatch newCassetteBatch(com.ibm.etill.framework.payapi.Batch argFrameworkBatch, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This method is called by the framework when an OpenBatch request is received.
 com.ibm.etill.framework.cassette.CassetteTransaction newCassetteCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This method is called by the framework when a Refund request is received.
 com.ibm.etill.framework.cassette.CassetteOrder newCassetteOrder(com.ibm.etill.framework.payapi.Order argFrameworkOrder, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This method is called by the framework when an ReceivePayment or AcceptPayment request is received.
 com.ibm.etill.framework.cassette.CassetteTransaction newCassettePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment, com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
          This method is called by the framework when an Approve request is received.
private  void processAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette object to process any administration requests.
 void readCassetteConfig()
          This method is used by the framework during initialization.
 com.ibm.etill.framework.cassette.CassetteBatch resurrectCassetteBatch(com.ibm.etill.framework.payapi.Batch argFrameworkBatch)
          This method is called by the framework when a request is received for a batch that has not been found in the cache.
 com.ibm.etill.framework.cassette.CassetteTransaction resurrectCassetteCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
          This method is called by the framework when a request is received for a credit that has not been found in the cache.
 com.ibm.etill.framework.cassette.CassetteOrder resurrectCassetteOrder(com.ibm.etill.framework.payapi.Order argFrameworkOrder)
          This method is called by the framework when a request is received for an order that has not been found in the cache.
 com.ibm.etill.framework.cassette.CassetteTransaction resurrectCassettePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
          This method is called by the framework when a request is received for a payment that has not been found in the cache.
 void service(com.ibm.etill.framework.cassette.CassetteRequest argRequest, com.ibm.etill.framework.cassette.CassetteResponse argResponse)
          This method is called by the framework to service administration requests, order requests, batch requests, and protocol requests.
private  void serviceAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette object to service administration requests.
 void setMessageID(java.lang.String argId)
          This method is used by the framework to give the cassette its resource bundle identifier.
 void shutdown()
          This method is called by the framework when a the cassette is being stopped.
 void start()
          This method is used by the framework during initialization.
private  void traceParameters(com.ibm.etill.framework.cassette.CassetteRequest argRequest)
          This method is used by the cassette to trace the protocol data keywords and values that were passed to the cassette.
private  void validateAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse)
          This method is used by the cassette object to validate the cassette dependent data for any administration request.
 void verifyConfig()
          This method is used by the framework during initialization.
 

Field Detail

COPYRIGHT

private static final java.lang.String COPYRIGHT

clsValidationTable

private static final java.util.Hashtable clsValidationTable
This cassette class attribute contains the hashtable that defines the validation parameters for cassette dependent protocol data. This hashtable is initialized in a static block.
Constructor Detail

LdbCardCassette

public LdbCardCassette()
This constructor is used by the framework during initialization. Since the class is loaded dynamically, the no-argument constructor is always used.

NOTE: The framework has not initialized the cassette when this constructor is called. This method cannot issue trace, log, or database commands at this point. All cassette initialization should be performed in subsequent initialization calls.

Method Detail

static void ()

setMessageID

public void setMessageID(java.lang.String argId)
This method is used by the framework to give the cassette its resource bundle identifier. Although this method is maintained for compatibilty reasons, it is no longer required. Payment Manager 2.1 now uses a string to reference the resource bundle and the string is always set to the cassette name. Since this cassette assumes that its classes are all final, the cassette name is a constant, so it simply makes an assertion test to make sure that the resource bundle loaded by the framework is the same as the resource bundle constant used in the cassette.

The resource bundle for the cassette is automatically loaded by the framework before any other initialization is attempted. The name of the resource bundle is derived from the payment type defined for the cassette. For example, if you are implementing a cassette for payment type Xxxx, you must supply a default property file of the form Xxxx.properties. Additional property files can be provided for national languages other than your default language whenever required, without affecting any Java code in your package. See the JavaDoc for java.util.ResourceBundle for more information.

Parameters:
argResourceBundleId - - an integer, assigned by the framework, that represents the resource bundle that has been loaded for this cassette.

readCassetteConfig

public void readCassetteConfig()
                        throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework during initialization. The cassette must read its configuration and throw an exception if a failure occurs.

For this cassette, the account class reads the configuration and constructs an account object for each row in the account configuration table.

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

verifyConfig

public void verifyConfig()
                  throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework during initialization. It is called after a successful call to readCassetteConfig(). The cassette must perform any verification that cannot be done when the configuration was read. For example, this method would verify that related configuration objects are consistent.

For this cassette, the cassette uses its account class to verify that the configuration is correct.

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

initializeCassette

public void initializeCassette()
                        throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework during initialization. It is called after a successful call to verifyConfig(). The cassette must complete the remaining initialization for any objects created from the configuration.

For this cassette, the cassette has each account object initialize.

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

createComPoints

public java.util.Vector createComPoints()
                                 throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework during initialization. It is called after a successful call to initializeCassette(). The cassette must return a vector of ComPoint objects used to service I/O connections (TCP/IP connections to the payment engine, for example). ComPoint objects are required for asynchronous communication. The frame work builds a thread pool for each ComPoint object. When data is received, a thread is assigned to process the data flow.

For this cassette, the data exchange between the cassette and the payment engine is synchronous. The thread processing the merchant request is held while waiting for a response from the payment engine. ComPoint objects are not used, so an empty Vector is returned.

Returns:
- A vector of ComPoint objects used to service cassette I/O connections (TCP/IP connections to the payment engine, for example).
Throws:
ETillAbortOperation - - any failure results in this exception.

start

public void start()
This method is used by the framework during initialization. It is called after a successful call to createComPoints(). This is the cassette's last opportunity to perform initialization before merchant requests will be processed. Typically cassettes use this opportunity to recover or restart any operation that was in progress when the framework shut down.

For this cassette, all the payment operations are synchronous. If the framework is shutdown in the middle of a transaction, it is as if the transaction was never performed. The merchant never receives confirmation and retries the operation. Therefore this method merely logs a message indicating that initializtion is complete.


getParameterValidationTable

public java.util.Hashtable getParameterValidationTable()
This method is used by the framework to obtain a hashtable that contains an element for each cassette dependent protocol data keyword that is to be validated and converted into the proper] data type by the framework before it is passed to the cassette in a parameter table. Each element in the table has a key that contains the protocol data keyword as a String and a value that contains some subclass of the frameworks ParameterValidationItem class.
Returns:
A hashtable that contains an element for every cassette dependent protocol data keyword to be validated and converted automatically by the framework.

newCassetteOrder

public com.ibm.etill.framework.cassette.CassetteOrder newCassetteOrder(com.ibm.etill.framework.payapi.Order argFrameworkOrder,
                                                                       com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
                                                                throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when an ReceivePayment or AcceptPayment request is received. The cassette must construct a new cassette order object and return it to the framework.

For this cassette, a cassette order object is constructed and returned.

Parameters:
argFrameworkOrder - - a framework order object constructed by the framework for a ReceivePayment or AcceptPayment request.
argProtocolData - - a hashtable containing the protocol data values specified by the merchant.
Returns:
- a new cassette order object.
Throws:
ETillAbortOperation - - any failure results in this exception.

resurrectCassetteOrder

public com.ibm.etill.framework.cassette.CassetteOrder resurrectCassetteOrder(com.ibm.etill.framework.payapi.Order argFrameworkOrder)
                                                                      throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a request is received for an order that has not been found in the cache. The cassette must resurrect its matching order object from the information previously recorded in the cassette order database table and return the result to the framework.

For this cassette, a new cassette order is constructed using the constructor that resurrects the order. This method reads the correct row from the cassette's order table and initializes the object with the values found there.

Parameters:
argFrameworkOrder - - a framework order object that has been resurrected from the ETORDER database table.
Returns:
- a cassette order object that has been initialized from the cassette order database table.
Throws:
ETillAbortOperation - - any failure results in this exception.

newCassettePayment

public com.ibm.etill.framework.cassette.CassetteTransaction newCassettePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment,
                                                                               com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
                                                                        throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when an Approve request is received. The cassette must construct a new cassette payment object and return it to the framework.

For this cassette, a cassette payment object is constructed and returned.

Parameters:
argFrameworkPayment - - a framework payment object constructed by the framework for an Approve request.
argProtocolData - - a hashtable containing the protocol data values specified by the merchant.
Returns:
- a new cassette payment object.
Throws:
ETillAbortOperation - - any failure results in this exception.

resurrectCassettePayment

public com.ibm.etill.framework.cassette.CassetteTransaction resurrectCassettePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
                                                                              throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a request is received for a payment that has not been found in the cache. The cassette must resurrect its matching payment object from the information previously recorded in the cassette payment database table and return the result to the framework.

For this cassette, a new cassette payment is constructed using the constructor that resurrects the payment. This method reads the correct row from the cassette's payment table and initializes the object with the values found there.

Parameters:
argFrameworkPayment - - a framework payment object that has been resurrected from the ETPAYMENT database table.
Returns:
- a cassette payment object that has been initialized from the cassette payment database table.
Throws:
ETillAbortOperation - - any failure results in this exception.

newCassetteCredit

public com.ibm.etill.framework.cassette.CassetteTransaction newCassetteCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit,
                                                                              com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
                                                                       throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a Refund request is received. The cassette must construct a new cassette credit object and return it to the framework.

For this cassette, a cassette credit object is constructed and returned.

Parameters:
argFrameworkCredit - - a framework credit object constructed the framework for a new Refund request.
argProtocolData - - a hashtable containing the protocol data values specified by the merchant.
Returns:
- a new cassette credit object.
Throws:
ETillAbortOperation - - any failure results in this exception.

resurrectCassetteCredit

public com.ibm.etill.framework.cassette.CassetteTransaction resurrectCassetteCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
                                                                             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a request is received for a credit that has not been found in the cache. The cassette must resurrect its matching credit object from the information previously recorded in the cassette credit database table and return the result to the framework.

For this cassette, a new cassette credit is constructed using the constructor that resurrects the credit. This method reads the correct row from the cassette's credit table and initializes the object with the values found there.

Parameters:
argFrameworkCredit - - a framework credit object that has been resurrected from the ETCREDIT database table.
Returns:
- a cassette credit object that has been initialized from the cassette credit database table.
Throws:
ETillAbortOperation - - any failure results in this exception.

newCassetteBatch

public com.ibm.etill.framework.cassette.CassetteBatch newCassetteBatch(com.ibm.etill.framework.payapi.Batch argFrameworkBatch,
                                                                       com.ibm.etill.framework.payapi.ParameterTable argProtocolData)
                                                                throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when an OpenBatch request is received. The cassette must contruct a new cassette batch object and return it to the framework.

For this cassette, a cassette batch object is constructed and returned.

Parameters:
argFrameworkBatch - - a framework batch object constructed by the framework for a BatchOpen request.
argProtocolData - - a hashtable containing the protocol data values specified by the merchant.
Returns:
- a new cassette batch object.
Throws:
ETillAbortOperation - - any failure results in this exception.

resurrectCassetteBatch

public com.ibm.etill.framework.cassette.CassetteBatch resurrectCassetteBatch(com.ibm.etill.framework.payapi.Batch argFrameworkBatch)
                                                                      throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a request is received for a batch that has not been found in the cache. The cassette must resurrect its matching batch object from the information previously recorded in the cassette batch database table and return the result to the framework.

For this cassette, a new cassette batch is constructed using the constructor that resurrects the batch. This method reads the correct row from the cassette's batch table and initializes the object with the values found there.

Parameters:
argFrameworkBatch - - a framework batch object that has been resurrected from the ETBATCH database table.
Returns:
- a cassette batch object that has been initialized from the cassette batch database table.
Throws:
ETillAbortOperation - - any failure results in this exception.

createProtocolRequest

public com.ibm.etill.framework.cassette.ProtocolRequest createProtocolRequest(com.ibm.etill.framework.io.ETillConnection argConnection)
                                                                       throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework when a ComPoint object receives a new message. The cassette must use the connection argument to receive and parse the message and create the appropriate ProtocolRequest object for the message received. The framework will call the cassette's service() method passing the returned ProtocolRequest object as an argument.

For this cassette, the cassette operations are always synchronous and ComPoints are never used. Therefore, if the framework calls this method, a serious defect is indicated and the cassette cannot continue.

Parameters:
argConnection - - The connection for the ComPoint that has received the new message.
Returns:
- The new ProtocolRequest that contains the relevant data, parsed from the new message, to be sent to the cassette for processing.
Throws:
ETillAbortOperation - - any failure results in this exception.

destroyComPoints

public void destroyComPoints()
                      throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the framework when the cassette is stopped. It is the first call the framework makes to the cassette during this sequence; it is called before the STOP_REQUEST is passed to the service method. A cassette uses this opportunity to destroy all the ComPoint objects that were build during initialization.

For this cassette, ComPoint objects are not used so there is nothing to do but return sucessfully.

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

shutdown

public void shutdown()
This method is called by the framework when a the cassette is being stopped. This is the cassette's last opportunity to save any intermediate results that will be recovered when the Payment Manager is restarted.

For this cassette, the cassette operations are all synchronous and nothing needs to be saved. It merely logs a message to indicate that the cassette has terminated.


service

public void service(com.ibm.etill.framework.cassette.CassetteRequest argRequest,
                    com.ibm.etill.framework.cassette.CassetteResponse argResponse)
             throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is called by the framework to service administration requests, order requests, batch requests, and protocol requests. The cassette must determine the request type and route the request to the correct object to be serviced.

For this cassette, the cassette examines the type of the request using the instanceof operator. Administration requests are sent to the object affected by the request. Order requests are sent to the matching method in the cassette's order object. Batch requests are sent to the matching method in the cassette's batch object. Any unrecognized requests (like protocol requests, for example) will result in an exception.

Parameters:
argRequest - - the request object to be serviced
argResponse - - the response object to be updated with the result of the service
Throws:
ETillAbortOperation - - any failure results in this exception.

traceParameters

private void traceParameters(com.ibm.etill.framework.cassette.CassetteRequest argRequest)
This method is used by the cassette to trace the protocol data keywords and values that were passed to the cassette. Framework keywords and values are expected to be traced by the framework.

Only keywords recognized by this cassette are included in the trace. Furthermore, password values are not displayed and all but the first 4 and last 4 characters of the PAN are obscured for security reasons.

Parameters:
argRequest - - The request containing protocol data to be traced.

serviceAdminRequest

private void serviceAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest,
                                 com.ibm.etill.framework.cassette.APIResponse argResponse)
                          throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette object to service administration requests. There are two cases:
  1. The framework has asked the cassette to validate the cassette dependent parameters before it starts its own administration processing
  2. The framework has asked the cassette to process the administration request and commit the resources affected.

In other words, there are two cassette calls for every administration request, one to validate the parameters and one to perform the request.

For this cassette, this method checks to see if the request is in validation mode and calls the correct method based on the result.

Parameters:
argRequest - - the administration request to be serviced.
argResponse - - the response object to be updated with the result of the service
Throws:
ETillAbortOperation - - any failure results in this exception.

validateAdminRequest

private void validateAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest,
                                  com.ibm.etill.framework.cassette.APIResponse argResponse)
                           throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette object to validate the cassette dependent data for any administration request.

For this cassette, there are only two administration requests that could carry cassette dependent data:

  1. Create Account
  2. Modify Account.
Parameters:
argRequest - - the administration request to be validated.
argResponse - - the response object to be updated with the result of the service
Throws:
ETillAbortOperation - - any failure results in this exception.

processAdminRequest

private void processAdminRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest,
                                 com.ibm.etill.framework.cassette.APIResponse argResponse)
                          throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method is used by the cassette object to process any administration requests.

For this cassette, there are only five administration requests that require special processing:

  1. Create Account
  2. Modify Account
  3. Delete Account
  4. Start Account
  5. Stop Account.
Parameters:
argRequest - - the administration request to be processed.
argResponse - - the response object to be updated with the result of the service.
Throws:
ETillAbortOperation - - any failure results in this exception.