atg.commerce.order.purchase
Class PaymentGroupFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.commerce.order.purchase.PurchaseProcessFormHandler
                      extended by atg.commerce.order.purchase.PaymentGroupFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, DropletFormHandler, 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, java.util.EventListener

public class PaymentGroupFormHandler
extends PurchaseProcessFormHandler

The PaymentGroupFormHandler is used to associate PaymentGroups with the various Order pieces. This component is used during the Order checkout process, and any Order successfully processed by the PaymentGroupFormHandler is ready for the next checkout phase, which may be confirmation.

The PaymentGroupFormHandler is composed of the following containers:
PaymentGroupMapContainer - container for the user's authorized PaymentGroups
CommerceIdentifierPaymentInfoContainer - container for the user's CommerceIdentifierPaymentInfo objects for a particular Order's CommerceIdentifiers

There are 3 main handler methods in the PaymentGroupFormHandler, handleSplitPaymentInfos, handleApplyPaymentGroups and handleSpecifyDefaultPaymentGroup:

  1. handleSplitPaymentInfos splits extra CommerceIdentifierPaymentInfo objects by amount. In a form the user might request to split $50 of an original CommerceIdentifier amount of $100 onto a separate payment method. This will create a separate CommerceIdentifierPaymentInfo object, and adjust the amount of both the original and the new CommerceIdentifierPaymentInfo objects to add up to the original CommerceIdentifier total amount.
  2. handleApplyPaymentGroups is used when the CommerceIdentifierPaymentInfo associations created by the user are ready to be applied to the current Order. The associations are scrutinized and the appropriate business methods are called in the OrderManager family. PaymentGroup validation takes place, via a configurable Pipeline chain.
  3. handleSpecifyDefaultPaymentGroup is used to specify a particular default PaymentGroup to be used for CommerceIdentifiers that aren't explicitly assigned separate PaymentGroups.

In order to conveniently manipulate PaymentGroups and CommerceIdentifierPaymentInfo Lists, you can set the ListId and PaymentGroupId properties. This will automatically expose the corresponding PaymentGroup and List in the CurrentList and CurrentPaymentGroup properties.

See Also:
GenericFormHandler, PurchaseProcessFormHandler

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String MSG_INVALID_PAYMENT_SPLIT_NUMBER
           
static java.lang.String MSG_NO_DEFAULT_PAYMENT_GROUP
           
 
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
LOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUE
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
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
PaymentGroupFormHandler()
          Creates a new PaymentGroupFormHandler instance.
 
Method Summary
protected  void applyCommerceIdentifierPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo, Order order)
          applyCommerceIdentifierPaymentInfo takes the supplied payment information and update the Order.
protected  void applyDefaultPaymentGroup(Order pOrder)
          applyDefaultPaymentGroup checks to see if there is a defaultPaymentGroup.
protected  void applyPaymentGroups(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          applyPaymentGroups iterates over the supplied CommerceIdentifierPaymentInfos for each of the CommerceIdentifiers.
protected  CommerceIdentifierPaymentInfo createSpecificPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo)
          The createSpecificPaymentInfo method takes a CommerceIdentifierPaymentInfo and creates a new one whose subtype matches that of the original.
 java.lang.String getApplyPaymentGroupsErrorURL()
          Return the ApplyPaymentGroupsErrorURL property.
 java.lang.String getApplyPaymentGroupsSuccessURL()
          Return the ApplyPaymentGroupsSuccessURL property.
 java.util.List getCurrentList()
          Return the CurrentList property.
 PaymentGroup getCurrentPaymentGroup()
          Return the CurrentPaymentGroup property.
 java.lang.String getDefaultPaymentGroupName()
          Return the DefaultPaymentGroupName property.
 java.lang.String getListId()
          Return the ListId property.
protected  PaymentGroup getPaymentGroup(java.lang.String pPaymentMethod)
          getPaymentGroup gets the PaymentGroup with the given name from the PaymentGroupMapContainer.
 java.lang.String getPaymentGroupId()
          Return the PaymentGroupId property.
 java.lang.String getSpecifyDefaultPaymentGroupErrorURL()
          Return the SpecifyDefaultPaymentGroupErrorURL property.
 java.lang.String getSpecifyDefaultPaymentGroupSuccessURL()
          Return the SpecifyDefaultPaymentGroupSuccessURL property.
 java.lang.String getSplitPaymentInfosErrorURL()
          Return the SplitPaymentInfosErrorURL property.
 java.lang.String getSplitPaymentInfosSuccessURL()
          Return the SplitPaymentInfosSuccessURL property.
 java.lang.String getValidatePaymentGroupsChainId()
          Return the ValidatePaymentGroupsChainId property.
 boolean handleApplyPaymentGroups(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleApplyPaymentGroups is used when the user has supplied the payment information for this order, and is ready to proceed with the next checkout phase.
 boolean handleSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleSpecifyDefaultPaymentGroup is used to let the user specify a default PaymentGroup to use for payment.
 boolean handleSplitPaymentInfos(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleSplitPaymentInfos is used when the user is ready to split a particular CommerceIdentifierPaymentInfo by amount.
 boolean isAllowPaymentGroupsWithZeroAmount()
          This Flag is added to support backward compatibiity.
 boolean isApplyDefaultPaymentGroup()
          Return the ApplyDefaultPaymentGroup property.
protected  boolean isPaymentGroupInOrder(Order pOrder, java.lang.String pPaymentGroupId)
          Deprecated. This method is moved to PaymentGroupManager
 void postApplyPaymentGroups(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          postApplyPaymentGroups is for work that must happen after the PaymentGroups are applied to the Order.
 void postSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          postSpecifyDefaultPaymentGroup is for work that must happen after the default PaymentGroup is set.
 void postSplitPaymentInfos(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          postSplitPaymentInfos is for work that must happen after the CommerceIdentifierPaymentInfos are split.
 void preApplyPaymentGroups(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          preApplyPaymentGroups is for work that must happen before the PaymentGroups are applied to the Order.
 void preSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          preSpecifyDefaultPaymentGroup is for work that must happen before the default PaymentGroup is set.
 void preSplitPaymentInfos(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          preSplitPaymentInfos is for work that must happen before the CommerceIdentifierPaymentInfos are split.
protected  void runProcessValidatePaymentGroups(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          runProcessValidatePaymentGroups runs a configurable Pipeline chain to validate PaymentGroups or to prepare for the next checkout phase.
 void setAllowPaymentGroupsWithZeroAmount(boolean pAllowPaymentGroupsWithZeroAmount)
          This Flag is added to support backward compatibiity.
 void setApplyDefaultPaymentGroup(boolean pApplyDefaultPaymentGroup)
          Set the ApplyDefaultPaymentGroup property.
 void setApplyPaymentGroupsErrorURL(java.lang.String pApplyPaymentGroupsErrorURL)
          Set the ApplyPaymentGroupsErrorURL property.
 void setApplyPaymentGroupsSuccessURL(java.lang.String pApplyPaymentGroupsSuccessURL)
          Set the ApplyPaymentGroupsSuccessURL property.
 void setCurrentList(java.util.List pCurrentList)
          Set the CurrentList property.
 void setCurrentPaymentGroup(PaymentGroup pCurrentPaymentGroup)
          Set the CurrentPaymentGroup property.
 void setDefaultPaymentGroupName(java.lang.String pDefaultPaymentGroupName)
          Set the DefaultPaymentGroupName property.
 void setListId(java.lang.String pListId)
          Set the ListId property.
 void setPaymentGroupId(java.lang.String pPaymentGroupId)
          Set the PaymentGroupId property.
 void setSpecifyDefaultPaymentGroupErrorURL(java.lang.String pSpecifyDefaultPaymentGroupErrorURL)
          Set the SpecifyDefaultPaymentGroupErrorURL property.
 void setSpecifyDefaultPaymentGroupSuccessURL(java.lang.String pSpecifyDefaultPaymentGroupSuccessURL)
          Set the SpecifyDefaultPaymentGroupSuccessURL property.
 void setSplitPaymentInfosErrorURL(java.lang.String pSplitPaymentInfosErrorURL)
          Set the SplitPaymentInfosErrorURL property.
 void setSplitPaymentInfosSuccessURL(java.lang.String pSplitPaymentInfosSuccessURL)
          Set the SplitPaymentInfosSuccessURL property.
 void setValidatePaymentGroupsChainId(java.lang.String pValidatePaymentGroupsChainId)
          Set the ValidatePaymentGroupsChainId property.
protected  void specifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          specifyDefaultPaymentGroup sets the defaultPaymentGroupName in the PaymentGroupMapContainer.
protected  void splitCommerceIdentifierPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          splitCommerceIdentifierPaymentInfo determines which CommerceIdentifierPaymentInfo objects need to be split, and in what manner.
protected  void splitCommerceIdentifierPaymentInfoByAmount(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo, double pSplitAmount)
          splitCommerceIdentifierPaymentInfoByAmount splits a CommerceIdentifierPaymentInfo by amount.
protected  void splitPaymentInfos(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          splitPaymentInfos gets CommerceIdentifierPaymentInfos ready for split.
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, copyConfiguration, createRepriceParameterMap, defaultLocalLockManager, defaultUserProfile, doStartService, ensureTransaction, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getClaimableManager, getCommerceIdentifierPaymentInfoContainer, getCommerceItemManager, getCommerceItemShippingInfoContainer, getCommerceProfileTools, getCommercePropertyManager, getConfiguration, getCurrentTransaction, getDefaultLocale, getGiftlistManager, getHandlingInstructionManager, getLocalLockManager, getOrder, getOrderManager, getPaymentGroupManager, getPaymentGroupMapContainer, getPipelineManager, getPriceList, getPriceListId, getPriceListManager, getProfile, getProfileRepository, getPurchaseProcessHelper, getRepeatingRequestMonitor, getRepriceOrderChainId, getResourceBundle, getResourceBundle, getResourceBundleName, getSessionExpirationURL, getShippingGroupManager, getShippingGroupMapContainer, getShoppingCart, getTransactionManager, getUserLocale, getUserLocale, getUserPricingModels, handlePipelineError, isEnsureTransaction, isFormSubmission, isTransactionCreated, isTransactionMarkedAsRollBack, isUseLocksAroundTransactions, isUseRequestLocale, processException, processPipelineErrors, releaseTransactionLock, releaseTransactionLock, runProcess, runProcess, runProcess, runProcessRepriceOrder, runProcessRepriceOrder, runRepricingProcess, setClaimableManager, setCommerceIdentifierPaymentInfoContainer, setCommerceItemManager, setCommerceItemShippingInfoContainer, setCommerceProfileTools, setCommercePropertyManager, setConfiguration, setCurrentTransaction, setDefaultLocale, setEnsureTransaction, setGiftlistManager, setHandlingInstructionManager, setLocalLockManager, setOrder, setOrderManager, setPaymentGroupManager, setPaymentGroupMapContainer, setPipelineManager, setPriceListId, setPriceListManager, setProfile, setProfileRepository, setPurchaseProcessHelper, setRepeatingRequestMonitor, setRepriceOrderChainId, setSessionExpirationURL, setShippingGroupManager, setShippingGroupMapContainer, setShoppingCart, setTransactionCreated, setTransactionManager, setTransactionToRollbackOnly, setUseLocksAroundTransactions, setUseRequestLocale, setUserLocale, setUserPricingModels, transactionLockName, unsetTransactionCreated
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
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

MSG_NO_DEFAULT_PAYMENT_GROUP

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

MSG_INVALID_PAYMENT_SPLIT_NUMBER

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

PaymentGroupFormHandler

public PaymentGroupFormHandler()
Creates a new PaymentGroupFormHandler instance.

Method Detail

isAllowPaymentGroupsWithZeroAmount

public boolean isAllowPaymentGroupsWithZeroAmount()
This Flag is added to support backward compatibiity. Just in case if someone wants to allow payment groups with zero amount, they can turn on this flag. If this flag is set to false, then the payment groups with zero amount is not allowed to be added to the order except if the relationships of the cipis are one of the following:
  1. PAYMENTAMOUNTREMAINING
  2. SHIPPINGAMOUNTREMAINING
  3. ORDERAMOUNTREMAINING
  4. TAXAMOUNTREMAINING

Returns:
the allowPaymentGroupsWithZeroAmount

setAllowPaymentGroupsWithZeroAmount

public void setAllowPaymentGroupsWithZeroAmount(boolean pAllowPaymentGroupsWithZeroAmount)
This Flag is added to support backward compatibiity. Just in case if someone wants to allow payment groups with zero amount, they can turn on this flag. If this flag is set to false, then the payment groups with zero amount is not allowed to be added to the order except if the relationships of the cipis are one of the following:
  1. PAYMENTAMOUNTREMAINING
  2. SHIPPINGAMOUNTREMAINING
  3. ORDERAMOUNTREMAINING
  4. TAXAMOUNTREMAINING

Parameters:
pAllowPaymentGroupsWithZeroAmount - The allowPaymentGroupsWithZeroAmount to set.

setListId

public void setListId(java.lang.String pListId)
Set the ListId property.

Parameters:
pListId - a String value

getListId

public java.lang.String getListId()
Return the ListId property.

Returns:
a String value

setCurrentList

public void setCurrentList(java.util.List pCurrentList)
Set the CurrentList property.

Parameters:
pCurrentList - a List value

getCurrentList

public java.util.List getCurrentList()
Return the CurrentList property.

Returns:
a List value

setPaymentGroupId

public void setPaymentGroupId(java.lang.String pPaymentGroupId)
Set the PaymentGroupId property.

Parameters:
pPaymentGroupId - a String value

getPaymentGroupId

public java.lang.String getPaymentGroupId()
Return the PaymentGroupId property.

Returns:
a String value

setCurrentPaymentGroup

public void setCurrentPaymentGroup(PaymentGroup pCurrentPaymentGroup)
Set the CurrentPaymentGroup property.

Parameters:
pCurrentPaymentGroup - a PaymentGroup value

getCurrentPaymentGroup

public PaymentGroup getCurrentPaymentGroup()
Return the CurrentPaymentGroup property.

Returns:
a PaymentGroup value

setApplyPaymentGroupsSuccessURL

public void setApplyPaymentGroupsSuccessURL(java.lang.String pApplyPaymentGroupsSuccessURL)
Set the ApplyPaymentGroupsSuccessURL property.

Parameters:
pApplyPaymentGroupsSuccessURL - a String value

getApplyPaymentGroupsSuccessURL

public java.lang.String getApplyPaymentGroupsSuccessURL()
Return the ApplyPaymentGroupsSuccessURL property.

Returns:
a String value

setApplyPaymentGroupsErrorURL

public void setApplyPaymentGroupsErrorURL(java.lang.String pApplyPaymentGroupsErrorURL)
Set the ApplyPaymentGroupsErrorURL property.

Parameters:
pApplyPaymentGroupsErrorURL - a String value

getApplyPaymentGroupsErrorURL

public java.lang.String getApplyPaymentGroupsErrorURL()
Return the ApplyPaymentGroupsErrorURL property.

Returns:
a String value

setSplitPaymentInfosSuccessURL

public void setSplitPaymentInfosSuccessURL(java.lang.String pSplitPaymentInfosSuccessURL)
Set the SplitPaymentInfosSuccessURL property.

Parameters:
pSplitPaymentInfosSuccessURL - a String value

getSplitPaymentInfosSuccessURL

public java.lang.String getSplitPaymentInfosSuccessURL()
Return the SplitPaymentInfosSuccessURL property.

Returns:
a String value

setSplitPaymentInfosErrorURL

public void setSplitPaymentInfosErrorURL(java.lang.String pSplitPaymentInfosErrorURL)
Set the SplitPaymentInfosErrorURL property.

Parameters:
pSplitPaymentInfosErrorURL - a String value

getSplitPaymentInfosErrorURL

public java.lang.String getSplitPaymentInfosErrorURL()
Return the SplitPaymentInfosErrorURL property.

Returns:
a String value

setSpecifyDefaultPaymentGroupSuccessURL

public void setSpecifyDefaultPaymentGroupSuccessURL(java.lang.String pSpecifyDefaultPaymentGroupSuccessURL)
Set the SpecifyDefaultPaymentGroupSuccessURL property.

Parameters:
pSpecifyDefaultPaymentGroupSuccessURL - a String value

getSpecifyDefaultPaymentGroupSuccessURL

public java.lang.String getSpecifyDefaultPaymentGroupSuccessURL()
Return the SpecifyDefaultPaymentGroupSuccessURL property.

Returns:
a String value

setSpecifyDefaultPaymentGroupErrorURL

public void setSpecifyDefaultPaymentGroupErrorURL(java.lang.String pSpecifyDefaultPaymentGroupErrorURL)
Set the SpecifyDefaultPaymentGroupErrorURL property.

Parameters:
pSpecifyDefaultPaymentGroupErrorURL - a String value

getSpecifyDefaultPaymentGroupErrorURL

public java.lang.String getSpecifyDefaultPaymentGroupErrorURL()
Return the SpecifyDefaultPaymentGroupErrorURL property.

Returns:
a String value

setValidatePaymentGroupsChainId

public void setValidatePaymentGroupsChainId(java.lang.String pValidatePaymentGroupsChainId)
Set the ValidatePaymentGroupsChainId property.

Parameters:
pValidatePaymentGroupsChainId - a String value

getValidatePaymentGroupsChainId

public java.lang.String getValidatePaymentGroupsChainId()
Return the ValidatePaymentGroupsChainId property.

Returns:
a String value

setApplyDefaultPaymentGroup

public void setApplyDefaultPaymentGroup(boolean pApplyDefaultPaymentGroup)
Set the ApplyDefaultPaymentGroup property.

Parameters:
pApplyDefaultPaymentGroup - a boolean value

isApplyDefaultPaymentGroup

public boolean isApplyDefaultPaymentGroup()
Return the ApplyDefaultPaymentGroup property.

Returns:
a boolean value

setDefaultPaymentGroupName

public void setDefaultPaymentGroupName(java.lang.String pDefaultPaymentGroupName)
Set the DefaultPaymentGroupName property.

Parameters:
pDefaultPaymentGroupName - a String value

getDefaultPaymentGroupName

public java.lang.String getDefaultPaymentGroupName()
Return the DefaultPaymentGroupName property.

Returns:
a String value

handleSplitPaymentInfos

public boolean handleSplitPaymentInfos(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
handleSplitPaymentInfos is used when the user is ready to split a particular CommerceIdentifierPaymentInfo by amount.

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

preSplitPaymentInfos

public void preSplitPaymentInfos(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
preSplitPaymentInfos is for work that must happen before the CommerceIdentifierPaymentInfos are split.

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

postSplitPaymentInfos

public void postSplitPaymentInfos(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
postSplitPaymentInfos is for work that must happen after the CommerceIdentifierPaymentInfos are split.

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

splitPaymentInfos

protected void splitPaymentInfos(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
splitPaymentInfos gets CommerceIdentifierPaymentInfos ready for split.

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

splitCommerceIdentifierPaymentInfo

protected void splitCommerceIdentifierPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo,
                                                  DynamoHttpServletRequest pRequest,
                                                  DynamoHttpServletResponse pResponse)
                                           throws javax.servlet.ServletException,
                                                  java.io.IOException
splitCommerceIdentifierPaymentInfo determines which CommerceIdentifierPaymentInfo objects need to be split, and in what manner. This relies on the CommerceIdentifierPaymentInfo.SplitAmount property.

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

splitCommerceIdentifierPaymentInfoByAmount

protected void splitCommerceIdentifierPaymentInfoByAmount(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo,
                                                          double pSplitAmount)
splitCommerceIdentifierPaymentInfoByAmount splits a CommerceIdentifierPaymentInfo by amount. This creates a new CommerceIdentifierPaymentInfo, adjusts properties of both the original and the new object, and adds the new object to the CommerceIdentifierPaymentInfoContainer.

Parameters:
pCommerceIdentifierPaymentInfo - a CommerceIdentifierPaymentInfo value
pSplitAmount - a double value

createSpecificPaymentInfo

protected CommerceIdentifierPaymentInfo createSpecificPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo)
The createSpecificPaymentInfo method takes a CommerceIdentifierPaymentInfo and creates a new one whose subtype matches that of the original.

Parameters:
pCommerceIdentifierPaymentInfo - a CommerceIdentifierPaymentInfo value
Returns:
a CommerceIdentifierPaymentInfo value

handleApplyPaymentGroups

public boolean handleApplyPaymentGroups(DynamoHttpServletRequest pRequest,
                                        DynamoHttpServletResponse pResponse)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
handleApplyPaymentGroups is used when the user has supplied the payment information for this order, and is ready to proceed with the next checkout phase. This applies the selected PaymentGroups to the various CommerceIdentifiers, applies any defaultPaymentGroup to the Order amount remaining, runs the appropriate validation processor, and updates the Order.

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

preApplyPaymentGroups

public void preApplyPaymentGroups(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
preApplyPaymentGroups is for work that must happen before the PaymentGroups are applied to the Order.

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

postApplyPaymentGroups

public void postApplyPaymentGroups(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
postApplyPaymentGroups is for work that must happen after the PaymentGroups are applied to the Order.

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

applyPaymentGroups

protected void applyPaymentGroups(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
applyPaymentGroups iterates over the supplied CommerceIdentifierPaymentInfos for each of the CommerceIdentifiers. Each CommerceIdentifierPaymentInfo is then used to update the Order. Once this is done, any defaultPaymentGroup is applied to the remaining Order amount remaining.

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

applyCommerceIdentifierPaymentInfo

protected void applyCommerceIdentifierPaymentInfo(CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo,
                                                  Order order)
applyCommerceIdentifierPaymentInfo takes the supplied payment information and update the Order. This invokes business logic in the OrderManager that corresponds to the RelationshipType property of the CommerceIdentifierPaymentInfo.

Parameters:
pCommerceIdentifierPaymentInfo - a CommerceIdentifierPaymentInfo value
order - an Order value

applyDefaultPaymentGroup

protected void applyDefaultPaymentGroup(Order pOrder)
applyDefaultPaymentGroup checks to see if there is a defaultPaymentGroup. If so, this PaymentGroup is added to the Order's remaining amount. This can facilitate simpler applications that only permit one PaymentGroup per Order, as well as advanced applications that apply a default PaymentGroup to any remaining Order amount not explicitly covered by other PaymentGroups.

Parameters:
pOrder - an Order value

isPaymentGroupInOrder

protected boolean isPaymentGroupInOrder(Order pOrder,
                                        java.lang.String pPaymentGroupId)
Deprecated. This method is moved to PaymentGroupManager

isPaymentGroupInOrder is used to determine if the PaymentGroup is already in the Order.

Parameters:
pOrder - an Order value
pPaymentGroupId - a String value
Returns:
a boolean value

getPaymentGroup

protected PaymentGroup getPaymentGroup(java.lang.String pPaymentMethod)
getPaymentGroup gets the PaymentGroup with the given name from the PaymentGroupMapContainer.

Parameters:
pPaymentMethod - a String value
Returns:
a PaymentGroup value

runProcessValidatePaymentGroups

protected void runProcessValidatePaymentGroups(Order pOrder,
                                               PricingModelHolder pPricingModels,
                                               java.util.Locale pLocale,
                                               RepositoryItem pProfile,
                                               java.util.Map pExtraParameters)
                                        throws RunProcessException
runProcessValidatePaymentGroups runs a configurable Pipeline chain to validate PaymentGroups or to prepare for the next checkout phase.

Parameters:
pOrder - an Order value
pPricingModels - a PricingModelHolder value
pLocale - a Locale value
pProfile - a RepositoryItem value
pExtraParameters - a Map value
Throws:
RunProcessException - if an error occurs

handleSpecifyDefaultPaymentGroup

public boolean handleSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest,
                                                DynamoHttpServletResponse pResponse)
                                         throws javax.servlet.ServletException,
                                                java.io.IOException
handleSpecifyDefaultPaymentGroup is used to let the user specify a default PaymentGroup to use for payment.

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

preSpecifyDefaultPaymentGroup

public void preSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
preSpecifyDefaultPaymentGroup is for work that must happen before the default PaymentGroup is set.

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

postSpecifyDefaultPaymentGroup

public void postSpecifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest,
                                           DynamoHttpServletResponse pResponse)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
postSpecifyDefaultPaymentGroup is for work that must happen after the default PaymentGroup is set.

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

specifyDefaultPaymentGroup

protected void specifyDefaultPaymentGroup(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
specifyDefaultPaymentGroup sets the defaultPaymentGroupName in the PaymentGroupMapContainer.

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