|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.payapi.Order
Order objects contain all of the generic information that the Framework needs to represent an order created by a merchant application. The combination of this object and the CassetteOrder object for the same order constitutes the complete representation of a given order.
An order is uniquely identified by the combination of the merchant number and order number. Therefore, all order numbers for a given merchant must be unique.
Among the data maintained in Order objects are:
Supervisor.retrieveOrder
method.
This class implements methods to log the generic information about an order into the ETORDER database table and to retrieve that same information later on.
Supervisor.retrieveOrder(java.lang.String, java.lang.String)
Field Summary | |
---|---|
String |
batchNumber
Deprecated. Use getBatchNumber() |
String |
cardholderID
Deprecated. Use getCardholderID() |
CassetteOrder |
cassetteOrder
Deprecated. Use getCassetteOrder() |
boolean |
deposit
Deprecated. Use getDepositFlag() |
int |
initialPaymentAmount
Deprecated. Use getInitialPaymentAmount() |
String |
initialPaymentNumber
Deprecated. Use getInitialPaymentNumber() |
boolean |
splitsAllowed
Deprecated. Use getSplitsAllowed() |
Constructor Summary | |
---|---|
Order()
Cassettes should never call this constructor. |
Method Summary | |
---|---|
void |
addToBoundOrders(Order order)
Deprecated function that doesn't do anything. |
void |
addToCreateList(Archivable newItem)
Adds an Archivable object to the list of objects to be created. |
void |
addToDeleteList(Archivable newItem)
Adds an Archivable object to the list of objects to be deleted |
void |
addToUpdateList(Archivable newItem)
Adds an Archivable object to the list of objects to be updated. |
void |
adjustAutoFlagsBasedOnAccountSettings(AccountAdmin account,
boolean isRequestAnAcceptPayment)
adjust's the order's approve and deposit flags based on the Account settings. |
Enumeration |
allCredits()
Returns all of the Credit objects belonging to this order. |
Enumeration |
allPayments()
Returns all of the Payment objects belonging to this order. |
void |
commit()
Causes all the collected data to be commited to the database. |
void |
createRecord(Connection conn)
This method should never be called directly from cassettes. |
void |
deleteCredit(Credit credit)
Deletes the specfied Credit from this Order's payment collection. |
void |
deletePayment(Payment payment)
Deletes the specfied Payment from this Order's payment collection. |
void |
deleteRecord(Connection conn)
This method should never be called directly from cassettes. |
String |
getAccountNumber()
Returns the account number with which this order is associated. |
Amount |
getAmount()
Returns the Amount object representing this Order's purchase amount. |
short |
getApproveFlag()
Indicates whether automatic approval was requested for this order. |
boolean |
getApprovesAllowed()
Indicates whether new APPROVE commands are allowed for this Order object. |
String |
getBatchNumber()
Returns the batch number to be used for this order's automatic approval and automatic deposit. |
short |
getBatchRequired()
Indicates whether a batch number must be provided when creating or operating on payments and credits for this order. |
String |
getcancelURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
String |
getCardholderID()
Returns the cardholder id associated with this Order. |
CassetteOrder |
getCassetteOrder()
Returns the CassetteOrder object associated with this generic Order object. |
String |
getContentTypeCharset()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
Credit |
getCredit(String creditNumber)
Returns the specified Credit object from this order's credit collection. |
int |
getCurrentState()
Returns the current state of this Order object. |
boolean |
getDepositFlag()
Indicates whether automatic deposit was requested with the automatic approval for this order. |
ETillConnection |
getETillConnection()
getETillConnection() |
String |
getfailureURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
int |
getInitialPaymentAmount()
Returns the amount value, without decimal point, of the payment amount for an automatic approval. |
String |
getInitialPaymentNumber()
Returns the payment number to be used for an automatic approval. |
String |
getMerchantName()
Returns the merchant number of the merchant to which this Order belongs. |
String |
getMerchantNumber()
Returns the merchant number of the merchant to which this Order belongs. |
boolean |
getMerchantOriginated()
Indicates whether or not this Order object was created through an ACCEPTPAYMENT API command. |
String |
getOrderData1()
Returns the user-specified order data1. |
String |
getOrderData2()
Returns the user-specified order data2. |
String |
getOrderData3()
Returns the user-specified order data3. |
byte[] |
getOrderData4()
Returns the user-specified order data4. |
byte[] |
getOrderData5()
Returns the user-specified order data5. |
String |
getOrderData5Key()
Cassettes should not call this method. |
byte[] |
getOrderDescription()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
String |
getOrderNumber()
Returns this order's order number. |
OrderRequest |
getOrderRequestObject()
getOrderRequestObject() |
String |
getorderURL()
Deprecated. Use the getOrderURL method instead. |
String |
getOrderURL()
Returns the order URL. |
Payment |
getPayment(String paymentNumber)
Returns the specified Payment object from this order's payment collection. |
String |
getPaymentSystemName()
Returns the name of the cassette that is associated with this order. |
String |
getPersistentFieldsKey()
Cassettes should not call this method. |
ReaderWriterMonitor |
getReaderWriterMonitor()
Cassettes should not call this method. |
String |
getserviceURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
boolean |
getSplitsAllowed()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
String |
getsuccessURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such. |
static Timestamp |
getTimestamp(long date)
Returns the actual time and date in a JDBC timestamp object given the number of milliseconds since January 1, 1970, 00:00:00 UTC. |
long |
getTimestampCreated()
Returns the time and date when this Order object was created. |
long |
getTimestampModified()
Returns the time and date when this Order object was last modified. |
String |
getTransactionID()
Returns the user-specified transaction ID. |
int |
getUnapprovedAmount()
Returns the portion of this Order object's purchase amount that has not yet been approved. |
Payment |
getUniquePayment()
Returns what is assumed to be the only Payment for this order. |
void |
noCommit()
Clears the lists of Archivable objects: the commit will not happen. |
int |
numberOfCredits()
Returns the number of credits that have been created for this order. |
int |
numberOfPayments()
Returns the number of payments that have been created for this order. |
void |
setApproveFlag(short value)
Modifier for approve flag. |
void |
setApprovesAllowed(boolean value)
Sets an internal flag to indicate whether or not new APPROVE commands are allowed for this Order object. |
void |
setBatchNumber(String batchNumber)
Assigns a batch number to be used for this order's automatic approval and automatic deposit. |
void |
setCardholderID(String aString)
Assigns cardholder id data to this Order. |
void |
setCassetteOrder(CassetteOrder aCassetteOrder)
Associates a CassetteOrder object with this generic order. |
void |
setCurrentState(int state)
Updates the current state of this Order object and generates a StateEvent. |
void |
setDepositFlag(boolean value)
modifier for automatic deposit flag.Note that this flag only has meaning if the getApproveFlag method returns 1 . |
void |
setETillConnection(ETillConnection ds)
Deprecated. ETillConnection is set in the CassetteRequest and CassetteResponse. |
void |
setInitialPaymentAmount(int anAmount)
The Framework calls this method to set the amount value (without decimal point) to be used on an automatic approval. |
void |
setInitialPaymentNumber(String aNumber)
|
void |
setMerchantOriginated()
The Framework calls this method to mark this Order object as having been created through an ACCEPTPAYMENT API command. |
void |
setOrderRequestObject(OrderRequest requestObject)
Sets the value for order request object attribute. |
void |
setPersistentFieldsKey(String persistFdsKey)
Cassettes should not call this method. |
void |
setPersistentFieldsKeyIndicator(int persistFdsKeyInd)
Cassettes should not call this method. |
void |
setSplitsAllowed(boolean value)
|
void |
setTimeStampModified(long timeModified)
Cassettes should not call this method. |
String |
toString()
Returns a string representation of this object for tracing purposes. |
void |
updateRecord(Connection conn)
This method should never be called directly from cassettes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public String initialPaymentNumber
public int initialPaymentAmount
public boolean deposit
public boolean splitsAllowed
public String batchNumber
public String cardholderID
public CassetteOrder cassetteOrder
Constructor Detail |
public Order()
Supervisor.retrieveOrder
method.Supervisor.retrieveOrder(java.lang.String, java.lang.String)
Method Detail |
public void deletePayment(Payment payment)
payment
- the Payment object to be removed from the Order's
payment collection.public void deleteCredit(Credit credit)
credit
- the Credit object to be removed from the Order's
credit collection.public Payment getUniquePayment()
ETillFrameworkException
- thrown if more than one Payment exists in
this Order's payment collection. This exception will STOP
COMMERCE PAYMENTS.public String getOrderNumber()
public String getBatchNumber()
public void setBatchNumber(String batchNumber)
String
- the batch numberpublic String getMerchantNumber()
public String getMerchantName()
public String getPaymentSystemName()
public Amount getAmount()
public int getCurrentState()
com.ibm.etill.framework.payapi.PaymentAPIConstants
)
are:
public byte[] getOrderDescription()
public String getContentTypeCharset()
public String getOrderURL()
public String getorderURL()
public String getsuccessURL()
public String getfailureURL()
public String getcancelURL()
public String getserviceURL()
public String getTransactionID()
public String getOrderData1()
public String getOrderData2()
public String getOrderData3()
public byte[] getOrderData4()
public byte[] getOrderData5()
public short getApproveFlag()
1
if automatic approval was requesed.
2
if asynchronous automatic approval was requesed. RECEIVEPAYMENT or ACCEPTPAYMENT command.public void setApproveFlag(short value)
public boolean getDepositFlag()
getApproveFlag
method returns 1
.1
if automatic deposit was requesed on the
RECEIVEPAYMENT or ACCEPTPAYMENT command. Any other
value means that automatic deposit was not requested.public void setDepositFlag(boolean value)
getApproveFlag
method returns 1
.public void setSplitsAllowed(boolean value)
public String getAccountNumber()
public short getBatchRequired()
1
if batch numbers must be provided.
Any other value means that batch numbers should not be
provided.public Payment getPayment(String paymentNumber)
paymentNumber
- the payment number of the payment to be retrieved.public Credit getCredit(String creditNumber)
creditNumber
- the credit number of the credit to be retrieved.public int numberOfPayments()
public Enumeration allPayments()
public int numberOfCredits()
public Enumeration allCredits()
public long getTimestampCreated()
public long getTimestampModified()
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 CassetteOrder object. The cassette writer is responsible for defining how the CassetteOrder's states map to those of the generic Order 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. This must be one of
the following order state values as defined in
com.ibm.etill.framework.payapi.PaymentAPIConstants
:
CommitPoint.addToEventList(com.ibm.etill.framework.eventmgr.PSEvent)
,
PaymentAPIConstants
public CassetteOrder getCassetteOrder()
public void setCassetteOrder(CassetteOrder aCassetteOrder)
aCassetteOrder
- The cassette order object to associate with
this generic order.public void setMerchantOriginated()
public boolean getMerchantOriginated()
ACCEPTPAYMENT is used by merchant software when it knows all of the required financial information at the time of the API call. RECEIVEPAYMENT, on the other hand, is called when messages must be exchanged with the consumer to obtain the financial information.
true
if this Order was created through an
ACCEPTPAYMENT command, false
if not.public String getInitialPaymentNumber()
getApproveFlag
method returns 1
.public int getInitialPaymentAmount()
getApproveFlag
method returns 1
.getAmount
method to access
the purchase amount object.public void setInitialPaymentAmount(int anAmount)
getApproveFlag
method returns 1
.anAmount
- an int containing the amount value to be used on
an automatic approval.getInitialPaymentAmount()
public void setInitialPaymentNumber(String aNumber)
aNumber
- getInitialPaymentNumber()
public boolean getSplitsAllowed()
Each cassette is responsible for enforcing its own split payment policy. This policy is usually mandated by the payment protocol which the cassette is designed to implement. Therefore, some cassettes may support this option on a per-order basis, some may assume split payments for all orders, and others may not allow split payments at all.
true
if the ACCEPTPAYMENT or RECEIVEPAYMENT
command requested split payments, false
if not.public String getCardholderID()
setCardholderID(java.lang.String)
public void setCardholderID(String aString)
aString
- the cardholder id data, as provided by the cassette.getCardholderID()
public void setETillConnection(ETillConnection ds)
ds
- the ETillConnection object currently associated with this Order.public ETillConnection getETillConnection()
public OrderRequest getOrderRequestObject()
public void createRecord(Connection conn) throws ETillAbortOperation
Creates a new record representing this Order object in the ETORDER database table.
This method is part of Order's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Order object is a member of the CommitPoint
create list.
Note: Also calls the cassette to create the CassetteOrder in the database.
createRecord
in interface Archivable
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 Order object in the ETORDER table.
This method is part of Order's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Order object is a member of the CommitPoint
update list.\
Note: Also calls the cassette to update the CassetteOrder in the database.
updateRecord
in interface Archivable
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 Order object from the ETORDER table.
This method is part of Order's implementation of the Archivable interface. The
CommitPoint
object calls this method during commit processing
when this Order object is a member of the CommitPoint
delete list.
Also calls the cassette to delete the CassetteOrder from the database.
deleteRecord
in interface Archivable
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- Thrown if an SQLException is caught.CommitPoint
public void addToCreateList(Archivable newItem)
Commitable
addToCreateList
in interface Commitable
com.ibm.etill.framework.archive.Commitable
Archivable
- The item to create in the database upon the next commit.
This will be accomplished by calling the object's
createRecord
method when this Commitable
object's commit
is invoked.public void addToUpdateList(Archivable newItem)
Commitable
addToUpdateList
in interface Commitable
com.ibm.etill.framework.archive.Commitable
Archivable
- The item to update in the database upon the next commit.
This will be accomplished by calling the object's
updateRecord
method when this Commitable
object's commit
is invoked.public void addToDeleteList(Archivable newItem)
Commitable
addToDeleteList
in interface Commitable
com.ibm.etill.framework.archive.Commitable
Archivable
- The item to delete in the database upon the next commit.
This will be accomplished by calling the object's
deleteRecord
method when this Commitable
object's commit
is invoked.public void addToBoundOrders(Order order)
Commitable
addToBoundOrders
in interface Commitable
public void commit()
Commitable
createRecord
method.
updateRecord
method.
deleteRecord
method.
commit
in interface Commitable
com.ibm.etill.framework.archive.Commitable
ETillFrameworkException
- Thrown if the commit fails.public void noCommit()
Commitable
noCommit
in interface Commitable
com.ibm.etill.framework.archive.Commitable
ETillFrameworkException
- Thrown if the clearing of the lists fails.public static Timestamp getTimestamp(long date)
timeModified
- a long containing a timestamp, expressed as the
number of milliseconds since January 1, 1970, 00:00:00 UTC.public void setApprovesAllowed(boolean value)
true
.
The cassette must call this method when it processes a CLOSEORDER or CANCELORDER
for this Order object. When either of these commands succeeds, new APPROVALS are
no longer allowed for the order. Additionally, the cassette may have its own
protocol-specific reasons for setting this indicator at other times.value
- a boolean value: true
means that approvals are
allowed for this Order, false
means they are not.public boolean getApprovesAllowed()
true
if approvals are allowed for this Order,
false
if not.setApprovesAllowed(boolean)
public int getUnapprovedAmount()
public void adjustAutoFlagsBasedOnAccountSettings(AccountAdmin account, boolean isRequestAnAcceptPayment)
public ReaderWriterMonitor getReaderWriterMonitor()
The Framework calls this method to access the Order object's ReaderWriterMonitor, which is used to obtain the object lock.
public String getPersistentFieldsKey()
The Framework calls this method to access the Order object's persistentFieldsKey.
public void setPersistentFieldsKey(String persistFdsKey)
The Framework calls this method to access the Order object's persistentFieldsKey
public void setPersistentFieldsKeyIndicator(int persistFdsKeyInd)
The Framework calls this method to access the Order object's persistentFieldsKeyIndicator
public void setOrderRequestObject(OrderRequest requestObject)
requestObject
- an Order request objectpublic String getOrderData5Key()
The Framework calls this method to access the Order object's orderData5Key.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |