com.ibm.commerce.payment.beans
Class PaymentPolicyListDataBean

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

public class PaymentPolicyListDataBean
extends SmartDataBeanImpl

This DataBean, when populated, gives a list of PaymentPolicyInfo beans representing Payment Business Policies that the Store supports.

See Also:
PaymentPolicyInfo, Serialized Form

Field Summary
static java.lang.String CURRENCY_CODE_UNKNOWN
          The special currency code used if the numeric currency code used by WebSphere Commerce Payments does not have a corresponding alpha code in the SETCURR Table
protected  java.util.Hashtable ihshMerchantAccountInfoByCassette
          Hashtable for storing the set of MerchantAccountInfo objects for the Store keyed by the cassette name.
protected  java.util.Hashtable ihshNonCassetteBasedPaymentPolicyInfo
          Hashtable for storing the set of non-cassette based PaymentPolicyInfo objects for the Store.
protected  java.util.Hashtable ihshPaymentPolicyInfoByCassette
          Hashtable for storing the set of PaymentPolicyInfo objects for the Store keyed by the cassette name.
protected  java.util.Hashtable ihshPaymentPolicyInfoForSupportedCassette
          Hashtable for storing the set of PaymentPolicyInfo objects for the supported cassette.
protected  java.util.Vector ivecDefinedPaymentPolicies
          // Vector for storing the name of the defined Payment Policies for the Store
protected  java.util.Vector ivecMerchantAccountInfo
          Vector for storing the MerchantAccountInfo objects of the Store
protected  java.util.Vector ivecSupportedCassettes
          Vector for storing the name of the supported Cassettes for the Store
protected  java.util.Vector ivecSupportedPaymentPolicyInfo
          Vector for storing the supported PaymentPolicyInfo for the Store
static java.lang.String POLICY_NAME_CREDIT_LINE
          The name of the Credit Line payment business policy
 
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
PaymentPolicyListDataBean()
          PaymentPolicyListDataBean default constructor.
 
Method Summary
protected  void completeMerchantAccountInfo()
          Goes through the set of MerchantAccountInfo objects and completes the MerchantAccountInfo properties for each.
protected  void completeSupportedPaymentPolicyInfoForStore()
          Goes through the Hashtable for PaymentPolicyInfo for Supported Cassettes and completes the PaymentPolicyInfo for each of the Supported Cassettes creating new PaymentPolicInfo object if needed.
protected  void findDefinedPaymentPoliciesForStore()
          Finds all the defined Payment Policies for the Store.
protected  void findPaymentPoliciesForSupportedCassettes()
          Find the Payment Policies for each of the Supported Cassettes for the Store.
protected  void findSupportedCassettesAndAccountsForStore()
          Finds the supported Cassettes and WebSphere Commerce Payments Merchant Accounts for the Store.
 java.lang.String getMessage()
          Returns the message property of the Bean.
  PaymentPolicyInfo[] getNonPMPaymentPolicyInfo()
          Returns an array of PaymentPolicyInfo for the Store representing the set of non-cassette based Payment Policies configured and usable by the Store.
  PaymentPolicyInfo[] getPaymentPolicyInfoUsableWithoutTA(java.lang.String astrCurrency)
          Returns an array of PaymentPolicyInfo representing Payment Policies usable by the specified Store.
 java.lang.Exception getPaymentSystemException()
          Returns any Exception thrown by the Payment System during the population of the List DataBean or null.
  PaymentPolicyInfo[] getPMPaymentPolicyInfo()
          Returns an array of PaymentPolicyInfo for the Store representing the set of cassette-based Payment Policies configured and usable by the Store.
 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 getStoreId()
          Returns the storeId property of the Bean
 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.
protected  void setPaymentSystemException(java.lang.Exception exc)
          Saves the Exception object returned by the Payment System during the activation of this DataBean.
 void setPolicyName(java.lang.String aPolicyName)
          Optionally specify the name of the payment policy you wish to request for information.
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.
 void setStoreId(java.lang.Integer aStoreId)
          Sets the Store ID for which the list of usable Payment Policies are requested.
 
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

POLICY_NAME_CREDIT_LINE

public static final java.lang.String POLICY_NAME_CREDIT_LINE
The name of the Credit Line payment business policy
See Also:
Constant Field Values

CURRENCY_CODE_UNKNOWN

public static final java.lang.String CURRENCY_CODE_UNKNOWN
The special currency code used if the numeric currency code used by WebSphere Commerce Payments does not have a corresponding alpha code in the SETCURR Table
See Also:
Constant Field Values

ivecSupportedCassettes

protected java.util.Vector ivecSupportedCassettes
Vector for storing the name of the supported Cassettes for the Store

ivecDefinedPaymentPolicies

protected java.util.Vector ivecDefinedPaymentPolicies
// Vector for storing the name of the defined Payment Policies for the Store

ivecMerchantAccountInfo

protected java.util.Vector ivecMerchantAccountInfo
Vector for storing the MerchantAccountInfo objects of the Store

ivecSupportedPaymentPolicyInfo

protected java.util.Vector ivecSupportedPaymentPolicyInfo
Vector for storing the supported PaymentPolicyInfo for the Store

ihshMerchantAccountInfoByCassette

protected java.util.Hashtable ihshMerchantAccountInfoByCassette
Hashtable for storing the set of MerchantAccountInfo objects for the Store keyed by the cassette name. The value is a vector of MerchantAccountInfo objects for a particular payment cassette.

ihshPaymentPolicyInfoByCassette

protected java.util.Hashtable ihshPaymentPolicyInfoByCassette
Hashtable for storing the set of PaymentPolicyInfo objects for the Store keyed by the cassette name. The value is a vector of PaymentPolicyInfo objects for a particular payment cassette.

ihshNonCassetteBasedPaymentPolicyInfo

protected java.util.Hashtable ihshNonCassetteBasedPaymentPolicyInfo
Hashtable for storing the set of non-cassette based PaymentPolicyInfo objects for the Store. The key for this Hashtable is the policyName and the mapped-to value is the PaymentPolicyInfo object with that policyName.

ihshPaymentPolicyInfoForSupportedCassette

protected java.util.Hashtable ihshPaymentPolicyInfoForSupportedCassette
Hashtable for storing the set of PaymentPolicyInfo objects for the supported cassette. The value is a vector of PaymentPolicyInfo objects for each of the supported cassette.
Constructor Detail

PaymentPolicyListDataBean

public PaymentPolicyListDataBean()
PaymentPolicyListDataBean default constructor.
Method Detail

completeMerchantAccountInfo

protected void completeMerchantAccountInfo()
                                    throws ECException
Goes through the set of MerchantAccountInfo objects and completes the MerchantAccountInfo properties for each.
Throws:
ECException

completeSupportedPaymentPolicyInfoForStore

protected void completeSupportedPaymentPolicyInfoForStore()
                                                   throws ECException
Goes through the Hashtable for PaymentPolicyInfo for Supported Cassettes and completes the PaymentPolicyInfo for each of the Supported Cassettes creating new PaymentPolicInfo object if needed.
Throws:
ECException

findDefinedPaymentPoliciesForStore

protected void findDefinedPaymentPoliciesForStore()
                                           throws ECException
Finds all the defined Payment Policies for the Store.
Throws:
ECException

findPaymentPoliciesForSupportedCassettes

protected void findPaymentPoliciesForSupportedCassettes()
                                                 throws ECException
Find the Payment Policies for each of the Supported Cassettes for the Store. This will be a subset of the set of defined policies for the Store.
Throws:
ECException.
ECException

findSupportedCassettesAndAccountsForStore

protected void findSupportedCassettesAndAccountsForStore()
                                                  throws ECException
Finds the supported Cassettes and WebSphere Commerce Payments Merchant Accounts for the Store.
Throws:
ECException

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:
any String message received during population of the DataBean or the empty String if no message has been received.

getNonPMPaymentPolicyInfo

public PaymentPolicyInfo[] getNonPMPaymentPolicyInfo()
Returns an array of PaymentPolicyInfo for the Store representing the set of non-cassette based Payment Policies configured and usable by the Store.

This method returns a zero-length array if there is no non-cassette based Payment Policy that is usable by the Store.

Returns:
an array of PaymentPolicyInfo.
See Also:
PaymentPolicyInfo.

getPaymentPolicyInfoUsableWithoutTA

public PaymentPolicyInfo[] getPaymentPolicyInfoUsableWithoutTA(java.lang.String astrCurrency)
Returns an array of PaymentPolicyInfo representing Payment Policies usable by the specified Store. The specified currency is intended to filter out Payment Policies that are known to not support certain currency. It is NOT a guarantee that Payment Policies returned will definitely support the specified currency.
Returns:
an array of PaymentPolicyInfo bean.

getPaymentSystemException

public java.lang.Exception getPaymentSystemException()
Returns any Exception thrown by the Payment System during the population of the List 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.

getPMPaymentPolicyInfo

public PaymentPolicyInfo[] getPMPaymentPolicyInfo()
Returns an array of PaymentPolicyInfo for the Store representing the set of cassette-based Payment Policies configured and usable by the Store.

This method returns a zero-length array if there is no configured Payment Policy usable by the Store or if there is a problem obtaining the infomation from WebSphere Commerce Payments.

Returns:
an array of PaymentPolicyInfo.
See Also:
PaymentPolicyInfo.

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 WebSphere Commerce Payments QueryAccounts command or -1 if an error occurred before the QueryAccounts 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 WebSphere Commerce Payments QueryAccounts command or -1 if an error occurred before the QueryAccounts command was issued.

getStoreId

protected java.lang.Integer getStoreId()
Returns the storeId property of the Bean
Returns:
the Store ID

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

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 returned by the Payment System

setPolicyName

public void setPolicyName(java.lang.String aPolicyName)
Optionally specify the name of the payment policy you wish to request for information. If no name is specified, information on all payment policies for which the Store is configured will be retrieved.

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 as returned from the WebSphere Commerce Payments 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 as returned from the WebSphere Commerce Payments QueryOrders command.

setStoreId

public void setStoreId(java.lang.Integer aStoreId)
Sets the Store ID for which the list of usable Payment Policies are requested.
Parameters:
aStoreId - the Store ID.