|
||||||||||
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
Transaction is the base class for the generic Payment and Credit classes. This class contains the instance variables and methods that are common across the two subclasses.
Cassettes should not extend this class.
Refer to the Javadoc for the Payment and Credit classes for a complete description of Transaction objects.
Field Summary | |
---|---|
int |
amount
Deprecated. Use getAmount() and setAmount() |
CassetteTransaction |
cassetteTransaction
Deprecated. Use getCassetteTransaction() |
int |
currentState
Deprecated. Use getCurrentState() and setCurrentState() |
boolean |
newTransaction
Deprecated. Use isNewTransaction() and setNewTransaction() |
Order |
order
Deprecated. Use getOrder() |
long |
timeStampCreated
Deprecated. Use getTimestampCreated() and setTimestampCreated() |
long |
timeStampModified
Deprecated. Use getTimestampModified() and setTimestampModified() |
String |
transactionNumber
Deprecated. Use getTransactionNumber() |
Method Summary | |
---|---|
String |
getAcquirerID()
Deprecated. Use getReferenceNumber() |
int |
getAmount()
Returns the amount value, without decimal point, of this Transaction object. |
String |
getBatchNumber()
Returns the batch number with which this Transaction is associated. |
CassetteTransaction |
getCassetteTransaction()
Returns the CassetteTransaction object associated with this generic Transaction object. |
int |
getCurrentState()
Returns the current state of this Transaction object. |
String |
getMerchantName()
Returns the merchant number of the merchant to which this Transaction belongs. |
String |
getMerchantNumber()
Returns the merchant number of the merchant to which this Transaction belongs. |
Order |
getOrder()
Returns the Order object to which this Transaction belongs. |
String |
getOrderNumber()
Returns the order number of the Order object to which this Transaction belongs. |
String |
getReferenceNumber()
Returns the protocol-specific reference number from this Transaction object. |
long |
getTimestampCreated()
Returns the time and date when this Transaction object was created. |
long |
getTimestampModified()
Returns the time and date when this Transaction object was last modified. |
String |
getTransactionNumber()
Returns the transaction number of this Transaction object. |
boolean |
isNewTransaction()
Indicates whether or not this is a new transaction object. |
void |
setAcquirerID(String newID)
Deprecated. Use setReferenceNumber() |
void |
setAmount(Amount amount)
Sets the transaction amount to the amount value in the input Amount object. |
void |
setAmount(int amount)
Sets the transaction amount to the input amount value. |
void |
setBatchNumber(String batchNumber)
Sets the batch number of this transaction. |
void |
setCassetteTransaction(CassetteTransaction aTransaction)
Sets the cassettetransaction. |
void |
setCurrentState(int state)
Updates the current state of this Transaction object and generates a StateEvent. |
void |
setNewTransaction(boolean aFlag)
Sets the internal newTransaction flag to indicate whether
or not this is a new transaction. |
void |
setReferenceNumber(String aRef)
Assigns a protocol-specific reference number to this Transaction object. |
void |
setTimeStampCreated(long timeCreated)
Cassettes should not call this method. |
void |
setTimeStampModified(long timeModified)
Cassettes should not call this method. |
String |
toString()
Returns a string representation of this object for tracing purposes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.etill.framework.archive.Archivable |
---|
createRecord, deleteRecord, updateRecord |
Methods inherited from interface com.ibm.etill.framework.archive.Restorable |
---|
restoreRecord |
Field Detail |
public CassetteTransaction cassetteTransaction
public Order order
public String transactionNumber
public int amount
public long timeStampCreated
public long timeStampModified
public int currentState
public boolean newTransaction
Method Detail |
public String getMerchantNumber()
public String getMerchantName()
public String getOrderNumber()
public Order getOrder()
public String getTransactionNumber()
public int getAmount()
trx
is a reference to your Transaction object:
...
int amountValue = trx.getAmount();
int amounttExp10Value = trx.getOrder().getAmount().getAmountExp10();
short currencyValue = trx.getOrder().getAmount().getCurrency();
...
public int getCurrentState()
public String getBatchNumber()
public CassetteTransaction getCassetteTransaction()
public boolean isNewTransaction()
true
means that the Framework just created
this object and no corresponding CassetteTransaction
exists yet; false
means that both the
generic and cassette objects representing this Transaction
are complete and have been or should be committed to the
database.setNewTransaction(boolean)
public void setNewTransaction(boolean aFlag)
newTransaction
flag to indicate whether
or not this is a new transaction.
When the Framework first instantiates this Transaction object,
the newTransaction
flag is set to true
.
If an ETillAbortOperation
exception is thrown while the
newTransaction
is still true
, then the Framework
will delete the in-memory Transaction object without ever writing it to
the database.
Cassettes must call this method with a false
value
once they have successfully completed initializing the associated
CassetteTransaction object. By setting this indicator to false
,
the cassette ensures that the generic Transaction object will remain in
existence even if an error occurs henceforth.
public void setCassetteTransaction(CassetteTransaction aTransaction)
aTransaction.
- public long getTimestampCreated()
public long getTimestampModified()
public void setTimeStampCreated(long timeCreated)
timeCreated
- a long containing a timestamp, expressed as the
number of milliseconds since January 1, 1970, 00:00:00 UTC.public void setTimeStampModified(long timeModified)
timeModified
- a long containing a timestamp, expressed as the
number of milliseconds since January 1, 1970, 00:00:00 UTC.public void setCurrentState(int state)
Cassettes should call this method as necessary to keep this object's state synchronized with the cassette's corresponding CassetteTransaction object. The cassette writer is responsible for defining how the CassetteTransaction's states map to those of the generic Transaction objects.
The Framework generates a StateEvent if the input state value is different from the
current state value. This event will be sent out to registered event listeners the
next time the commit
method of this thread's CommitPoint is called.
state
- an int containing the new state value. Valid state values
are defined by the subclass.CommitPoint.addToEventList(com.ibm.etill.framework.eventmgr.PSEvent)
public void setBatchNumber(String batchNumber)
batchNumber
- String describing the batch number of
this transactionpublic void setAmount(Amount amount)
amount
- an Amount object whose getAmount
method
will provide the transaction amount value.public void setAmount(int amount)
amount
- an int containing the transaction amount value.public void setReferenceNumber(String aRef)
Reference number is typically a value returned from a financial institution that represents the successful completion of a financial transaction. For example, a credit card-based cassette might store the approval code from an authorization request in this field.
aRef
- a String containing a protocol-specific reference number.getReferenceNumber()
public String getReferenceNumber()
Reference number is typically a value returned from a financial institution that represents the successful completion of a financial transaction. For example, a credit card-based cassette might store the approval code from an authorization request in this field.
setReferenceNumber(java.lang.String)
public void setAcquirerID(String newID)
public String getAcquirerID()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |