com.ibm.etill.framework.payapi
Class Order

java.lang.Object
  |
  +--com.ibm.etill.framework.payapi.Order
All Implemented Interfaces:
Archivable, Commitable, FrameworkReturnCodes, PaymentAPIConstants, PSServerOrderConstants
Direct Known Subclasses:
FrameworkOrder

public abstract class Order
extends Object
implements Archivable, Commitable, PaymentAPIConstants, PSServerOrderConstants

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:

Order objects are constructed in several different cases:

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.

See Also:
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()
 
Fields inherited from interface com.ibm.etill.framework.xdm.PSServerOrderConstants
APPROXIMATE_XDM_KEY_SIZE, APPROXIMATE_XDM_OBJECT_SIZE, COL_ACCOUNTNUMBER, COL_AMOUNTEXP10, COL_AMOUNTVALUE, COL_APPROVEFLAG, COL_APPROVESALLOWED, COL_BATCHID, COL_BATCHNUMBER, COL_BATCHREQUIRED, COL_CANCELURL, COL_CARDHOLDERID, COL_CTYPECHARSET, COL_CURRENCY, COL_CURRENTSTATE, COL_DEPOSITFLAG, COL_FAILUREURL, COL_INITIALPAYMENT, COL_MERCHANTNAME, COL_ORDERDATA1, COL_ORDERDATA2, COL_ORDERDATA3, COL_ORDERDATA4, COL_ORDERDATA5, COL_ORDERDESCRIPTION, COL_ORDERNUMBER, COL_ORDERURL, COL_ORIGIN, COL_PAYMENTAMOUNT, COL_PAYMENTTYPE, COL_PAYREQPERSISTFDSKEY, COL_SERVICEURL, COL_SPLITSALLOWED, COL_SUCCESSURL, COL_TIMESTAMPCREATED, COL_TIMESTAMPMODIFIED, COL_TRANSACTIONID, COL_UNAPPROVEDAMOUNT, ORDER, ORDERVIEW, VIEW_ACCOUNTNUMBER, VIEW_AMOUNTEXP10, VIEW_APPROVESALLOWED, VIEW_BATCHREQUIRED, VIEW_CANCELURL, VIEW_CARDHOLDERID, VIEW_CTYPECHARSET, VIEW_CURRENCY, VIEW_FAILUREURL, VIEW_MERCHANTNAME, VIEW_ORDERAMOUNT, VIEW_ORDERDATA1, VIEW_ORDERDATA2, VIEW_ORDERDATA3, VIEW_ORDERDATA4, VIEW_ORDERDATA5, VIEW_ORDERDESCRIPTION, VIEW_ORDERNUMBER, VIEW_ORDERSTATE, VIEW_ORDERTIMECREATED, VIEW_ORDERTIMEMODIFIED, VIEW_ORDERURL, VIEW_ORIGIN, VIEW_PAYMENTTYPE, VIEW_SERVICEURL, VIEW_SUCCESSURL, VIEW_TRANSACTIONID, VIEW_UNAPPROVEDAMOUNT
 
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

initialPaymentNumber

public String initialPaymentNumber
Deprecated. Use getInitialPaymentNumber()


initialPaymentAmount

public int initialPaymentAmount
Deprecated. Use getInitialPaymentAmount()


deposit

public boolean deposit
Deprecated. Use getDepositFlag()


splitsAllowed

public boolean splitsAllowed
Deprecated. Use getSplitsAllowed()


batchNumber

public String batchNumber
Deprecated. Use getBatchNumber()


cardholderID

public String cardholderID
Deprecated. Use getCardholderID()


cassetteOrder

public CassetteOrder cassetteOrder
Deprecated. Use getCassetteOrder()

Constructor Detail

Order

public Order()
Cassettes should never call this constructor. The Framework instantiates new Order objects as they are needed. To resurrect an existing Order and all of its associated objects, call the Supervisor.retrieveOrder method.
See Also:
Supervisor.retrieveOrder(java.lang.String, java.lang.String)
Method Detail

deletePayment

public void deletePayment(Payment payment)
Deletes the specfied Payment from this Order's payment collection. Cassettes should call this method in cases where the Payment is being deleted before it has ever been committed to the database.
Parameters:
payment - the Payment object to be removed from the Order's payment collection.

deleteCredit

public void deleteCredit(Credit credit)
Deletes the specfied Credit from this Order's payment collection. Cassettes should call this method in cases where the Credit is being deleted before it has ever been committed to the database.
Parameters:
credit - the Credit object to be removed from the Order's credit collection.

getUniquePayment

public Payment getUniquePayment()
Returns what is assumed to be the only Payment for this order. This method can be called when the payment protocol for this Order ensures that only one payment will be created for any given order. If more than one Payment is in this Order's payment collection, this method throws an ETillFrameworkException which STOPS COMMERCE PAYMENTS. This method is not called by the Framework. Cassette's should use this method carefully or not at all.
Returns:
Payment the Order's lone payment; null if no payment has been created.
Throws:
ETillFrameworkException - thrown if more than one Payment exists in this Order's payment collection. This exception will STOP COMMERCE PAYMENTS.

getOrderNumber

public String getOrderNumber()
Returns this order's order number.
Returns:
String - the order number

getBatchNumber

public String getBatchNumber()
Returns the batch number to be used for this order's automatic approval and automatic deposit.
Returns:
String - the batch number

setBatchNumber

public void setBatchNumber(String batchNumber)
Assigns a batch number to be used for this order's automatic approval and automatic deposit.
Parameters:
String - the batch number

getMerchantNumber

public String getMerchantNumber()
Returns the merchant number of the merchant to which this Order belongs.
Returns:
String - the merchant number

getMerchantName

public String getMerchantName()
Returns the merchant number of the merchant to which this Order belongs.
Returns:
String - the merchant number

getPaymentSystemName

public String getPaymentSystemName()
Returns the name of the cassette that is associated with this order. ("Payment system" is a term used to refer the relationship between a merchant and a cassette.)
Returns:
String - the configured cassette name

getAmount

public Amount getAmount()
Returns the Amount object representing this Order's purchase amount.
Returns:
Amount - the purchase amount object

getCurrentState

public int getCurrentState()
Returns the current state of this Order object. Valid Order state values (defined in com.ibm.etill.framework.payapi.PaymentAPIConstants) are:
Returns:
int - the current state value of this Order

getOrderDescription

public byte[] getOrderDescription()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the order description.
Returns:
byte[] - the order description as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getContentTypeCharset

public String getContentTypeCharset()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the content type character set.
Returns:
String - the content type character set as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderURL

public String getOrderURL()
Returns the order URL.
Returns:
String - the order URL as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getorderURL

public String getorderURL()
Deprecated. Use the getOrderURL method instead.

Returns the order URL.
Returns:
String - the order URL as it was received on the RECEIVEPAYMENT command.

getsuccessURL

public String getsuccessURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the success URL.
Returns:
String - the success URL as it was received on the RECEIVEPAYMENT command.

getfailureURL

public String getfailureURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the failure URL.
Returns:
String - the failure URL as it was received on the RECEIVEPAYMENT command.

getcancelURL

public String getcancelURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the cancel URL.
Returns:
String - the cancel URL as it was received on the RECEIVEPAYMENT command.

getserviceURL

public String getserviceURL()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Returns the service URL.
Returns:
String - the service URL as it was received on the RECEIVEPAYMENT command.

getTransactionID

public String getTransactionID()
Returns the user-specified transaction ID.
Returns:
String - the transaction ID as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderData1

public String getOrderData1()
Returns the user-specified order data1.
Returns:
String - the orderData1 as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderData2

public String getOrderData2()
Returns the user-specified order data2.
Returns:
String - the orderData2 as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderData3

public String getOrderData3()
Returns the user-specified order data3.
Returns:
String - the orderData3 as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderData4

public byte[] getOrderData4()
Returns the user-specified order data4.
Returns:
byte[] - the orderData4 as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getOrderData5

public byte[] getOrderData5()
Returns the user-specified order data5.
Returns:
byte[] - the orderData5 as it was received on the RECEIVEPAYMENT or ACCEPTPAYMENT command.

getApproveFlag

public short getApproveFlag()
Indicates whether automatic approval was requested for this order.
Returns:
short - 1 if automatic approval was requesed. 2 if asynchronous automatic approval was requesed. RECEIVEPAYMENT or ACCEPTPAYMENT command.

setApproveFlag

public void setApproveFlag(short value)
Modifier for approve flag. Approve Flag indicates whether automatic approval was requested for this order or not.

getDepositFlag

public boolean getDepositFlag()
Indicates whether automatic deposit was requested with the automatic approval for this order. Note that this flag only has meaning if the getApproveFlag method returns 1.
Returns:
boolean - 1 if automatic deposit was requesed on the RECEIVEPAYMENT or ACCEPTPAYMENT command. Any other value means that automatic deposit was not requested.

setDepositFlag

public void setDepositFlag(boolean value)
modifier for automatic deposit flag.Note that this flag only has meaning if the getApproveFlag method returns 1.

setSplitsAllowed

public void setSplitsAllowed(boolean value)

getAccountNumber

public String getAccountNumber()
Returns the account number with which this order is associated.
Returns:
String - the account number

getBatchRequired

public short getBatchRequired()
Indicates whether a batch number must be provided when creating or operating on payments and credits for this order. This condition is typically true when the financial institution associated with this order's account requires the merchant software to maintain and submit its own batches.
Returns:
short - 1 if batch numbers must be provided. Any other value means that batch numbers should not be provided.

getPayment

public Payment getPayment(String paymentNumber)
Returns the specified Payment object from this order's payment collection.
Parameters:
paymentNumber - the payment number of the payment to be retrieved.
Returns:
Payment - the Payment object; null if the payment was not found.

getCredit

public Credit getCredit(String creditNumber)
Returns the specified Credit object from this order's credit collection.
Parameters:
creditNumber - the credit number of the credit to be retrieved.
Returns:
Credit - the Credit object; null if the credit was not found.

numberOfPayments

public int numberOfPayments()
Returns the number of payments that have been created for this order.
Returns:
int - the number of payments that exist in this order's payment collection.

allPayments

public Enumeration allPayments()
Returns all of the Payment objects belonging to this order.
Returns:
Enumeration - contains all of the Payment objects from this order's payment collection.

numberOfCredits

public int numberOfCredits()
Returns the number of credits that have been created for this order.
Returns:
int - the number of credits that exist in this order's credit collection.

allCredits

public Enumeration allCredits()
Returns all of the Credit objects belonging to this order.
Returns:
Enumeration - contains all of the Credit objects from this order's credit collection.

getTimestampCreated

public long getTimestampCreated()
Returns the time and date when this Order object was created.
Returns:
long - the creation time of this object, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

getTimestampModified

public long getTimestampModified()
Returns the time and date when this Order object was last modified.
Returns:
long - the most recent modification time of this object, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

setTimeStampModified

public void setTimeStampModified(long timeModified)
Cassettes should not call this method. Updates the time and date when this Order object was last modified. The framework calls this method before committing the object to the database.
Parameters:
timeModified - a long containing a timestamp, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

setCurrentState

public void setCurrentState(int state)
Updates the current state of this Order object and generates a StateEvent.

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.

Parameters:
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:
  • ORDER_CANCELED
  • ORDER_CLOSED
  • ORDER_ORDERED
  • ORDER_PENDING
  • ORDER_REFUNDABLE
  • ORDER_REJECTED
  • ORDER_REQUESTED
  • ORDER_RESET
If any other value is used, an ETillAbortOperation will eventually occur because the object's state is not recognized.
See Also:
CommitPoint.addToEventList(com.ibm.etill.framework.eventmgr.PSEvent), PaymentAPIConstants

getCassetteOrder

public CassetteOrder getCassetteOrder()
Returns the CassetteOrder object associated with this generic Order object.
Returns:
CassetteOrder - the corresponding CassetteOrder.

setCassetteOrder

public void setCassetteOrder(CassetteOrder aCassetteOrder)
Associates a CassetteOrder object with this generic order. The cassette must call this method as soon as its CassetteOrder instance is created.
Parameters:
aCassetteOrder - The cassette order object to associate with this generic order.

setMerchantOriginated

public void setMerchantOriginated()
The Framework calls this method to mark this Order object as having been created through an ACCEPTPAYMENT API command. 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.

getMerchantOriginated

public boolean getMerchantOriginated()
Indicates whether or not this Order object was created through an ACCEPTPAYMENT API command. Cassettes can use this method to determine how the purchaser's financial information should be obtained for this Order.

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.

Returns:
boolean - true if this Order was created through an ACCEPTPAYMENT command, false if not.

getInitialPaymentNumber

public String getInitialPaymentNumber()
Returns the payment number to be used for an automatic approval. Note that this flag only has meaning if the getApproveFlag method returns 1.
Returns:
String - the payment number specified by the merchant software in the ACCEPTPAYMENT or RECEIVEPAYMENT command's automatic approval parameters.

getInitialPaymentAmount

public int getInitialPaymentAmount()
Returns the amount value, without decimal point, of the payment amount for an automatic approval. This is the value of the PAYMENTAMOUNT parameter received on the ACCEPTPAYMENT or RECEIVEPAYMENT command that created this Order object. Note that this value only has meaning if the getApproveFlag method returns 1.
Returns:
int - the amount value to be used on an automatic approval. The associated amountExp10 and currency values must be obtained from this Order's purchase amount object. Use this object's getAmount method to access the purchase amount object.

setInitialPaymentAmount

public void setInitialPaymentAmount(int anAmount)
The Framework calls this method to set the amount value (without decimal point) to be used on an automatic approval. This is the value of the PAYMENTAMOUNT parameter received on the ACCEPTPAYMENT or RECEIVEPAYMENT command that created this Order object. Note that this value only has meaning if the getApproveFlag method returns 1.
Parameters:
anAmount - an int containing the amount value to be used on an automatic approval.
See Also:
getInitialPaymentAmount()

setInitialPaymentNumber

public void setInitialPaymentNumber(String aNumber)
Parameters:
aNumber -  
See Also:
getInitialPaymentNumber()

getSplitsAllowed

public boolean getSplitsAllowed()
Deprecated. Included for compatibility with 1.2. This information is cassette-specific and should be stored as such.

Indicates whether split payments are to be allowed for this Order object. The returned value represents the setting of the SPLITALLOWED parameter of the ACCEPTPAYMENT or RECEIVEPAYMENT command that created this Order object.

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.

Returns:
boolean - true if the ACCEPTPAYMENT or RECEIVEPAYMENT command requested split payments, false if not.

getCardholderID

public String getCardholderID()
Returns the cardholder id associated with this Order. The definition of and content of this data is up to each cassette. The Framework does not interpret or attempt to process this data - it only saves it in the database with the rest of the Order information.
Returns:
String - the cardholder id data, as previously set by the cassette.
See Also:
setCardholderID(java.lang.String)

setCardholderID

public void setCardholderID(String aString)
Assigns cardholder id data to this Order. The definition and content of this data is up to each cassette. The Framework does not interpret or attempt to process this data - it only saves it in the database with the rest of the Order information.
Parameters:
aString - the cardholder id data, as provided by the cassette.
See Also:
getCardholderID()

setETillConnection

public void setETillConnection(ETillConnection ds)
Deprecated. ETillConnection is set in the CassetteRequest and CassetteResponse.

The Framework calls this method to stores the current ETillConnection object in the Order. This is left over from version 1.0.
Parameters:
ds - the ETillConnection object currently associated with this Order.

getETillConnection

public ETillConnection getETillConnection()
getETillConnection()
Returns:
ETillConnection

getOrderRequestObject

public OrderRequest getOrderRequestObject()
getOrderRequestObject()
Returns:
orderRequestObject

createRecord

public void createRecord(Connection conn)
                  throws ETillAbortOperation
This method should never be called directly from cassettes.

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.

Specified by:
createRecord in interface Archivable
Parameters:
Connection - The JDBC Connection object used to access the database.
Throws:
ETillAbortOperation - Thrown if an SQLException is caught.
See Also:
CommitPoint

updateRecord

public void updateRecord(Connection conn)
                  throws ETillAbortOperation
This method should never be called directly from cassettes.

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.

Specified by:
updateRecord in interface Archivable
Parameters:
Connection - The JDBC Connection object used to access the database.
Throws:
ETillAbortOperation - Thrown if an SQLException is caught.
See Also:
CommitPoint

deleteRecord

public void deleteRecord(Connection conn)
                  throws ETillAbortOperation
This method should never be called directly from cassettes.

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.

Specified by:
deleteRecord in interface Archivable
Parameters:
Connection - The JDBC Connection object used to access the database.
Throws:
ETillAbortOperation - Thrown if an SQLException is caught.
See Also:
CommitPoint

addToCreateList

public void addToCreateList(Archivable newItem)
Deprecated. Use Supervisor.getThreadCommitPoint().addToCreateList()

Description copied from interface: Commitable
Adds an Archivable object to the list of objects to be created.
Specified by:
addToCreateList in interface Commitable
Following copied from interface: com.ibm.etill.framework.archive.Commitable
Parameters:
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.

addToUpdateList

public void addToUpdateList(Archivable newItem)
Deprecated. Use Supervisor.getThreadCommitPoint().addToUpdateList()

Description copied from interface: Commitable
Adds an Archivable object to the list of objects to be updated.
Specified by:
addToUpdateList in interface Commitable
Following copied from interface: com.ibm.etill.framework.archive.Commitable
Parameters:
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.

addToDeleteList

public void addToDeleteList(Archivable newItem)
Deprecated. Use Supervisor.getThreadCommitPoint().addToDeleteList()

Description copied from interface: Commitable
Adds an Archivable object to the list of objects to be deleted
Specified by:
addToDeleteList in interface Commitable
Following copied from interface: com.ibm.etill.framework.archive.Commitable
Parameters:
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.

addToBoundOrders

public void addToBoundOrders(Order order)
Deprecated. Deprecated function that no longer does anything.

Description copied from interface: Commitable
Deprecated function that doesn't do anything.
Specified by:
addToBoundOrders in interface Commitable

commit

public void commit()
Deprecated. Use Supervisor.getThreadCommitPoint().commit()

Description copied from interface: Commitable
Causes all the collected data to be commited to the database. When this method is invoked&colon.
Specified by:
commit in interface Commitable
Following copied from interface: com.ibm.etill.framework.archive.Commitable
Throws:
ETillFrameworkException - Thrown if the commit fails.

noCommit

public void noCommit()
Deprecated. Use Supervisor.getThreadCommitPoint().noCommit()

Description copied from interface: Commitable
Clears the lists of Archivable objects: the commit will not happen.
Specified by:
noCommit in interface Commitable
Following copied from interface: com.ibm.etill.framework.archive.Commitable
Throws:
ETillFrameworkException - Thrown if the clearing of the lists fails.

getTimestamp

public 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. IMPORTANT the precision of these timestamps is one second. All units less than a second are ignored.
Parameters:
timeModified - a long containing a timestamp, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.
Returns:
java.sql.Timestamp - contains the time and date in JDBC format.

setApprovesAllowed

public void setApprovesAllowed(boolean value)
Sets an internal flag to indicate whether or not new APPROVE commands are allowed for this Order object. The initial value of this flag is 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.
Parameters:
value - a boolean value: true means that approvals are allowed for this Order, false means they are not.

getApprovesAllowed

public boolean getApprovesAllowed()
Indicates whether new APPROVE commands are allowed for this Order object.
Returns:
boolean - true if approvals are allowed for this Order, false if not.
See Also:
setApprovesAllowed(boolean)

getUnapprovedAmount

public int getUnapprovedAmount()
Returns the portion of this Order object's purchase amount that has not yet been approved.
Returns:
int - the purchase amount minus the sum of the approval amounts for each Payment belonging to this Order object.

adjustAutoFlagsBasedOnAccountSettings

public void adjustAutoFlagsBasedOnAccountSettings(AccountAdmin account,
                                                  boolean isRequestAnAcceptPayment)
adjust's the order's approve and deposit flags based on the Account settings. assumes that account parameter is not null.

getReaderWriterMonitor

public ReaderWriterMonitor getReaderWriterMonitor()
Cassettes should not call this method.

The Framework calls this method to access the Order object's ReaderWriterMonitor, which is used to obtain the object lock.


getPersistentFieldsKey

public String getPersistentFieldsKey()
Cassettes should not call this method.

The Framework calls this method to access the Order object's persistentFieldsKey.


setPersistentFieldsKey

public void setPersistentFieldsKey(String persistFdsKey)
Cassettes should not call this method.

The Framework calls this method to access the Order object's persistentFieldsKey


setPersistentFieldsKeyIndicator

public void setPersistentFieldsKeyIndicator(int persistFdsKeyInd)
Cassettes should not call this method.

The Framework calls this method to access the Order object's persistentFieldsKeyIndicator


setOrderRequestObject

public void setOrderRequestObject(OrderRequest requestObject)
Sets the value for order request object attribute.
Parameters:
requestObject - an Order request object

getOrderData5Key

public String getOrderData5Key()
Cassettes should not call this method.

The Framework calls this method to access the Order object's orderData5Key.


toString

public String toString()
Returns a string representation of this object for tracing purposes.
Overrides:
toString in class Object
Returns:
String - a string representation of the key elements of this object.