atg.commerce.order.purchase
Class PaymentGroupDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.commerce.order.purchase.PaymentGroupDroplet
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class PaymentGroupDroplet
extends DynamoServlet

The PaymentGroupDroplet is a DynamoServlet that is used to initialize payment methods and CommerceIdentifierPaymentInfo objects for use by the PaymentGroupFormHandler. The PaymentGroupDroplet is composed of the following containers:

PaymentGroupMapContainer - container for the user's named PaymentGroups

CommerceIdentifierPaymentInfoContainer - container for the user's CommerceIdentifierPaymentInfo objects for a particular Order's CommerceIdentifiers

The service method ensures the following:

PaymentGroup initialization - the user's authorized payment methods are added by type to the PaymentGroupMapContainer. Once this is done the user can begin to select from these during the billing checkout process. The PaymentGroupInitializers ServiceMap is a registry of PaymentGroup types to components that implement the PaymentGroupInitializer interface. PaymentGroupInitializer components are ultimately responsible for creating the appropriate PaymentGroups, initializing them as appropriate for the user, and adding them to the PaymentGroupMapContainer.

CommerceIdentifierPaymentInfo initialization - the Order CommerceIdentifiers of interest are used to instantiate CommerceIdentifierPaymentInfo objects, and these are added to the CommerceIdentifierPaymentInfoContainer.

A complete description of the parameters to the PaymentGroupDroplet are:

order
This parameter may be used to override the component's default setting for the user's order. For convenience the user's Order is also exposed as an output parameter.
clearPaymentInfos
When set to true this parameter will clear the user's CommerceIdentifierPaymentInfoContainer. This should be done at least once per new order.
clearPaymentGroups
When set to true this parameter will clear the user's PaymentGroupMapContainer.
clear
When set to true this parameter will clear both the CommerceIdentifierPaymentInfoContainer and the PaymentGroupMapContainer.
initPaymentGroups
When this parameter is set to true, the designated PaymentGroup types will be initialized.
paymentGroupTypes
This comma separated list of PaymentGroup types is used to determine which PaymentGroupInitializer components are executed. Each possible PaymentGroup type is configured to reference a PaymentGroupInitializer component in the PaymentGroupInitializers ServiceMap.
initItemPayment
When set to true this parameter will create a CommerceItemPaymentInfo for each CommerceItem in the Order. These are then added to the CommerceIdentifierPaymentInfoContainer. The CommerceItemPaymentInfo is a CommerceIdentifierPaymentInfo used for CommerceItem payment information.
initShippingPayment
When set to true this parameter will create a ShippingGroupPaymentInfo for each ShippingGroup in the Order. These are then added to the CommerceIdentifierPaymentInfoContainer. The ShippingGroupPaymentInfo is a CommerceIdentifierPaymentInfo used for ShippingGroup payment information.
initTaxPayment
When set to true this parameter will create a TaxPaymentInfo and add it to the CommerceIdentifierPaymentInfoContainer. The TaxPaymentInfo is a CommerceIdentifierPaymentInfo used for tax payment information.
initOrderPayment
When set to true this parameter will create an OrderPaymentInfo and add it to the CommerceIdentifierPaymentInfoContainer. The OrderPaymentInfo is a CommerceIdentifierPaymentInfo used for Order payment information.
initBasedOnOrder
When set to true this parameter will create a CommerceIdentifierPaymentInfo for each payment group relationhip in the order. The payment group relationship could be of any of the follwing types such as CommerceItem, ShippingGroup and Order. If there is any payment group relationship in the order, this paramter creates a CommerceIdentifierPaymentInfo for each payment group relationship. This parameter creates a TaxPaymentInfo, OrderPaymentInfo, ShippingGroupPaymentInfo or CommerceItemPaymentInfo based on payment relationship type.
createAllPaymentInfos
When set to true this parameter will check to see if any CommerceIdentifierPaymentInfo exists for each CommerceIdentifier ( Order, CommerceItem, ShippingGroup and Tax) and this parameter will create all possible combinations (one CommerceIdentifierPaymentInfo per PaymentGroup).
paymentGroups
This output parameter is set to the Map referenced by the PaymentGroupMapContainer.
paymentInfos
This output parameter is set to the Map refereneced by the CommerceIdentifierPaymentInfoMap.

Example Usage with initBasedOnOrder, createAllPaymentInfos and initOrderPayment

  
    
    
    
    
    
    
    
    
  
 
The above example initializes Credit Card and Store Credit payment groups and initializes CommerceIdentifierPaymentInfos based on the order relationships. If there are no relationships or payment groups exists in the order, a CommerceIdentifierPaymentInfo is added based on the Profile's default payment group. Also note that the createAllPaymentInfos is true. During the initial page rendering, the PaymentGroupMapContainer and CommerceIdentifierPaymentInfoContainer are initialized and CommerceIdentifierPaymentInfos are created. After the initial rendering if there is any new PaymentGroup is added to the container, then the CommerceIdentifierPaymentInfo is created for the newly created PaymentGroup.


Field Summary
static java.lang.String CIPI_MAP
           
static java.lang.String CLASS_VERSION
           
static ParameterName CLEAR_ALL
           
static ParameterName CLEAR_PAYMENT_GROUPS
           
static ParameterName CLEAR_PAYMENT_INFOS
           
static ParameterName CREATE_ALL_PAYMENT_INFOS
           
static ParameterName INIT_BASED_ON_ORDER
           
static ParameterName INIT_ITEM_PAYMENT
           
static ParameterName INIT_ORDER_PAYMENT
           
static ParameterName INIT_PAYMENT_GROUPS
           
static ParameterName INIT_SHIPPING_PAYMENT
           
static ParameterName INIT_TAX_PAYMENT
           
static java.lang.String ORDER
           
static java.lang.String OUTPUT
           
static ParameterName PAYMENT_GROUP_TYPES
           
static java.lang.String PAYMENT_GROUPS
           
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
PaymentGroupDroplet()
          Creates a new PaymentGroupDroplet instance.
 
Method Summary
 void addMissingCommerceIdentifierPaymentInfos(java.util.List pCommerceIdentifierPaymentInfos)
          This method checks for CommerceIdentifierPaymentInfo entry for each payment group.
protected  void consolidatePaymentInfos(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          consolidatePaymentInfos consolidates CommerceIdentifierPaymentInfos by ensuring there is no redundant data.
protected  void copyConfiguration()
          Copy property settings from the optional PurchaseProcessConfiguration component.
 void createAllCommerceIdentifierPaymentInfos()
          This method checks to see if there is any existance of CommerceIdentifierPaymentInfo for each CommerceIdentifier ( Order, CommerceItem, Shipping Group and Tax) and if there is any CommerceIdentifierPaymentInfo exists for a CommerceIdentifier, then this method creates all possible combination of CommerceIdentifierPaymentInfo for each CommerceIdentifier.
 void doStartService()
          Perform one-time startup operations, including copying property settings from the optional PurchaseProcessConfiguration component.
 CommerceIdentifierPaymentInfoContainer getCommerceIdentifierPaymentInfoContainer()
          Return the CommerceIdentifierPaymentInfoContainer property.
 PurchaseProcessConfiguration getConfiguration()
          Returns property Configuration
 PaymentGroup getDefaultPaymentGroup()
          The getDefaultPaymentGroupName method returns the default PaymentGroup based on the PaymentGroupMapContainer's default PaymentGroup name.
 java.lang.String getNewPaymentGroupName(PaymentGroup pPaymentGroup)
          This utility method gets the payment group name or nickname for the payment group that is passed in.
 Order getOrder()
          Return the Order property.
 ServiceMap getPaymentGroupInitializers()
          Return the PaymentGroupInitializers property.
 PaymentGroupManager getPaymentGroupManager()
          Return the PaymentGroupManager property.
 PaymentGroupMapContainer getPaymentGroupMapContainer()
          Return the PaymentGroupMapContainer property.
 java.lang.String getPaymentGroupName(PaymentGroup pPaymentGroup)
          This method iterates throug the payment groups and finds the matching payment group and its name.
 java.lang.String getPaymentGroupTypes()
          Return the PaymentGroupTypes property.
 Profile getProfile()
          Return the Profile property.
protected  void initializeBasedOnOrder(Order pOrder)
          The initializeBasedOnOrder method creates CommerceIdentifierPaymentInfo objects that reflect the current payment information in the order.
 void initializeCommerceIdentifierPayment(Order pOrder)
          This method initializes payment infos for preferred commerce identifies such as Order, CommerceItem,ShippingGroup or Tax.
 void initializeCommerceIdentifierPaymentInfos(PaymentGroupRelationshipContainer pContainer)
          This method initializes CommerceIdentifierPaymentInfo with the information available from order's relationship objects.
protected  void initializeItemPayment(Order pOrder)
          The initializeItemPayment method creates a CommerceItemPaymentInfo for each CommerceItem in the Order.
protected  void initializeOrderPayment(Order pOrder)
          The initializeOrderPayment method creates an OrderPaymentInfo, which is a CommerceIdentifierPaymentInfo used for Order payment information.
protected  void initializePaymentInfos(DynamoHttpServletRequest pRequest, Order pOrder)
          initializePaymentInfos creates CommerceIdentifierPaymentInfo objects for the Order, the Order's CommerceItems, the Order's ShippingGroups, and the tax.
protected  void initializeRequestParameters(DynamoHttpServletRequest pRequest)
          The initializeRequestParameters method gathers the necessary input parameters and uses them to adjust initialization requirements.
protected  void initializeShippingPayment(Order pOrder)
          The initializeShippingPayment method creates a ShippingGroupPaymentInfo for each ShippingGroup in the Order.
protected  void initializeTaxPayment(Order pOrder)
          The initializeTaxPayment method creates a TaxPaymentInfo, which is a CommerceIdentifierPaymentInfo used for tax payment information.
protected  void initializeUserPaymentMethods(DynamoHttpServletRequest pRequest, Profile pProfile)
          initializeUserPaymentMethods is used to add the user's payment methods to the PaymentGroupMapContainer.
 boolean isAnyPaymentInfoExistsInContainter()
          This method checks to see if there is any payment infos.
 boolean isClearAll()
          Return the ClearAll property.
 boolean isClearPaymentGroups()
          Return the ClearPaymentGroups property.
 boolean isClearPaymentInfos()
          Return the ClearPaymentInfos property.
 boolean isCreateAllPaymentInfos()
           
 boolean isInitBasedOnOrder()
          Return the InitBasedOnOrder property.
 boolean isInitItemPayment()
          Return the InitItemPayment property.
 boolean isInitOrderPayment()
          Return the InitOrderPayment property.
 boolean isInitPaymentGroups()
          Return the InitPaymentGroups property.
 boolean isInitShippingPayment()
          Return the InitShippingPayment property.
 boolean isInitTaxPayment()
          Return the InitTaxPayment property.
protected  CommerceIdentifierPaymentInfo mergeCommerceIdentifierPaymentInfos(CommerceIdentifierPaymentInfo cipi1, CommerceIdentifierPaymentInfo cipi2)
          mergeCommerceIdentifierPaymentInfos merges 2 CommerceIdentifierPaymentInfos into one by combining their amounts and quantities.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This service method is used to initialize PaymentGroups and CommerceIdentifierPaymentInfo objects.
 void setClearAll(boolean pClearAll)
          Set the ClearAll property.
 void setClearPaymentGroups(boolean pClearPaymentGroups)
          Set the ClearPaymentGroups property.
 void setClearPaymentInfos(boolean pClearPaymentInfos)
          Set the ClearPaymentInfos property.
 void setCommerceIdentifierPaymentInfoContainer(CommerceIdentifierPaymentInfoContainer pCommerceIdentifierPaymentInfoContainer)
          Set the CommerceIdentifierPaymentInfoContainer property.
 void setConfiguration(PurchaseProcessConfiguration pConfiguration)
          Sets property Configuration
 void setCreateAllPaymentInfos(boolean pCreateAllPaymentInfos)
           
 void setInitBasedOnOrder(boolean pInitBasedOnOrder)
          Set the InitBasedOnOrder property.
 void setInitItemPayment(boolean pInitItemPayment)
          Set the InitItemPayment property.
 void setInitOrderPayment(boolean pInitOrderPayment)
          Set the InitOrderPayment property.
 void setInitPaymentGroups(boolean pInitPaymentGroups)
          Set the InitPaymentGroups property.
 void setInitShippingPayment(boolean pInitShippingPayment)
          Set the InitShippingPayment property.
 void setInitTaxPayment(boolean pInitTaxPayment)
          Set the InitTaxPayment property.
 void setOrder(Order pOrder)
          Set the Order property.
 void setPaymentGroupInitializers(ServiceMap pPaymentGroupInitializers)
          Set the PaymentGroupInitializers property.
 void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
          Set the PaymentGroupManager property.
 void setPaymentGroupMapContainer(PaymentGroupMapContainer pPaymentGroupMapContainer)
          Set the PaymentGroupMapContainer property.
 void setPaymentGroupTypes(java.lang.String pPaymentGroupTypes)
          Set the PaymentGroupTypes property.
 void setProfile(Profile pProfile)
          Set the Profile property.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

INIT_PAYMENT_GROUPS

public static final ParameterName INIT_PAYMENT_GROUPS

PAYMENT_GROUP_TYPES

public static final ParameterName PAYMENT_GROUP_TYPES

INIT_ITEM_PAYMENT

public static final ParameterName INIT_ITEM_PAYMENT

INIT_SHIPPING_PAYMENT

public static final ParameterName INIT_SHIPPING_PAYMENT

INIT_ORDER_PAYMENT

public static final ParameterName INIT_ORDER_PAYMENT

INIT_TAX_PAYMENT

public static final ParameterName INIT_TAX_PAYMENT

INIT_BASED_ON_ORDER

public static final ParameterName INIT_BASED_ON_ORDER

CLEAR_ALL

public static final ParameterName CLEAR_ALL

CLEAR_PAYMENT_INFOS

public static final ParameterName CLEAR_PAYMENT_INFOS

CLEAR_PAYMENT_GROUPS

public static final ParameterName CLEAR_PAYMENT_GROUPS

CREATE_ALL_PAYMENT_INFOS

public static final ParameterName CREATE_ALL_PAYMENT_INFOS

PAYMENT_GROUPS

public static final java.lang.String PAYMENT_GROUPS
See Also:
Constant Field Values

CIPI_MAP

public static final java.lang.String CIPI_MAP
See Also:
Constant Field Values

ORDER

public static final java.lang.String ORDER
See Also:
Constant Field Values

OUTPUT

public static final java.lang.String OUTPUT
See Also:
Constant Field Values
Constructor Detail

PaymentGroupDroplet

public PaymentGroupDroplet()
Creates a new PaymentGroupDroplet instance.

Method Detail

setConfiguration

public void setConfiguration(PurchaseProcessConfiguration pConfiguration)
Sets property Configuration

Parameters:
pConfiguration - a PurchaseProcessConfiguration value

getConfiguration

public PurchaseProcessConfiguration getConfiguration()
Returns property Configuration

Returns:
a PurchaseProcessConfiguration value

setPaymentGroupManager

public void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Set the PaymentGroupManager property.

Parameters:
pPaymentGroupManager - a PaymentGroupManager value

getPaymentGroupManager

public PaymentGroupManager getPaymentGroupManager()
Return the PaymentGroupManager property.

Returns:
a PaymentGroupManager value

setPaymentGroupTypes

public void setPaymentGroupTypes(java.lang.String pPaymentGroupTypes)
Set the PaymentGroupTypes property.

Parameters:
pPaymentGroupTypes - a String value

getPaymentGroupTypes

public java.lang.String getPaymentGroupTypes()
Return the PaymentGroupTypes property.

Returns:
a String value

setPaymentGroupInitializers

public void setPaymentGroupInitializers(ServiceMap pPaymentGroupInitializers)
Set the PaymentGroupInitializers property.

Parameters:
pPaymentGroupInitializers - a ServiceMap value

getPaymentGroupInitializers

public ServiceMap getPaymentGroupInitializers()
Return the PaymentGroupInitializers property.

Returns:
a ServiceMap value

setInitPaymentGroups

public void setInitPaymentGroups(boolean pInitPaymentGroups)
Set the InitPaymentGroups property.

Parameters:
pInitPaymentGroups - a boolean value

isInitPaymentGroups

public boolean isInitPaymentGroups()
Return the InitPaymentGroups property.

Returns:
a boolean value

setOrder

public void setOrder(Order pOrder)
Set the Order property.

Parameters:
pOrder - an Order value

getOrder

public Order getOrder()
Return the Order property.

Returns:
an Order value

setProfile

public void setProfile(Profile pProfile)
Set the Profile property.

Parameters:
pProfile - a Profile value

getProfile

public Profile getProfile()
Return the Profile property.

Returns:
a Profile value

setClearPaymentInfos

public void setClearPaymentInfos(boolean pClearPaymentInfos)
Set the ClearPaymentInfos property.

Parameters:
pClearPaymentInfos - a boolean value

isClearPaymentInfos

public boolean isClearPaymentInfos()
Return the ClearPaymentInfos property.

Returns:
a boolean value

setClearPaymentGroups

public void setClearPaymentGroups(boolean pClearPaymentGroups)
Set the ClearPaymentGroups property.

Parameters:
pClearPaymentGroups - a boolean value

isClearPaymentGroups

public boolean isClearPaymentGroups()
Return the ClearPaymentGroups property.

Returns:
a boolean value

setClearAll

public void setClearAll(boolean pClearAll)
Set the ClearAll property.

Parameters:
pClearAll - a boolean value

isClearAll

public boolean isClearAll()
Return the ClearAll property.

Returns:
a boolean value

setInitItemPayment

public void setInitItemPayment(boolean pInitItemPayment)
Set the InitItemPayment property.

Parameters:
pInitItemPayment - a boolean value

isInitItemPayment

public boolean isInitItemPayment()
Return the InitItemPayment property.

Returns:
a boolean value

setInitShippingPayment

public void setInitShippingPayment(boolean pInitShippingPayment)
Set the InitShippingPayment property.

Parameters:
pInitShippingPayment - a boolean value

isInitShippingPayment

public boolean isInitShippingPayment()
Return the InitShippingPayment property.

Returns:
a boolean value

setInitOrderPayment

public void setInitOrderPayment(boolean pInitOrderPayment)
Set the InitOrderPayment property.

Parameters:
pInitOrderPayment - a boolean value

isInitOrderPayment

public boolean isInitOrderPayment()
Return the InitOrderPayment property.

Returns:
a boolean value

setInitTaxPayment

public void setInitTaxPayment(boolean pInitTaxPayment)
Set the InitTaxPayment property.

Parameters:
pInitTaxPayment - a boolean value

isInitTaxPayment

public boolean isInitTaxPayment()
Return the InitTaxPayment property.

Returns:
a boolean value

setInitBasedOnOrder

public void setInitBasedOnOrder(boolean pInitBasedOnOrder)
Set the InitBasedOnOrder property. This defines whether the initialization of the maps should be based on the ShippingGroupCommerceItemRelationships currently contained in the order.

Parameters:
pInitBasedOnOrder - a boolean value

isInitBasedOnOrder

public boolean isInitBasedOnOrder()
Return the InitBasedOnOrder property.

Returns:
a boolean value

setCommerceIdentifierPaymentInfoContainer

public void setCommerceIdentifierPaymentInfoContainer(CommerceIdentifierPaymentInfoContainer pCommerceIdentifierPaymentInfoContainer)
Set the CommerceIdentifierPaymentInfoContainer property.

Parameters:
pCommerceIdentifierPaymentInfoContainer - a CommerceIdentifierPaymentInfoContainer value

getCommerceIdentifierPaymentInfoContainer

public CommerceIdentifierPaymentInfoContainer getCommerceIdentifierPaymentInfoContainer()
Return the CommerceIdentifierPaymentInfoContainer property.

Returns:
a CommerceIdentifierPaymentInfoContainer value

setPaymentGroupMapContainer

public void setPaymentGroupMapContainer(PaymentGroupMapContainer pPaymentGroupMapContainer)
Set the PaymentGroupMapContainer property.

Parameters:
pPaymentGroupMapContainer - a PaymentGroupMapContainer value

getPaymentGroupMapContainer

public PaymentGroupMapContainer getPaymentGroupMapContainer()
Return the PaymentGroupMapContainer property.

Returns:
a PaymentGroupMapContainer value

isCreateAllPaymentInfos

public boolean isCreateAllPaymentInfos()
Returns:
Returns the createAllPaymentInfos.

setCreateAllPaymentInfos

public void setCreateAllPaymentInfos(boolean pCreateAllPaymentInfos)
Parameters:
pCreateAllPaymentInfos - The createAllPaymentInfos to set.

initializeUserPaymentMethods

protected void initializeUserPaymentMethods(DynamoHttpServletRequest pRequest,
                                            Profile pProfile)
initializeUserPaymentMethods is used to add the user's payment methods to the PaymentGroupMapContainer. For each entry in the PaymentGroupTypes, its corresponding PaymentGroupInitializer is obtained from the PaymentGroupInitializers ServiceMap and its initializePaymentGroups method executed.

Parameters:
pRequest - a DynamoHttpServletRequest value
pProfile - a Profile value

initializePaymentInfos

protected void initializePaymentInfos(DynamoHttpServletRequest pRequest,
                                      Order pOrder)
initializePaymentInfos creates CommerceIdentifierPaymentInfo objects for the Order, the Order's CommerceItems, the Order's ShippingGroups, and the tax. These objects are added to the CommerceIdentifierPaymentInfoContainer.

Parameters:
pRequest - a DynamoHttpServletRequest value
pOrder - an Order value

initializeCommerceIdentifierPayment

public void initializeCommerceIdentifierPayment(Order pOrder)
This method initializes payment infos for preferred commerce identifies such as Order, CommerceItem,ShippingGroup or Tax. This will be set based on the droplet input parameter. This droplet has commerceidentifier level input paramter such as initOrderPayment, initTaxPayment, initShippingPayment and initItemPayment.

Parameters:
pOrder -

createAllCommerceIdentifierPaymentInfos

public void createAllCommerceIdentifierPaymentInfos()
This method checks to see if there is any existance of CommerceIdentifierPaymentInfo for each CommerceIdentifier ( Order, CommerceItem, Shipping Group and Tax) and if there is any CommerceIdentifierPaymentInfo exists for a CommerceIdentifier, then this method creates all possible combination of CommerceIdentifierPaymentInfo for each CommerceIdentifier.


addMissingCommerceIdentifierPaymentInfos

public void addMissingCommerceIdentifierPaymentInfos(java.util.List pCommerceIdentifierPaymentInfos)
This method checks for CommerceIdentifierPaymentInfo entry for each payment group. If there is an entry missing for a payment group, this method add a empty CommerceIdentifierPaymentInfo for that payment group.

Parameters:
pCommerceIdentifierPaymentInfos -

initializeItemPayment

protected void initializeItemPayment(Order pOrder)
The initializeItemPayment method creates a CommerceItemPaymentInfo for each CommerceItem in the Order. A CommerceItemPaymentInfo is a CommerceIdentifierPaymentInfo used for CommerceItem payment information. This also removes any CommerceIdentifierPaymentInfo objects previously associated with each CommerceItem.

Parameters:
pOrder - an Order value

initializeShippingPayment

protected void initializeShippingPayment(Order pOrder)
The initializeShippingPayment method creates a ShippingGroupPaymentInfo for each ShippingGroup in the Order. A ShippingGroupPaymentInfo is a CommerceIdentifierPaymentInfo used for ShippingGroup payment information. This also removes any CommerceIdentifierPaymentInfo objects previously associated with each ShippingGroup.

Parameters:
pOrder - an Order value

initializeOrderPayment

protected void initializeOrderPayment(Order pOrder)
The initializeOrderPayment method creates an OrderPaymentInfo, which is a CommerceIdentifierPaymentInfo used for Order payment information. This also removes any CommerceIdentifierPaymentInfo objects previously associated with the Order.

Parameters:
pOrder - an Order value

initializeTaxPayment

protected void initializeTaxPayment(Order pOrder)
The initializeTaxPayment method creates a TaxPaymentInfo, which is a CommerceIdentifierPaymentInfo used for tax payment information. This also removes any CommerceIdentifierPaymentInfo objects previously associated with the Order.

Parameters:
pOrder - an Order value

initializeBasedOnOrder

protected void initializeBasedOnOrder(Order pOrder)
The initializeBasedOnOrder method creates CommerceIdentifierPaymentInfo objects that reflect the current payment information in the order.

Parameters:
pOrder - an Order value

initializeCommerceIdentifierPaymentInfos

public void initializeCommerceIdentifierPaymentInfos(PaymentGroupRelationshipContainer pContainer)
This method initializes CommerceIdentifierPaymentInfo with the information available from order's relationship objects.

Parameters:
pContainer -

getPaymentGroupName

public java.lang.String getPaymentGroupName(PaymentGroup pPaymentGroup)
This method iterates throug the payment groups and finds the matching payment group and its name.

Parameters:
pPaymentGroup -
Returns:

getNewPaymentGroupName

public java.lang.String getNewPaymentGroupName(PaymentGroup pPaymentGroup)
This utility method gets the payment group name or nickname for the payment group that is passed in. The nickname generator is available in the CommerceProfileTools. Based on the rules setup in the nickname generator, the nickname will be generator. Let us assume that a credit card has the following type and credit card number. Credit card type and number is ==> Visa, 4111111111111111 The nickname generator uses ( CreditCard.getCreditCardType()+ " - " + last four digits of CreditCard.getCreditCardNumber().

Parameters:
pPaymentGroup -
Returns:

initializeRequestParameters

protected void initializeRequestParameters(DynamoHttpServletRequest pRequest)
The initializeRequestParameters method gathers the necessary input parameters and uses them to adjust initialization requirements.

Parameters:
pRequest - a DynamoHttpServletRequest value

getDefaultPaymentGroup

public PaymentGroup getDefaultPaymentGroup()
The getDefaultPaymentGroupName method returns the default PaymentGroup based on the PaymentGroupMapContainer's default PaymentGroup name. Any .jhtml form can manipulate this property directly.

Returns:
a String value

copyConfiguration

protected void copyConfiguration()
Copy property settings from the optional PurchaseProcessConfiguration component. Property values that were configured locally are preserved. Configures the following properties (if not already set):


doStartService

public void doStartService()
                    throws ServiceException
Perform one-time startup operations, including copying property settings from the optional PurchaseProcessConfiguration component.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
This service method is used to initialize PaymentGroups and CommerceIdentifierPaymentInfo objects. Initialization is based on input parameters describing which PaymentGroups and CommerceIdentifierPaymentInfo objects, if any, should be created and added to the appropriate container. The resulting Collections of PaymentGroups and CommerceIdentifierPaymentInfos are exposed via output parameters.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

consolidatePaymentInfos

protected void consolidatePaymentInfos(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
consolidatePaymentInfos consolidates CommerceIdentifierPaymentInfos by ensuring there is no redundant data.

Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

mergeCommerceIdentifierPaymentInfos

protected CommerceIdentifierPaymentInfo mergeCommerceIdentifierPaymentInfos(CommerceIdentifierPaymentInfo cipi1,
                                                                            CommerceIdentifierPaymentInfo cipi2)
mergeCommerceIdentifierPaymentInfos merges 2 CommerceIdentifierPaymentInfos into one by combining their amounts and quantities.

Parameters:
cipi1 - a CommerceIdentifierPaymentInfo value
cipi2 - a CommerceIdentifierPaymentInfo value
Returns:
a CommerceIdentifierPaymentInfo value

isAnyPaymentInfoExistsInContainter

public boolean isAnyPaymentInfoExistsInContainter()
This method checks to see if there is any payment infos. If there is any cipi in the container, this method returns true otherwise false. The cipi could be in any level. The cipi could be in the Order, CommerceItem, ShippingGroup or Tax level. If any cipi found this method returns true and if no cipi found, then this method returns false.

Returns:
true/false based on the the existance of any cipi in the container