|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.payapi.Transaction | +--com.ibm.etill.framework.payapi.Payment
Payment objects contain all of the generic information that the Framework needs to represent a payment created for a specific order. The combination of this object and the CassetteTransaction object for the same payment constitutes the complete representation of a given payment.
A Payment is uniquely identified by the combination of the merchant number, order number, and Payment number. Therefore, all Payments for a given order must be unique.
Among the data maintained in each Payment object are:
com.ibm.etill.framework.payapi.PaymentAPIConstants.java
)
are:
Supervisor.createPayment
method. This happens in several different cases:
This class implements methods to log the generic information about a payment into the ETPAYMENT database table and to retrieve that same information later on.
Field Summary | |
---|---|
int |
depositAmount
Deprecated. Use getDepositAmount() and setDepositAmount() |
Fields inherited from class com.ibm.etill.framework.payapi.Transaction |
---|
amount, cassetteTransaction, currentState, newTransaction, order, timeStampCreated, timeStampModified, transactionNumber |
Constructor Summary | |
---|---|
Payment(Order order,
String paymentNumber)
Cassettes should never call this constructor. |
Method Summary | |
---|---|
void |
createCassettePayment(ParameterTable protocolData)
Cassettes should not call this method. |
void |
createRecord(Connection conn)
This method should never be called directly from cassettes. |
void |
deleteRecord(Connection conn)
This method should never be called directly from cassettes. |
long |
getApproveTime()
Accessor method for approveTime |
long |
getAuthorizationExpiry()
Accessor method for approvalExpiry |
int |
getDepositAmount()
Returns the deposit amount value, without decimal point, of this Payment object. |
void |
resetPayment()
Reinitializes this payment object to the state it had when it was first instantiated. |
void |
restoreRecord()
This method should never be called directly from cassettes. |
void |
resurrectCassettePayment()
Cassettes should not call this method. |
static void |
retrievePayments(Order currentOrder,
Hashtable collection)
Returns the set of Payment objects that belong to the specified order. |
void |
setApproveTime(long time)
setter method for approveTime |
void |
setApproveTime(long time,
boolean doNotSetExpiration)
Sets the ApproveTime and optionally sets the Authorization Expiration time |
void |
setAuthorizationExpiry(long time)
setter method for approvalExpiry |
void |
setDepositAmount(int depositAmount)
Sets the deposit amount value of this Payment object. |
void |
updateRecord(Connection conn)
This method should never be called directly from cassettes. |
Methods inherited from class com.ibm.etill.framework.payapi.Transaction |
---|
getAcquirerID, getAmount, getBatchNumber, getCassetteTransaction, getCurrentState, getMerchantName, getMerchantNumber, getOrder, getOrderNumber, getReferenceNumber, getTimestampCreated, getTimestampModified, getTransactionNumber, isNewTransaction, setAcquirerID, setAmount, setAmount, setBatchNumber, setCassetteTransaction, setCurrentState, setNewTransaction, setReferenceNumber, setTimeStampCreated, setTimeStampModified, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int depositAmount
Constructor Detail |
public Payment(Order order, String paymentNumber)
Supervisor.createPayment
method.
To resurrect an existing Order and all of its associated objects, including
Payments, call the Supervisor.retrieveOrder
method.
The Framework calls this constructor to create a new Payment having the specified payment number for the specified Order.
Supervisor.createPayment(com.ibm.etill.framework.payapi.Order, java.lang.String, com.ibm.etill.framework.payapi.Amount, com.ibm.etill.framework.payapi.ParameterTable)
,
Supervisor.retrieveOrder(java.lang.String, java.lang.String)
Method Detail |
public void resetPayment()
newTransaction
indicator is set to false
,
resetTransaction
method is invoked.
public void createCassettePayment(ParameterTable protocolData) throws ETillAbortOperation
newCassettePayment
method which is responsible for building the cassette's payment object.protocolData
- a ParameterTable that contains the protocol data parameters
which were specified on the API command that is currently
being processed. If no protocol data parameters were
specified, a null will be passed here.ETillAbortOperation
- thrown by the cassette to report errors.public void resurrectCassettePayment() throws ETillAbortOperation
resurrectCassettePayment
method which is responsible for recreating the cassette's payment object.ETillAbortOperation
- thrown by the cassette to report errors.public void createRecord(Connection conn) throws ETillAbortOperation
Creates a new record representing this Payment object in the ETPAYMENT database table.
This method is part of Payment's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Payment object is a member of the CommitPoint
create list.
Also calls the cassette to create the CassettePayment in the database.
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- thrown if an SQLException is caught.CommitPoint
public void updateRecord(Connection conn) throws ETillAbortOperation
Udates the database record that represents this Payment object in the ETPAYMENT table.
This method is part of Payment's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Payment object is a member of the CommitPoint
update list.
Note: Also calls the cassette to update the CassettePayment in the database.
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- thrown if an SQLException is caught.CommitPoint
public void deleteRecord(Connection conn) throws ETillAbortOperation
Deletes the database record that represents this Payment object from the ETPAYMENT table.
This method is part of Payment's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Payment object is a member of the CommitPoint
delete list.
Also calls the cassette to delete the CassettePayment from the database.
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- thrown if an SQLException is caught.CommitPoint
public void restoreRecord() throws ETillAbortOperation
Restores the payment from the database record in the ETPAYMENT Table.
Also calls the cassette to resurrect the CassettePayment from the database.
This method is the Payment's implementation of the Restorable interface. The
CommitPoint
object calls this method during noCommit processing.
when this Payment object is a member of the CommitPoint
restore list.
ETillAbortOperation
- thrown if an SQLException is caught.CommitPoint
public static void retrievePayments(Order currentOrder, Hashtable collection) throws ETillAbortOperation
currentOrder
- the Order object whose payment collection is
being requested.collection
- a caller-supplied Hashtable which will be
populated with the payment collection. The
payment number will serve as the table keys
and the associated table elements will be
the Payment objects.ETillAbortOperation
- thrown if an SQLException is caught.public int getDepositAmount()
trx
is a reference to your Transaction object:
...
int depAmountValue = trx.getDepositAmount();
int amounttExp10Value = trx.getOrder().getAmount().getAmountExp10();
short currencyValue = trx.getOrder().getAmount().getCurrency();
...
public void setDepositAmount(int depositAmount)
amount
- an int containing the deposit amount value.public long getApproveTime()
public long getAuthorizationExpiry()
public void setApproveTime(long time)
time
- the payment approve time in milliseconds since
Jan 1 1970 UTC formatpublic void setApproveTime(long time, boolean doNotSetExpiration)
time
- the time in milliseconds since 1/1/1970 in UTC formatsetexpiration
- true imples set expiration to default value as setup
in the account. If the account is not enabled it will
not be setpublic void setAuthorizationExpiry(long time)
time
- the payment approval expiry time in milliseconds since
Jan 1 1970 UTC format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |