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.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, 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.


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
          Commit Order Helper.
protected  java.lang.String mConfirmEmailAddress
          Confirm e-mail address.
protected  java.lang.String mCreditCardVerificationNumber
          Credit card verification number.
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
protected  boolean emailAlreadyRegistered(java.lang.String pEmail, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Returns true if a user already exists with the given email
 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()
           
 boolean isCreditCardRequired()
          Checks whether an order uses a credit card for a payment.
 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)
           
 
Methods inherited from class atg.commerce.order.purchase.CommitOrderFormHandler
commitOrder, 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, 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, reResolveThis, 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
Class version string.


VERIFICATION_NUMBER_INVALID

protected static final java.lang.String VERIFICATION_NUMBER_INVALID
Verification number 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
Commit Order Helper.


mConfirmEmailAddress

protected java.lang.String mConfirmEmailAddress
Confirm e-mail address.


mCreditCardVerificationNumber

protected java.lang.String mCreditCardVerificationNumber
Credit card verification number.

Constructor Detail

StoreCommitOrderHandler

public StoreCommitOrderHandler()
Method Detail

getCheckoutProgressStates

public CheckoutProgressStates getCheckoutProgressStates()

setCheckoutProgressStates

public void setCheckoutProgressStates(CheckoutProgressStates pCheckoutProgressStates)

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)

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:
CommitOrderFormHandler.handleCommitOrder(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)

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 - returns true, otherwise when other payment methods are used to pay for the order - returns 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

emailAlreadyRegistered

protected boolean emailAlreadyRegistered(java.lang.String pEmail,
                                         atg.servlet.DynamoHttpServletRequest pRequest,
                                         atg.servlet.DynamoHttpServletResponse pResponse)
Returns true if a user already exists with the given email

Parameters:
pEmail - the email which a user wants to use
pRequest - the servlet's request
pResponse - the servlet's response