com.ibm.commerce.payment.beans
Class UsablePaymentTCListDataBean

java.lang.Object
  |
  +--com.ibm.commerce.beans.InputDataBeanImpl
        |
        +--com.ibm.commerce.beans.SmartDataBeanImpl
              |
              +--com.ibm.commerce.payment.beans.UsablePaymentTCListDataBean
All Implemented Interfaces:
DataBean, InputDataBean, java.io.Serializable, SmartDataBean

public class UsablePaymentTCListDataBean
extends SmartDataBeanImpl

This DataBean, when populated, gives a list of PaymentTCInfo bean representing Payment Terms and Conditions that could be used to pay for the order specified as input parameter before the DataBean is activated.

See Also:
PaymentTCInfo, Serialized Form

Field Summary
protected  java.util.Hashtable ihshPaymentTCInfoByTradingId
          Hashtable for storing the set of PaymentTCInfo Beans by Trading Agreement ID for all the oder items in the specified order.
protected  java.util.Vector ivecCommonPaymentTCInfo
          Vector for storing the PaymentTCInfo Beans representing Payment Terms and Conditions that are common across all Trading Agreements specified by the order items.
protected  java.util.Vector ivecIdsOfTAWithNoPaymentTC
          Vector for storing the IDs of Trading Agreement with no explicit Payment Terms and Conditions that are specified by the order items of this order.
protected  java.util.Vector ivecTradingIds
          Vector for storing the different Trading Agreement IDs for this order
protected  java.util.Vector ivecUsablePaymentTCInfo
          Vector for storing the PaymentTCInfo Beans representing usable Payment Terms and Conditions for this order.
 
Fields inherited from class com.ibm.commerce.beans. SmartDataBeanImpl
commandContext, COPYRIGHT
 
Fields inherited from class com.ibm.commerce.beans. InputDataBeanImpl
requestProperties
 
Fields inherited from interface com.ibm.commerce.beans. DataBean
emptyString
 
Constructor Summary
UsablePaymentTCListDataBean()
          UsablePaymentTCListDataBean default constructor.
 
Method Summary
protected  void completeCommonPaymentTCInfo()
          Completes the properties in the common PaymentTCInfo bean.
protected  java.util.Vector createDefaultPaymentTCInfoFromStoreSupportedPolicies()
          Returns a Vector of PaymentTCInfo Beans created from the set of supported Payment Policies for the Store.
protected  void findCommonPaymentTCForOrderItems()
          Finds the common Payment Terms and Conditions (TCs) from all the Payment TCs specified by the various Trading Agreements used by the order items in the Order.
protected  void findPaymentTCInfoByTAFromOrderItems()
          Fills the Hashtable containing vectors of PaymentTCInfo beans keyed by Trading Agreement ID for the order items in the Order.
protected  void findUsablePaymentTCFromCommon()
          Finds the usable Payment Terms and Conditions (TCs) from the vector of common Payment TCs specified by the Trading Agreements of order items.
 com.ibm.commerce.security.Protectable getDelegate()
          Retrieves its delegatee.
 java.lang.String getMessage()
          Returns the message property of the Bean.
protected  OrderAccessBean getOrderAccessBean()
          Returns the OrderAccessBean representing the order specified by the orderId input parameter.
protected  OrderDataBean getOrderDataBean()
          Returns the OrderDataBean representing the order specified by the orderId input parameter.
protected  java.util.Hashtable getPaymentPolicyInfoForCurrencyBySupportedCassette()
          Returns a Hashtable containing vectors of PaymentPolicyInfo beans keyed by supported cassette.
 java.lang.Exception getPaymentSystemException()
          Returns any Exception thrown by the Payment System during the activation of the DataBean or null.
  PaymentTCInfo[] getPaymentTCInfo()
          Returns an array of PaymentTCInfo bean representing payment terms and conditions that could be used to pay for the specified Order.
 int getPrimaryRC()
          Returns the primary return code as returned from the WebSphere Commerce Payments QueryAccounts command.
 int getSecondaryRC()
          Returns the secondary return code as returned from the WebSphere Commerce Payments QueryAccounts command.
protected  java.lang.Integer getStoreIdFromOrder()
          Returns the Store Entity ID from the order specified as input parameter for the activation of this DataBean.
 void populate()
          Populate the Bean Properties.
protected  void setLanguageId(java.lang.Integer aLanguageId)
          Sets the languageId property of the Bean
protected  void setMessage(java.lang.String astrMessage)
          Sets the message property of the Bean.
 void setOrderId(java.lang.Long aOrderId)
          Sets the orderId property of the Bean.
protected  void setPaymentSystemException(java.lang.Exception exc)
          Saves the Exception object returned by the Payment System during the activation of this DataBean.
protected  void setPrimaryRC(int anPrimaryRC)
          Sets the primary return code as returned from the WebSphere Commerce Payments QueryOrders command.
protected  void setSecondaryRC(int anSecondaryRC)
          Sets the secondary return code as returned from the WebSphere Commerce Payments QueryOrders command.
 
Methods inherited from class com.ibm.commerce.beans. SmartDataBeanImpl
fulfills, getCommandContext, getResources, setCommandContext
 
Methods inherited from class com.ibm.commerce.beans. InputDataBeanImpl
getRequestProperties, setRequestProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.beans. InputDataBean
getRequestProperties, setRequestProperties
 

Field Detail

ihshPaymentTCInfoByTradingId

protected java.util.Hashtable ihshPaymentTCInfoByTradingId
Hashtable for storing the set of PaymentTCInfo Beans by Trading Agreement ID for all the oder items in the specified order.

ivecTradingIds

protected java.util.Vector ivecTradingIds
Vector for storing the different Trading Agreement IDs for this order

ivecIdsOfTAWithNoPaymentTC

protected java.util.Vector ivecIdsOfTAWithNoPaymentTC
Vector for storing the IDs of Trading Agreement with no explicit Payment Terms and Conditions that are specified by the order items of this order.

ivecCommonPaymentTCInfo

protected java.util.Vector ivecCommonPaymentTCInfo
Vector for storing the PaymentTCInfo Beans representing Payment Terms and Conditions that are common across all Trading Agreements specified by the order items.

ivecUsablePaymentTCInfo

protected java.util.Vector ivecUsablePaymentTCInfo
Vector for storing the PaymentTCInfo Beans representing usable Payment Terms and Conditions for this order. This is a subset of the common Payment Terms and Conditions (TCs). Cassette-based Payment TCs that are not backed up by a WebSphere Commerce Payments configuration (payment card brand and/or currency) are excluded from this set.
Constructor Detail

UsablePaymentTCListDataBean

public UsablePaymentTCListDataBean()
UsablePaymentTCListDataBean default constructor.
Method Detail

completeCommonPaymentTCInfo

protected void completeCommonPaymentTCInfo()
                                    throws ECException
Completes the properties in the common PaymentTCInfo bean. When the bean was instantiated some of the properties were not filled in to save time as the bean may not be needed unless it represents one of the common PaymentTCs.
Throws:
ECException.
ECException

createDefaultPaymentTCInfoFromStoreSupportedPolicies

protected java.util.Vector createDefaultPaymentTCInfoFromStoreSupportedPolicies()
                                                                         throws ECException
Returns a Vector of PaymentTCInfo Beans created from the set of supported Payment Policies for the Store.
Returns:
the Vector of PaymentTCInfo Beans
Throws:
ECException.
ECException
See Also:
PaymentTCInfo

findCommonPaymentTCForOrderItems

protected void findCommonPaymentTCForOrderItems()
                                         throws ECException
Finds the common Payment Terms and Conditions (TCs) from all the Payment TCs specified by the various Trading Agreements used by the order items in the Order.
Throws:
ECException.
ECException

findPaymentTCInfoByTAFromOrderItems

protected void findPaymentTCInfoByTAFromOrderItems()
                                            throws ECException
Fills the Hashtable containing vectors of PaymentTCInfo beans keyed by Trading Agreement ID for the order items in the Order.
Throws:
ECException.
ECException

findUsablePaymentTCFromCommon

protected void findUsablePaymentTCFromCommon()
                                      throws ECException
Finds the usable Payment Terms and Conditions (TCs) from the vector of common Payment TCs specified by the Trading Agreements of order items.
Throws:
ECException.
ECException

getDelegate

public com.ibm.commerce.security.Protectable getDelegate()
                                                  throws java.lang.Exception
Retrieves its delegatee. This method is called by the Access Control Framework.

For the UsablePaymentTCListDataBean, the getDelegate() method returns the OrderDataBean specified by the order ID. The OrderDataBean object is the Protectable object whose access control policies will indirectly control the access control for this object

Returns:
the OrderDataBean object representing the order
Throws:
java.lang.Exception

getMessage

public java.lang.String getMessage()
Returns the message property of the Bean. The message property stores any message received during population of the Bean. It may be the empty String if no message has been received.

This is mainly for diagnostics purposes.

Returns:
the String message received during population of the DataBean

getOrderAccessBean

protected OrderAccessBean getOrderAccessBean()
                                      throws ECException
Returns the OrderAccessBean representing the order specified by the orderId input parameter.
Returns:
the OrderAccessBean
Throws:
ECException

getOrderDataBean

protected OrderDataBean getOrderDataBean()
                                  throws ECException
Returns the OrderDataBean representing the order specified by the orderId input parameter.
Returns:
the OrderDataBean.
Throws:
ECException

getPaymentPolicyInfoForCurrencyBySupportedCassette

protected java.util.Hashtable getPaymentPolicyInfoForCurrencyBySupportedCassette()
                                                                          throws ECException
Returns a Hashtable containing vectors of PaymentPolicyInfo beans keyed by supported cassette. Payment Policies that are known to not support the currency specified by the order are excluded.
Returns:
the Hashtable of Payment Policies by cassette
Throws:
ECException.
ECException
See Also:
PaymentPolicyInfo

getPaymentSystemException

public java.lang.Exception getPaymentSystemException()
Returns any Exception thrown by the Payment System during the activation of the DataBean or null.

This is useful for diagnostics or for determining whether to display a user-friendly message to the customer when an empty list of PaymentTCInfo bean is returned by the getPaymentTCInfo() method.

One possible Exception returned is the com.ibm.etill.framework.clientapi.PaymentServerCommunicationException which indicates a failure to communicate with WebSphere Commerce Payments.

Returns:
the Exception object thrown by the Payment System or null if none was thrown during the activation of the DataBean.

getPaymentTCInfo

public PaymentTCInfo[] getPaymentTCInfo()
Returns an array of PaymentTCInfo bean representing payment terms and conditions that could be used to pay for the specified Order.
Returns:
an array of PaymentTCInfo bean.
See Also:
PaymentTCInfo

getPrimaryRC

public int getPrimaryRC()
Returns the primary return code as returned from the WebSphere Commerce Payments QueryAccounts command.

This is mainly for diagnostics purposes.

Returns:
the primary return code from the QueryAccounts command or -1 if an error occurred before the command was issued.

getSecondaryRC

public int getSecondaryRC()
Returns the secondary return code as returned from the WebSphere Commerce Payments QueryAccounts command.

This is mainly for diagnostics purposes.

Returns:
the secondary return code from the QueryAccounts command or -1 if an error occurred before the command was issued.

getStoreIdFromOrder

protected java.lang.Integer getStoreIdFromOrder()
                                         throws ECException
Returns the Store Entity ID from the order specified as input parameter for the activation of this DataBean.
Returns:
the Store Entity ID.
Throws:
ECException.
ECException

populate

public void populate()
              throws java.lang.Exception
Populate the Bean Properties. This method is called by the DataBeanManager during DataBean activation.
Specified by:
populate in interface SmartDataBean
Overrides:
populate in class SmartDataBeanImpl
Throws:
Exception.
java.lang.Exception - should not happen since there is no data retrieved to populate the databean.

setLanguageId

protected void setLanguageId(java.lang.Integer aLanguageId)
Sets the languageId property of the Bean
Parameters:
aLanguageId - the internal ID of the preferred Language of the requester.

setMessage

protected void setMessage(java.lang.String astrMessage)
Sets the message property of the Bean.

The message property stores any message received during population of the Bean. It may be null.

Parameters:
astrMessage - the String message

setOrderId

public void setOrderId(java.lang.Long aOrderId)
Sets the orderId property of the Bean. The orderId is the reference number of the customer order.
Parameters:
aOrderId - the ID of the customer order.

setPaymentSystemException

protected void setPaymentSystemException(java.lang.Exception exc)
Saves the Exception object returned by the Payment System during the activation of this DataBean. The Payment System is WebSphere Commerce Payments in this case.
Parameters:
exc - the Exception object from the Payment System

setPrimaryRC

protected void setPrimaryRC(int anPrimaryRC)
Sets the primary return code as returned from the WebSphere Commerce Payments QueryOrders command.
Parameters:
anPrimaryRC - the primary return code from the QueryOrders command

setSecondaryRC

protected void setSecondaryRC(int anSecondaryRC)
Sets the secondary return code as returned from the WebSphere Commerce Payments QueryOrders command.
Parameters:
anSecondaryRC - the secondary return code from the QueryOrders command