|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.etill.ldbcardcassette.LdbCardAccount
The Account object is responsible for managing the relationship between the merchant and the payment engine. It uses the cassette's account configuration table to create account objects and verifies that the configuration is syntactically and semantically correct. It is responsible for making connections to the payment engine and exchanging data between the cassette and the payment engine.
Field Summary | |
private static java.util.Hashtable |
clsAccountList
This Hashtable contains the entire list of all the merchant accounts. |
private static java.lang.String |
COPYRIGHT
|
private static java.lang.String |
ICV_KEY_ACCOUNT
Constants for core engine parameter keys. |
private static java.lang.String |
ICV_KEY_ADDRESS
|
private static java.lang.String |
ICV_KEY_AMOUNT
|
private static java.lang.String |
ICV_KEY_APPROVAL
|
private static java.lang.String |
ICV_KEY_CLERK
|
private static java.lang.String |
ICV_KEY_COMMENT
|
private static java.lang.String |
ICV_KEY_EXPIRY
|
private static java.lang.String |
ICV_KEY_REASON
|
private static java.lang.String |
ICV_KEY_STATUS
|
private static java.lang.String |
ICV_KEY_TYPE
|
private static java.lang.String |
ICV_KEY_ZIP_CODE
|
private static java.lang.String |
ICV_ORDER_PREFIX
Constants to wrap the framework order numbers for the core engine. |
private static java.lang.String |
ICV_ORDER_SEPARATOR
|
private static java.lang.String |
ICV_ORDER_SUFFIX
|
private static java.lang.String |
ICV_VAL_APPROVED
Constants for core engine status values. |
private static java.lang.String |
ICV_VAL_BOOK
Constants for core engine parameter values. |
private static java.lang.String |
ICV_VAL_CREDIT
|
private static java.lang.String |
ICV_VAL_SETTLE
|
private static java.lang.String |
ICV_VAL_SHIP
|
private static java.lang.String |
ICV_VAL_VOID
|
private static java.lang.String |
ICV_VAL_VOID_C
|
private java.lang.String |
objAccount
This account attribute contains the account number. |
private java.lang.Integer |
objBatchCloseTime
This account attribute contains the time of day when the cassette should automatically close any open batch. |
private netverify.remote.client.Connection |
objConnection
This account attribute contains the connection to the RMI server used by this account. |
private java.lang.String |
objCurrency
This account attribute contains the ISO currency code supported by this account. |
private double |
objDoubleExp10
This account attribute contains the exponent on 10 used to position the decimal point in integer currency values. |
private java.lang.String |
objExp10
This account attribute contains the exponent on 10 used to position the decimal point in integer currency values. |
private java.text.NumberFormat |
objFormatter
This account attribute contains a number formatter configured to convert currency values into strings. |
private com.ibm.etill.framework.admin.AccountAdmin |
objFrameworkAccount
This account attribute contains a reference to the frameworks account object. |
private java.lang.String |
objLdbCardId
This account attribute contains the merchant's identifier in the payment engine. |
private java.lang.Integer |
objMaxBatchSize
This account attribute contains the maximum batch size for batches that use this account. |
private java.lang.String |
objMerchant
This account attribute contains the merchant number. |
private java.lang.Integer |
objMinBatchTotal
This account attribute contains the minimum batch total for batches that are closed automatically at a particular time of day. |
private java.lang.String |
objPassword
This account attribute contains the password used to authenticate the accounts user. |
private java.lang.String |
objUrl
This account attribute contains the universal resource locator for the RMI server used by this account. |
private java.lang.String |
objUser
This account attribute contains the ID of the user authorized to connect to this account's RMI server. |
Constructor Summary | |
|
LdbCardAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This constructor is used by the cassette when the framework asks it to service an adminitration request that creates a new account. |
protected |
LdbCardAccount(java.sql.ResultSet argResultSet)
This method constructs a new account object and initializes the object's data from the current row of the supplied ResultSet. |
Method Summary | |
private void |
addAccountToList()
This method is used to add a new account to the list of accounts kept by the account class. |
boolean |
authorizePayment(LdbCardPayment argCassettePayment)
This method is used by the payment object whenever it needs to authorize a payment. |
boolean |
captureCredit(LdbCardCredit argCassetteCredit)
This method is used by the credit object whenever it needs to capture a credit in the batch. |
boolean |
capturePayment(LdbCardPayment argCassettePayment,
int argAmount)
This method is used by the payment object whenever it needs to capture a payment in the batch. |
private void |
connect()
This method constructs a Connection object used to communicate with the payment engine. |
private java.lang.String |
convertAmount(int argAmount)
This method is used to convert a framework amount into a string that is acceptable to the payment engine. |
void |
createRecord(java.sql.Connection argConnection)
This method is used by the framework thread (a commitable object) when its commit() method discovers the cassette account object on the framework thread create list. |
void |
deleteAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when the framework asks it to service an adminitration request that deletes an existing account. |
void |
deleteRecord(java.sql.Connection argConnection)
This method is used by the framework thread (a commitable object) when its commit() method discovers the cassette account object on the framework thread delete list. |
private void |
disconnect()
This method destroys a Connection object used to communicate with the payment engine. |
java.lang.String |
getAccountNumber()
This method is used to get the account number of this account. |
int |
getBatchCloseTime()
This method is used to get the time of day, specified in minutes after midnight, when this account's open batches should be automatically closed by the cassette. |
java.lang.Integer |
getBatchCloseTimeObject()
This method is used to get an object that represents the time of day (specified in minutes after midnight) when this account's open batches will be automatically closed. |
java.lang.String |
getCurrency()
This method is used to get the ISO currency code used by this account. |
java.lang.String |
getLdbCardId()
This method is used to get the identifier configured in the the payment engine. |
int |
getMaxBatchSize()
This method is used to get maximum batch size allowed for this account's batches. |
java.lang.Integer |
getMaxBatchSizeObject()
This method is used to get an object that represents the maximum batch size for this account's batches. |
java.lang.String |
getMerchant()
This method is used to get the merchant number of this account. |
int |
getMinBatchTotal()
This method is used to get minimum batch size allowed when the batch is closed automatically. |
java.lang.Integer |
getMinBatchTotalObject()
This method is used to get an object that represents the minimum batch size for batches are that automatically closed at a given time of day. |
java.lang.String |
getObscurePassword()
This method is used to get the password necessary to authenticate the user ID when the password will be displayed in a trace. |
java.lang.String |
getPassword()
This method is used to get the password necessary to authenticate the user ID. |
java.lang.String |
getUrl()
This method is used to get the URL used to locate the Java RMI server for the payment engine. |
java.lang.String |
getUser()
This method is used to get the user ID used for the Java RMI connection. |
private void |
initializeAccount()
This method is used by all constructors to initialize the number formatter used to convert integer ammounts into strings and to add new accounts to the list of accounts kept by the account class. |
static void |
initializeAccounts()
This method is used by the cassette when the framework asks the cassette to initialize. |
boolean |
isBatchCloseTimeConfigured()
This method is used to determine if the administrator has configured the account to automatically close an open batch at a specified time of day. |
boolean |
isMaxBatchSizeConfigured()
This method is used to determine if the administrator has configured the account to automatically close an open batch when that batch reaches a specified size. |
boolean |
isMinBatchTotalConfigured()
This method is used to determine if the administrator has configured a minimum batch size for a batch that is closed at a specified time of day. |
void |
modifyAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when the framework asks it to service an adminitration request that modifies an existing account. |
static void |
resurrectAccounts()
This method is called by the cassette when the framework asks the cassette to read its configuration. |
static LdbCardAccount |
retrieveAccount(java.lang.String argMerchant)
This method is used by the cassette when the framework requests an account object. |
private com.ibm.etill.framework.payapi.Batch |
retrieveBatch(com.ibm.etill.framework.payapi.Transaction argFrameworkTransaction)
This method is used by payment objects to obtain the batch object that currently contains the payment. |
void |
retrieveBatchAndRemoveCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
This method is used by credit objects while processing a RefundReversal command. |
void |
retrieveBatchAndRemovePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
This method is used by payment objects while processing a DepositReversal command. |
private com.ibm.etill.framework.payapi.Batch |
selectBatch()
This method is used by payment objects to obtain the batch object that will contain the payment when the payment is deposited. |
void |
selectBatchAndAddCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit)
This method is used by credit objects while processing a Refund command. |
void |
selectBatchAndAddPayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment)
This method is used by payment objects while processing a Deposit command. |
boolean |
settleBatch(LdbCardBatch argCassetteBatch)
This method is used by the batch object whenever it needs to settle a batch. |
void |
startAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when the framework asks it to service an adminitration request that starts an existing account. |
void |
stopAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when the framework asks it to service an adminitration request that stops an existing account. |
java.lang.String |
toString()
This method is used to obtain a string of the object's indentifiers in a form suitable for Trace.trace(). |
void |
updateRecord(java.sql.Connection argConnection)
This method is used by the framework thread (a commitable object) when its commit() method discovers the cassette account object on the framework thread update list. |
static void |
validateCreateRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when validating an adminstration request to create a new account object. |
static void |
validateModifyRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest,
com.ibm.etill.framework.cassette.APIResponse argResponse)
This method is used by the cassette when validating an adminstration request to modify an existing account object. |
static boolean |
verifyAccounts()
This method is used by the cassette when the framework asks the cassette to verify the configuration. |
boolean |
voidCredit(LdbCardCredit argCassetteCredit)
This method is used by the credit object whenever it needs to void a credit. |
boolean |
voidPayment(LdbCardPayment argCassettePayment,
int argAmount)
This method is used by the payment object whenever it needs to void a payment. |
Field Detail |
private static final java.lang.String COPYRIGHT
private static final java.lang.String ICV_KEY_ACCOUNT
These keys are used when passing key/value pairs to the payment engine.
private static final java.lang.String ICV_KEY_ADDRESS
private static final java.lang.String ICV_KEY_AMOUNT
private static final java.lang.String ICV_KEY_APPROVAL
private static final java.lang.String ICV_KEY_CLERK
private static final java.lang.String ICV_KEY_COMMENT
private static final java.lang.String ICV_KEY_EXPIRY
private static final java.lang.String ICV_KEY_REASON
private static final java.lang.String ICV_KEY_STATUS
private static final java.lang.String ICV_KEY_TYPE
private static final java.lang.String ICV_KEY_ZIP_CODE
private static final java.lang.String ICV_VAL_APPROVED
These values are returned when when you get the status from a transaction statement that has been executed.
private static final java.lang.String ICV_VAL_BOOK
These values are define for the TransactionType key.
private static final java.lang.String ICV_VAL_CREDIT
private static final java.lang.String ICV_VAL_SETTLE
private static final java.lang.String ICV_VAL_SHIP
private static final java.lang.String ICV_VAL_VOID
private static final java.lang.String ICV_VAL_VOID_C
private static final java.lang.String ICV_ORDER_PREFIX
By using the following tags, the framework order number
is recorded in the database. The value has the form
private static final java.lang.String ICV_ORDER_SEPARATOR
private static final java.lang.String ICV_ORDER_SUFFIX
private static java.util.Hashtable clsAccountList
private com.ibm.etill.framework.admin.AccountAdmin objFrameworkAccount
private java.lang.String objMerchant
private java.lang.String objAccount
private java.lang.String objCurrency
private java.lang.String objExp10
private java.lang.String objUser
private java.lang.String objPassword
private java.lang.String objLdbCardId
private java.lang.String objUrl
private java.lang.Integer objBatchCloseTime
private java.lang.Integer objMinBatchTotal
private java.lang.Integer objMaxBatchSize
private java.text.NumberFormat objFormatter
private double objDoubleExp10
private netverify.remote.client.Connection objConnection
Constructor Detail |
protected LdbCardAccount(java.sql.ResultSet argResultSet) throws java.sql.SQLException, com.ibm.etill.framework.payapi.ETillAbortOperation
argCassette
- - The cassette object that is initializing.argResultSet
- - A ResultSet where the current row
contains the values to be used to initialize the new account
object.public LdbCardAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, it initializes some attributes using values from the protocol data table found in the request and then uses methods common to all constructors to initialize the other account attributes.
argRequest
- - the administration request that was sent
to the cassette to create a new account.argResponse
- - the response object to be updated with
the result of the operation.Method Detail |
public static void resurrectAccounts() throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, the method reads every row from the account configuration table and constructs an account object for each row. The account objects are kept in a Hashtable (a static variable) that can be used to retrieve the appropriate account object when required.
Since, by definition, there can only be one account per merchant, the merchant number is used as a key in the Hashtable and if the database table contains more than one account for any given merchant, an exception is thrown.
public static boolean verifyAccounts()
public static void initializeAccounts() throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, there is nothing to do because account initialization will continue when the AccountStart command is processed. Other cassettes may take this opportunity to initialize objects associated with the cassette (e.g. brand or currency objects)
public static LdbCardAccount retrieveAccount(java.lang.String argMerchant)
For this cassette, by definition, there can only be one account per merchant, so the key required is the merchant number. Other cassettes may support multiple accounts per merchant and require the account number as well as the merchant number to construct a key.
argMerchant
- - The merchant number of the account object
to be returned.argAccountNumber
- - The account number of the account
object to be returned.public static void validateCreateRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, the protocol data values are validated. Since all the conversions have been performed successfully by the framework (using the parameter validation table provided by the cassette), this method merely validates that all required parameter exist.
Note that this cassette assumes that there is only one account per merchant. If an administrator attempts to start another account for the same merchant, even if the account number is different (and therefore did not get automatically rejected by the framework) it is considered a duplicate account and the request is rejected.
argRequest
- - The administration request that is
attempting to create a new account for this cassette.argResponse
- - The response object to be updated with
the result of the validationpublic static void validateModifyRequest(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, the protocol data values are validated. Since the conversions have been performed successfully by the framework (using the parameter validation table provided by the cassette), this method merely validates that the request does not attempt to modify the currency value. The existing orders that use this account cannot change to a new currency simply because the administrator has changed the account's currency.
All other account attributes are related to the payment engine connection and can be changed without affecting the orders that reference this account.
argRequest
- - The administration request that is
attempting to create a new account for this cassette.argResponse
- - The response object to be updated with
the result of the validationprivate void initializeAccount() throws com.ibm.etill.framework.payapi.ETillAbortOperation
private void addAccountToList() throws com.ibm.etill.framework.payapi.ETillAbortOperation
public void createRecord(java.sql.Connection argConnection) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argConnection
- - The JDBC database connection to be used
for this operation.public void updateRecord(java.sql.Connection argConnection) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argConnection
- - The JDBC database connection to be used
for this operation.public void deleteRecord(java.sql.Connection argConnection) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argConnection
- - The JDBC database connection to be used
for this operation.public void modifyAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, it re-initializes its attributes using values from the protocol data table found in the request and adds the object to the update list of the current commit point.
argRequest
- - the administration request that was sent
to the cassette to modify the account.argResponse
- - the response object to be updated with
the result of the operation.public void deleteAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, it adds this object to the delete list of the current commit point.
argRequest
- - the administration request that was sent
to the cassette to delete the account.argResponse
- - the response object to be updated with
the result of the operation.public void startAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, it creates a connection to the payment engine and then starts the service threads for any batch associated with this account.
argRequest
- - the administration request that was sent
to the cassette to start the account.argResponse
- - the response object to be updated with
the result of the operation.public void stopAccount(com.ibm.etill.framework.cassette.AdminRequest argRequest, com.ibm.etill.framework.cassette.APIResponse argResponse) throws com.ibm.etill.framework.payapi.ETillAbortOperation
For this cassette, it breaks a connection to the payment engine.
argRequest
- - the administration request that was sent
to the cassette to start the account.argResponse
- - the response object to be updated with
the result of the operation.public void selectBatchAndAddPayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment) throws com.ibm.etill.framework.payapi.ETillAbortOperation
The method must be synchronized because framework API locks do not prevent race conditions between automatic batch close requests and API requests that affect the contents of the batch (Deposit, DepositReversal, Refund and RefundReversal). Synchronizing on the cassette account object prevents one thread from changing the contents of the batch a micro-moment after some other thread has triggered an automatic batch close.
argFrameworkPayment
- - a framework payment that is to
be added to a batch.public void selectBatchAndAddCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit) throws com.ibm.etill.framework.payapi.ETillAbortOperation
The method must be synchronized because framework API locks do not prevent race conditions between automatic batch close requests and API requests that affect the contents of the batch (Deposit, DepositReversal, Refund and RefundReversal). Synchronizing on the cassette account object prevents one thread from changing the contents of the batch a micro-moment after some other thread has triggered an automatic batch close.
argFrameworkCredit
- - a framework credit that is to
be added to a batch.public void retrieveBatchAndRemovePayment(com.ibm.etill.framework.payapi.Payment argFrameworkPayment) throws com.ibm.etill.framework.payapi.ETillAbortOperation
The method must be synchronized because framework API locks do not prevent race conditions between automatic batch close requests and API requests that affect the contents of the batch (Deposit, DepositReversal, Refund and RefundReversal). Synchronizing on the cassette account object prevents one thread from changing the contents of the batch a micro-moment after some other thread has triggered an automatic batch close.
argFrameworkPayment
- - a framework payment that is to
be removed from its batch.public void retrieveBatchAndRemoveCredit(com.ibm.etill.framework.payapi.Credit argFrameworkCredit) throws com.ibm.etill.framework.payapi.ETillAbortOperation
The method must be synchronized because framework API locks do not prevent race conditions between automatic batch close requests and API requests that affect the contents of the batch (Deposit, DepositReversal, Refund and RefundReversal). Synchronizing on the cassette account object prevents one thread from changing the contents of the batch a micro-moment after some other thread has triggered an automatic batch close.
argFrameworkCredit
- - a framework credit that is to
be removed from its batch.private com.ibm.etill.framework.payapi.Batch selectBatch() throws com.ibm.etill.framework.payapi.ETillAbortOperation
The method must be synchronized because framework API locks do not prevent race conditions between automatic batch open requests and API requests that add a transaction to a batch (Deposit and Refund). Synchronizing on the cassette account object prevents one thread from triggering an automatic batch open when no suitable batch was found a micro-moment after some other thread has triggered a batch open request for the same reason.
private com.ibm.etill.framework.payapi.Batch retrieveBatch(com.ibm.etill.framework.payapi.Transaction argFrameworkTransaction) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argFrameworkTransaction
- - a framework transaction (it
dosen't matter if it is a framework payment or a framework
credit) that is contained in the batch to be retrievedpublic java.lang.String getMerchant()
public java.lang.String getAccountNumber()
public java.lang.String getCurrency()
public java.lang.String getUser()
public java.lang.String getPassword()
public java.lang.String getObscurePassword()
public java.lang.String getLdbCardId()
public java.lang.String getUrl()
public boolean isBatchCloseTimeConfigured()
public int getBatchCloseTime()
public java.lang.Integer getBatchCloseTimeObject()
public boolean isMinBatchTotalConfigured()
public int getMinBatchTotal()
public java.lang.Integer getMinBatchTotalObject()
public boolean isMaxBatchSizeConfigured()
public int getMaxBatchSize()
public java.lang.Integer getMaxBatchSizeObject()
public java.lang.String toString()
private void connect() throws com.ibm.etill.framework.payapi.ETillAbortOperation
private void disconnect() throws com.ibm.etill.framework.payapi.ETillAbortOperation
public boolean authorizePayment(LdbCardPayment argCassettePayment) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argCassettePayment
- - The cassette's payment object.public boolean capturePayment(LdbCardPayment argCassettePayment, int argAmount) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argCassettePayment
- - The cassette's payment object.argAmount
- - The amount to be captured.public boolean voidPayment(LdbCardPayment argCassettePayment, int argAmount) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argCassettePayment
- - The cassette's payment object.argAmount
- - The amount to be voided.public boolean captureCredit(LdbCardCredit argCassetteCredit) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argCassetteCredit
- - The cassette's credit object.public boolean voidCredit(LdbCardCredit argCassetteCredit) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argCassetteCredit
- - The cassette's credit object.public boolean settleBatch(LdbCardBatch argCassetteBatch) throws com.ibm.etill.framework.payapi.ETillAbortOperation
argBatch
- - The cassette's batch object.private java.lang.String convertAmount(int argAmount)
argAmount
- - The amount to be converted.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |