atg.projects.store.order.purchase
Class StoreCommitOrderHandler

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.CommitOrderFormHandler
                          extended by atg.projects.store.order.purchase.StoreCommitOrderHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, atg.droplet.DropletFormHandler, atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class StoreCommitOrderHandler
extends atg.commerce.order.purchase.CommitOrderFormHandler

Extends the default CommitOrderFormHandler as to implement custom preCommitOrder and postCommitOrder functionality.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/order/purchase/StoreCommitOrderHandler.java#4 $$Change: 796551 $
Author:
ATG

Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
protected static java.lang.String CONFIRM_EMAIL_ALREADY_EXISTS
          Confirm Email Address already exists message key.
protected static java.lang.String CONFIRM_EMAIL_INVALID
          Confirm Email Address invalid message key.
protected  StoreCommitOrderProcessHelper mCommitOrderHelper
          property: commitOrderHelper
protected  java.lang.String mConfirmEmailAddress
          property: confirmEmailAddress
protected  java.lang.String mCreditCardVerificationNumber
          property: creditCardVerificationNumber
protected static java.lang.String SHIPPING_METHOD_INVALID
          Shipping method invalid message key.
protected static java.lang.String VERIFICATION_NUMBER_INVALID
          Verification number invalid message key.
 
Fields inherited from class atg.commerce.order.purchase.CommitOrderFormHandler
MSG_COMMIT_ERROR, MSG_ORDER_ALREADY_SUBMITTED, MSG_ORDER_EMPTY, MSG_ORDER_NOT_CURRENT
 
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
StoreCommitOrderHandler()
           
 
Method Summary
 void commitOrder(atg.commerce.order.Order pOrder, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This overridden method checks for an 'ItemPromotionExpired' formException and sets the 'commitOrderErrorURL' with the 'expiredPromotionErrorURL' to go to when this type of exception is detected.
 CheckoutProgressStates getCheckoutProgressStates()
           
 StoreCommitOrderProcessHelper getCommitOrderHelper()
           
 java.lang.String getConfirmEmailAddress()
           
 java.lang.String getCouponCode()
           
 atg.commerce.order.CreditCard getCreditCard()
          Method to allow page access to CreditCard object.
 java.lang.String getCreditCardVerificationNumber()
           
 java.lang.String getExpiredPromotionErrorURL()
           
 atg.commerce.order.purchase.ShippingGroupContainerService getShippingGroupContainerService()
           
 boolean isCreditCardRequired()
          Checks whether an order uses a credit card for a payment.
protected  boolean isEmailAlreadyRegistered(java.lang.String pEmail)
          Returns true if a user already exists with the given email.
 void postCommitOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Called after all processing is done by the handleCommitOrder method.
 void preCommitOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Ensures that an email address is set in the billing address, as required by CyberSource.
 void setCheckoutProgressStates(CheckoutProgressStates pCheckoutProgressStates)
           
 void setCommitOrderHelper(StoreCommitOrderProcessHelper pCommitOrderHelper)
           
 void setConfirmEmailAddress(java.lang.String pConfirmEmailAddress)
           
 void setCouponCode(java.lang.String pCouponCode)
           
 void setCreditCardVerificationNumber(java.lang.String pCreditCardVerificationNumber)
           
 void setExpiredPromotionErrorURL(java.lang.String pExpiredPromotionErrorURL)
           
 void setShippingGroupContainerService(atg.commerce.order.purchase.ShippingGroupContainerService pShippingGroupContainerService)
           
 
Methods inherited from class atg.commerce.order.purchase.CommitOrderFormHandler
getAllowEmptyOrders, getCommitOrderErrorURL, getCommitOrderSuccessURL, getOrderId, getProcessOrderMap, getSalesChannel, getSiteId, handleCommitOrder, setAllowEmptyOrders, setCommitOrderErrorURL, setCommitOrderSuccessURL, setOrderId, setSalesChannel, setSiteId
 
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, isConcurrentUpdate, 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 final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values

VERIFICATION_NUMBER_INVALID

protected static final java.lang.String VERIFICATION_NUMBER_INVALID
Verification number invalid message key.

See Also:
Constant Field Values

SHIPPING_METHOD_INVALID

protected static final java.lang.String SHIPPING_METHOD_INVALID
Shipping method invalid message key.

See Also:
Constant Field Values

CONFIRM_EMAIL_INVALID

protected static final java.lang.String CONFIRM_EMAIL_INVALID
Confirm Email Address invalid message key.

See Also:
Constant Field Values

CONFIRM_EMAIL_ALREADY_EXISTS

protected static final java.lang.String CONFIRM_EMAIL_ALREADY_EXISTS
Confirm Email Address already exists message key.

See Also:
Constant Field Values

mCommitOrderHelper

protected StoreCommitOrderProcessHelper mCommitOrderHelper
property: commitOrderHelper


mConfirmEmailAddress

protected java.lang.String mConfirmEmailAddress
property: confirmEmailAddress


mCreditCardVerificationNumber

protected java.lang.String mCreditCardVerificationNumber
property: creditCardVerificationNumber

Constructor Detail

StoreCommitOrderHandler

public StoreCommitOrderHandler()
Method Detail

getCheckoutProgressStates

public CheckoutProgressStates getCheckoutProgressStates()
Returns:
the checkout progress states.

setCheckoutProgressStates

public void setCheckoutProgressStates(CheckoutProgressStates pCheckoutProgressStates)
Parameters:
pCheckoutProgressStates - - the checkout progress states to set.

getCommitOrderHelper

public StoreCommitOrderProcessHelper getCommitOrderHelper()
Returns:
the Order Helper component.

setCommitOrderHelper

public void setCommitOrderHelper(StoreCommitOrderProcessHelper pCommitOrderHelper)
Parameters:
pCommitOrderHelper - - the order helper component to set.

getConfirmEmailAddress

public java.lang.String getConfirmEmailAddress()
Returns:
the confirm e-mail address.

setConfirmEmailAddress

public void setConfirmEmailAddress(java.lang.String pConfirmEmailAddress)
Parameters:
pConfirmEmailAddress - - the confirm e-mail address to set.

getCreditCardVerificationNumber

public java.lang.String getCreditCardVerificationNumber()
Returns:
the credit card verification number.

setCreditCardVerificationNumber

public void setCreditCardVerificationNumber(java.lang.String pCreditCardVerificationNumber)
Parameters:
pCreditCardVerificationNumber - - the credit card verification number to set.

getCouponCode

public java.lang.String getCouponCode()
Returns:
a coupon code to be claimed.

setCouponCode

public void setCouponCode(java.lang.String pCouponCode)
Parameters:
pCouponCode - - the coupon code to set.

setShippingGroupContainerService

public void setShippingGroupContainerService(atg.commerce.order.purchase.ShippingGroupContainerService pShippingGroupContainerService)
Parameters:
pShippingGroupContainerService- - a new ShippingGroupContainerService.

getShippingGroupContainerService

public atg.commerce.order.purchase.ShippingGroupContainerService getShippingGroupContainerService()
Returns:
Returns the ShippingGroupContainerService

setExpiredPromotionErrorURL

public void setExpiredPromotionErrorURL(java.lang.String pExpiredPromotionErrorURL)
Parameters:
pExpiredPromotionErrorURL - - The expired promotion error redirect URL.

getExpiredPromotionErrorURL

public java.lang.String getExpiredPromotionErrorURL()
Returns:
the expired promotion error redirect URL.

preCommitOrder

public void preCommitOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                           atg.servlet.DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Ensures that an email address is set in the billing address, as required by CyberSource. Also assures that the profile ID associated with the order is correct.

Overrides:
preCommitOrder in class atg.commerce.order.purchase.CommitOrderFormHandler
Parameters:
pRequest - - HTTP request.
pResponse - - HTTP response.
Throws:
javax.servlet.ServletException - if servlet error occurs.
java.io.IOException - if IO error occurs.
See Also:
atg.commerce.order.purchase.CommitOrderFormHandler#handleCommitOrder.

commitOrder

public void commitOrder(atg.commerce.order.Order pOrder,
                        atg.servlet.DynamoHttpServletRequest pRequest,
                        atg.servlet.DynamoHttpServletResponse pResponse)
                 throws javax.servlet.ServletException,
                        java.io.IOException
This overridden method checks for an 'ItemPromotionExpired' formException and sets the 'commitOrderErrorURL' with the 'expiredPromotionErrorURL' to go to when this type of exception is detected.

Overrides:
commitOrder in class atg.commerce.order.purchase.CommitOrderFormHandler
Parameters:
pOrder - - The order that is being committed.
pRequest - - The HTTP request object.
pResponse - - The HTTP response object.
Throws:
javax.servlet.ServletException
java.io.IOException

isCreditCardRequired

public boolean isCreditCardRequired()
Checks whether an order uses a credit card for a payment. In case when there are payment group relationships with a credit card - return true, otherwise when other payment methods are used to pay for the order - return false.

Returns:
true if there are payment group relationships with credit card.

postCommitOrder

public void postCommitOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                            atg.servlet.DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Called after all processing is done by the handleCommitOrder method. This method is responsible for populating the profile with the attributes on the profile, such as itemsBought, lastPurchaseDate, numberOfOrders, etc.

Overrides:
postCommitOrder in class atg.commerce.order.purchase.CommitOrderFormHandler
Parameters:
pRequest - - the request object.
pResponse - - the response object.
Throws:
javax.servlet.ServletException - - if an error occurs.
java.io.IOException - - if an error occurs.
See Also:
CommitOrderFormHandler.handleCommitOrder(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)

getCreditCard

public atg.commerce.order.CreditCard getCreditCard()
Method to allow page access to CreditCard object.

Returns:
credit card with this order.

isEmailAlreadyRegistered

protected boolean isEmailAlreadyRegistered(java.lang.String pEmail)
Returns true if a user already exists with the given email.

Parameters:
pEmail - - the email which a user wants to use.
Returns:
true if a user already exists with the given email.