atg.commerce.order.purchase
Class ExpressCheckoutFormHandler

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.ExpressCheckoutFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ExpressCheckoutFormHandler
extends PurchaseProcessFormHandler

The ExpressCheckoutFormHAndler is used to expedite the checking out of an Order. This supports creating a maximum of one Profile derived HardgoodShippingGroup and one Profile derived CreditCard, followed by committing the Order. If the ExpressCheckoutFormHandler.PaymentGroupNeeded property is true then a CreditCard PaymentGroup will automatically be taken from the Profile. If false, then the user may supply the CreditCard information in a form through the ExpressCheckoutFormHandler.PaymentGroup property. If the ExpressCheckoutFormHandler.ShippingGroupNeeded property is true then a HardgoodShippingGroup will automatically be taken from the Profile. If false, then the user may supply the HardgoodShippingGroup information in a form through the ExpressCheckoutFormHandler.ShippingGroup property. If the ExpressCheckoutFormHandler.CommitOrder property is true, then the ExpressCheckoutFormHandler.ExpressCheckout handler will commit the Order. Set to false in order to display a confirmation page before committing the Order.

See Also:
GenericFormHandler, PurchaseProcessFormHandler

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String ERROR_MISSING_BILLING_ADDRESS
           
static java.lang.String ERROR_MISSING_CREDIT_CARD
           
static java.lang.String ERROR_MISSING_SHIPPING_ADDRESS
           
static java.lang.String MSG_EXPRESS_CHECKOUT_ERROR
           
static java.lang.String MSG_ORDER_ALREADY_SUBMITTED
           
static java.lang.String MSG_REPRICE_ORDER_ERROR
           
static java.lang.String MSG_UNABLE_TO_COPY_ADDRESS
           
static java.lang.String MSG_UPDATE_ORDER_ERROR
           
 
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
ExpressCheckoutFormHandler()
           
 
Method Summary
protected  void commitOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          commitOrder commits the Order.
protected  void ensurePaymentGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          ensurePaymentGroup is used to ensure that the Order has a PaymentGroup of type CreditCard.
protected  void ensureShippingGroup(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          ensureShippingGroup is used to ensure that the Order has a ShippingGroup of type HardgoodShippingGroup.
 java.lang.String getDefaultBillingAddressPropertyName()
          Return the DefaultBillingAddressPropertyName property.
 java.lang.String getDefaultCreditCardPropertyName()
          Return the DefaultCreditCardPropertyName property.
 java.lang.String getDefaultShippingAddressPropertyName()
          Return the DefaultShippingAddressPropertyName property.
 java.lang.String getDefaultShippingMethodPropertyName()
          Return the DefaultShippingMethodPropertyName property.
 java.lang.String getExpressCheckoutErrorURL()
          Return the ExpressCheckoutErrorURL property.
 java.lang.String getExpressCheckoutSuccessURL()
          Return the ExpressCheckoutSuccessURL property.
 java.lang.String getOrderId()
          Return the OrderId property.
 PaymentGroup getPaymentGroup()
          Returns property PaymentGroup
 java.lang.String getPricingOperation()
          Return the PricingOperation property.
 java.util.HashMap getProcessOrderMap(java.util.Locale pLocale)
          This method calls the OrderManager.getProcessOrderMap(pLocale, map) to get the process order map and adds sales channel to the map.
 java.lang.String getSalesChannel()
          Returns the salesChannel.
 ShippingGroup getShippingGroup()
          Returns property ShippingGroup.
 boolean handleExpressCheckout(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleExpressCheckout is used to commit the Order after creating a CreditCard PaymentGroup and a HardgoodShippingGroup.
 boolean isCommitOrder()
          Return the CommitOrder property.
 boolean isPaymentGroupNeeded()
          Return the PaymentGroupNeeded property.
 boolean isShippingGroupNeeded()
          Return the ShippingGroupNeeded property.
 void postExpressCheckout(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          postExpressCheckout is for work that must happen after expressCheckout.
 void preExpressCheckout(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          preExpressCheckout is for work that must happen before expressCheckout.
protected  void runRepricingProcess(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This reprices the Order.
 void setCommitOrder(boolean pCommitOrder)
          Set the CommitOrder property.
 void setDefaultBillingAddressPropertyName(java.lang.String pDefaultBillingAddressPropertyName)
          Set the DefaultBillingAddressPropertyName property.
 void setDefaultCreditCardPropertyName(java.lang.String pDefaultCreditCardPropertyName)
          Set the DefaultCreditCardPropertyName property.
 void setDefaultShippingAddressPropertyName(java.lang.String pDefaultShippingAddressPropertyName)
          Set the DefaultShippingAddressPropertyName property.
 void setDefaultShippingMethodPropertyName(java.lang.String pDefaultShippingMethodPropertyName)
          Set the DefaultShippingMethodPropertyName property.
 void setExpressCheckoutErrorURL(java.lang.String pExpressCheckoutErrorURL)
          Set the ExpressCheckoutErrorURL property.
 void setExpressCheckoutSuccessURL(java.lang.String pExpressCheckoutSuccessURL)
          Set the ExpressCheckoutSuccessURL property.
 void setOrderId(java.lang.String pOrderId)
          Set the OrderId property.
 void setPaymentGroup(PaymentGroup pPaymentGroup)
          Sets payment group bean to use for modifiing payment groups
 void setPaymentGroupNeeded(boolean pPaymentGroupNeeded)
          Set the PaymentGroupNeeded property.
 void setPricingOperation(java.lang.String pPricingOperation)
          Set the PricingOperation property.
 void setSalesChannel(java.lang.String pSalesChannel)
          Sets the salesChannel.
 void setShippingGroup(ShippingGroup pShippingGroup)
          Sets shipping group bean to use for modifying the shipping groups
 void setShippingGroupNeeded(boolean pShippingGroupNeeded)
          Set the ShippingGroupNeeded property.
 
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, 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, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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_EXPRESS_CHECKOUT_ERROR

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

MSG_UPDATE_ORDER_ERROR

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

MSG_UNABLE_TO_COPY_ADDRESS

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

MSG_REPRICE_ORDER_ERROR

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

MSG_ORDER_ALREADY_SUBMITTED

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

ERROR_MISSING_SHIPPING_ADDRESS

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

ERROR_MISSING_BILLING_ADDRESS

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

ERROR_MISSING_CREDIT_CARD

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

ExpressCheckoutFormHandler

public ExpressCheckoutFormHandler()
Method Detail

getSalesChannel

public java.lang.String getSalesChannel()
Returns the salesChannel. Returns the sales channel which is used to submit the order. This could be "Web", "Call Center", or "Scheduled Orders". These values are defined in the order repository.

Returns:
salesChannel

setSalesChannel

public void setSalesChannel(java.lang.String pSalesChannel)
Sets the salesChannel. Sets the sales channel which is used to submit the order. This could be "Web", "Call Center", or "Scheduled Orders". These values are defined in the order repository.

Parameters:
pSalesChannel -

setShippingGroup

public void setShippingGroup(ShippingGroup pShippingGroup)
Sets shipping group bean to use for modifying the shipping groups

Parameters:
pShippingGroup - a ShippingGroup value

getShippingGroup

public ShippingGroup getShippingGroup()
Returns property ShippingGroup.

Returns:
a ShippingGroup value

setPaymentGroup

public void setPaymentGroup(PaymentGroup pPaymentGroup)
Sets payment group bean to use for modifiing payment groups

Parameters:
pPaymentGroup - a PaymentGroup value

getPaymentGroup

public PaymentGroup getPaymentGroup()
Returns property PaymentGroup

Returns:
a PaymentGroup value

setPaymentGroupNeeded

public void setPaymentGroupNeeded(boolean pPaymentGroupNeeded)
Set the PaymentGroupNeeded property.

Parameters:
pPaymentGroupNeeded - a boolean value

isPaymentGroupNeeded

public boolean isPaymentGroupNeeded()
Return the PaymentGroupNeeded property.

Returns:
a boolean value

setShippingGroupNeeded

public void setShippingGroupNeeded(boolean pShippingGroupNeeded)
Set the ShippingGroupNeeded property.

Parameters:
pShippingGroupNeeded - a boolean value

isShippingGroupNeeded

public boolean isShippingGroupNeeded()
Return the ShippingGroupNeeded property.

Returns:
a boolean value

setDefaultShippingMethodPropertyName

public void setDefaultShippingMethodPropertyName(java.lang.String pDefaultShippingMethodPropertyName)
Set the DefaultShippingMethodPropertyName property.

Parameters:
pDefaultShippingMethodPropertyName - a String value

getDefaultShippingMethodPropertyName

public java.lang.String getDefaultShippingMethodPropertyName()
Return the DefaultShippingMethodPropertyName property.

Returns:
a String value

setDefaultShippingAddressPropertyName

public void setDefaultShippingAddressPropertyName(java.lang.String pDefaultShippingAddressPropertyName)
Set the DefaultShippingAddressPropertyName property.

Parameters:
pDefaultShippingAddressPropertyName - a String value

getDefaultShippingAddressPropertyName

public java.lang.String getDefaultShippingAddressPropertyName()
Return the DefaultShippingAddressPropertyName property.

Returns:
a String value

setDefaultBillingAddressPropertyName

public void setDefaultBillingAddressPropertyName(java.lang.String pDefaultBillingAddressPropertyName)
Set the DefaultBillingAddressPropertyName property.

Parameters:
pDefaultBillingAddressPropertyName - a String value

getDefaultBillingAddressPropertyName

public java.lang.String getDefaultBillingAddressPropertyName()
Return the DefaultBillingAddressPropertyName property.

Returns:
a String value

setDefaultCreditCardPropertyName

public void setDefaultCreditCardPropertyName(java.lang.String pDefaultCreditCardPropertyName)
Set the DefaultCreditCardPropertyName property.

Parameters:
pDefaultCreditCardPropertyName - a String value

getDefaultCreditCardPropertyName

public java.lang.String getDefaultCreditCardPropertyName()
Return the DefaultCreditCardPropertyName property.

Returns:
a String value

setCommitOrder

public void setCommitOrder(boolean pCommitOrder)
Set the CommitOrder property.

Parameters:
pCommitOrder - a boolean value

isCommitOrder

public boolean isCommitOrder()
Return the CommitOrder property.

Returns:
a boolean value

setExpressCheckoutSuccessURL

public void setExpressCheckoutSuccessURL(java.lang.String pExpressCheckoutSuccessURL)
Set the ExpressCheckoutSuccessURL property.

Parameters:
pExpressCheckoutSuccessURL - a String value

getExpressCheckoutSuccessURL

public java.lang.String getExpressCheckoutSuccessURL()
Return the ExpressCheckoutSuccessURL property.

Returns:
a String value

setExpressCheckoutErrorURL

public void setExpressCheckoutErrorURL(java.lang.String pExpressCheckoutErrorURL)
Set the ExpressCheckoutErrorURL property.

Parameters:
pExpressCheckoutErrorURL - a String value

getExpressCheckoutErrorURL

public java.lang.String getExpressCheckoutErrorURL()
Return the ExpressCheckoutErrorURL property.

Returns:
a String value

setPricingOperation

public void setPricingOperation(java.lang.String pPricingOperation)
Set the PricingOperation property.

Parameters:
pPricingOperation - a String value

getPricingOperation

public java.lang.String getPricingOperation()
Return the PricingOperation property.

Returns:
a String value

setOrderId

public void setOrderId(java.lang.String pOrderId)
Set the OrderId property.

Parameters:
pOrderId - a String value

getOrderId

public java.lang.String getOrderId()
Return the OrderId property.

Returns:
a String value

preExpressCheckout

public void preExpressCheckout(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
preExpressCheckout is for work that must happen before expressCheckout.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

postExpressCheckout

public void postExpressCheckout(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
postExpressCheckout is for work that must happen after expressCheckout.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

handleExpressCheckout

public boolean handleExpressCheckout(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws java.io.IOException,
                                     javax.servlet.ServletException
handleExpressCheckout is used to commit the Order after creating a CreditCard PaymentGroup and a HardgoodShippingGroup.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
a boolean value
Throws:
java.io.IOException - if there was an error with servlet io pje
javax.servlet.ServletException - if there was an error while executing the code

commitOrder

protected void commitOrder(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws CommerceException,
                           javax.servlet.ServletException,
                           java.io.IOException
commitOrder commits the Order.

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

runRepricingProcess

protected void runRepricingProcess(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws RunProcessException,
                                   javax.servlet.ServletException,
                                   java.io.IOException
This reprices the Order.

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

ensureShippingGroup

protected void ensureShippingGroup(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws java.io.IOException,
                                   javax.servlet.ServletException
ensureShippingGroup is used to ensure that the Order has a ShippingGroup of type HardgoodShippingGroup.

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

ensurePaymentGroup

protected void ensurePaymentGroup(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws java.io.IOException,
                                  javax.servlet.ServletException
ensurePaymentGroup is used to ensure that the Order has a PaymentGroup of type CreditCard.

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

getProcessOrderMap

public java.util.HashMap getProcessOrderMap(java.util.Locale pLocale)
                                     throws CommerceException
This method calls the OrderManager.getProcessOrderMap(pLocale, map) to get the process order map and adds sales channel to the map.

Returns:
Throws:
CommerceException