atg.commerce.csr.order
Class CSRCreateCreditCardFormHandler

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.CreateCreditCardFormHandler
                          extended by atg.commerce.csr.order.CSRCreateCreditCardFormHandler
All Implemented Interfaces:
atg.commerce.order.purchase.CreatePaymentGroupFormHandler, 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 CSRCreateCreditCardFormHandler
extends atg.commerce.order.purchase.CreateCreditCardFormHandler

The CSRCreateCreditCardFormHandler class extends CreateCreditCardFormHandler to allow the agent to designate the amount that should be paid for by the new credit card.

See Also:
CreateCreditCardFormHandler, PurchaseProcessFormHandler

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String COULD_NOT_CLONE_CONTACT_INFO_ITEM
           
static java.lang.String COULD_NOT_FIND_EXISTING_ADDRESS
           
static java.lang.String COULD_NOT_FIND_PAYMENT_GROUP
           
static java.lang.String ERROR_WHILE_COPYING_ADDRESS
           
protected  atg.svc.agent.customer.CustomerProfileTools mCustomerProfileTools
           
static java.lang.String MSG_ERROR_COPYING_CONTACT_INFO_TO_CREDIT_CARD
           
static java.lang.String MSG_ERROR_CREATING_PAYMENT_INFO_FROM_ORIGINAL
           
static java.lang.String MSG_ERROR_UPDATING_ORDER_ON_ADD_CREDIT_CARD
           
static java.lang.String MY_RESOURCE_NAME
           
 
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
CSRCreateCreditCardFormHandler()
          Creates a new CSRCreateCreditCardFormHandler instance.
 
Method Summary
 void copyContactInfoToCreditCard()
          While creating a brand new credit card, user could use already existing addresses or user could enter a brand new address.
protected  void createCreateCreditCardTicketActivity(atg.repository.RepositoryItem pTicket, java.util.Collection pPropertyUpdates)
          Creates the ticket activities associated with creating a new credit card that was saved to the customer's profile.
protected  atg.commerce.order.purchase.CommerceIdentifierPaymentInfo createSpecificPaymentInfo(atg.commerce.order.purchase.CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo)
          The createSpecificPaymentInfo method takes a CommerceIdentifierPaymentInfo and creates a new one whose subtype matches that of the original.
 atg.commerce.csr.profile.AddressHolder getAddressHolder()
          Returns the addressHolder.
 int getAddressIndex()
          Returns the addressIndex.
 CSRAgentMessagingTools getAgentMessagingTools()
          Returns component for sending agent messages
 double getAmount()
          Returns amount that will be assigned to this credit card
 CSRAgentTools getCSRAgentTools()
          Returns the cSRAgentTools.
 atg.svc.agent.customer.CustomerProfileTools getCustomerProfileTools()
           
 java.util.List getExistingAddresses()
          If the address holder does not have any addresses, this method calls the CSRAgentTools to generate a list of unique addresses.
 java.lang.String getItemUpdateActivityType()
           
 java.lang.String getRelationshipType()
          Returns the type of PaymentGroupRelationship that the PaymentGroup created with the new credit card will have.
 atg.repository.RepositoryItem getTicket()
          Returns the current ticket
 java.lang.String getTicketId()
          Returns the Id of the current ticket
 boolean isUseExistingAddress()
           
 void postCreateCreditCard(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          postCreateCreditCard is for work that must happen after a new CreditCard is created.
 void preCreateCreditCard(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          preCreateCreditCard is for work that must happen before a new CreditCard is created.
 void setAddressHolder(atg.commerce.csr.profile.AddressHolder pAddressHolder)
          Sets the addressHolder.
 void setAddressIndex(int pAddressIndex)
          Sets the addressIndex.
 void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
          Sets the component for sending agent messages
 void setAmount(double pAmount)
          Sets the amount that will be assigned to this credit card
 void setAutoSelectInitialAddress(boolean pFlag)
          This method is called from the page to pre-select the addresses in the add credit card drop down box.
 void setClearCreditCard(java.lang.String pClearFlag)
          After successfully adding the credit card, if we display the add credit card page, we need to clear out the credit card from the page.
 void setCSRAgentTools(CSRAgentTools pAgentTools)
          Sets the cSRAgentTools.
 void setCustomerProfileTools(atg.svc.agent.customer.CustomerProfileTools pCustomerProfileTools)
           
 void setItemUpdateActivityType(java.lang.String pItemUpdateActivityType)
          Sets the activity type used for sending the item update agent events.
 void setRelationshipType(java.lang.String pRelationshipType)
          Sets the PaymentGroupRelationship type that the PaymentGroup created with the new credit card will have.
 void setUseExistingAddress(boolean pUseExistingAddress)
           
protected  void splitCommerceIdentifierPaymentInfoByAmount(atg.commerce.order.purchase.CommerceIdentifierPaymentInfo pCommerceIdentifierPaymentInfo, double pSplitAmount)
          splitCommerceIdentifierPaymentInfoByAmount splits a CommerceIdentifierPaymentInfo by amount.
 
Methods inherited from class atg.commerce.order.purchase.CreateCreditCardFormHandler
copyConfiguration, createCreditCard, getContainer, getCreditCard, getCreditCardName, getCreditCardTools, getCreditCardType, getNewCreditCardErrorURL, getNewCreditCardSuccessURL, handleNewCreditCard, isAddToContainer, isAssignNewCreditCardAsDefault, isCopyToProfile, isGenerateNickname, isValidateCreditCard, setAddToContainer, setAssignNewCreditCardAsDefault, setContainer, setCopyToProfile, setCreditCard, setCreditCardName, setCreditCardTools, setCreditCardType, setGenerateNickname, setNewCreditCardErrorURL, setNewCreditCardSuccessURL, setValidateCreditCard, validateCreditCard
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, 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

MY_RESOURCE_NAME

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

COULD_NOT_CLONE_CONTACT_INFO_ITEM

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

COULD_NOT_FIND_PAYMENT_GROUP

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

COULD_NOT_FIND_EXISTING_ADDRESS

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

ERROR_WHILE_COPYING_ADDRESS

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

MSG_ERROR_UPDATING_ORDER_ON_ADD_CREDIT_CARD

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

MSG_ERROR_CREATING_PAYMENT_INFO_FROM_ORIGINAL

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

MSG_ERROR_COPYING_CONTACT_INFO_TO_CREDIT_CARD

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

mCustomerProfileTools

protected atg.svc.agent.customer.CustomerProfileTools mCustomerProfileTools
Constructor Detail

CSRCreateCreditCardFormHandler

public CSRCreateCreditCardFormHandler()
Creates a new CSRCreateCreditCardFormHandler instance.

Method Detail

getCustomerProfileTools

public atg.svc.agent.customer.CustomerProfileTools getCustomerProfileTools()

setCustomerProfileTools

public void setCustomerProfileTools(atg.svc.agent.customer.CustomerProfileTools pCustomerProfileTools)

getAddressIndex

public int getAddressIndex()
Returns the addressIndex.

Returns:
addressIndex

setAddressIndex

public void setAddressIndex(int pAddressIndex)
Sets the addressIndex.

Parameters:
pAddressIndex -

getAddressHolder

public atg.commerce.csr.profile.AddressHolder getAddressHolder()
Returns the addressHolder.

Returns:
addressHolder

setAddressHolder

public void setAddressHolder(atg.commerce.csr.profile.AddressHolder pAddressHolder)
Sets the addressHolder.

Parameters:
pAddressHolder -

setAgentMessagingTools

public void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages

Parameters:
pAgentMessagingTools -

getAgentMessagingTools

public CSRAgentMessagingTools getAgentMessagingTools()
Returns component for sending agent messages

Returns:
AgentMessagingTools

setAmount

public void setAmount(double pAmount)
Sets the amount that will be assigned to this credit card

Parameters:
pAmount - the amount that will be assigned to this credit card

getAmount

public double getAmount()
Returns amount that will be assigned to this credit card


setRelationshipType

public void setRelationshipType(java.lang.String pRelationshipType)
Sets the PaymentGroupRelationship type that the PaymentGroup created with the new credit card will have.

Parameters:
pRelationshipType - the PaymentGroupRelationship type that the PaymentGroup created with the new credit card will have.

getRelationshipType

public java.lang.String getRelationshipType()
Returns the type of PaymentGroupRelationship that the PaymentGroup created with the new credit card will have.


isUseExistingAddress

public boolean isUseExistingAddress()
Returns:
the useExistingAddress

setUseExistingAddress

public void setUseExistingAddress(boolean pUseExistingAddress)
Parameters:
pUseExistingAddress - The useExistingAddress to set.

getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns the cSRAgentTools.

Returns:
cSRAgentTools

setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pAgentTools)
Sets the cSRAgentTools.

Parameters:
pAgentTools -

setItemUpdateActivityType

public void setItemUpdateActivityType(java.lang.String pItemUpdateActivityType)
Sets the activity type used for sending the item update agent events.

Parameters:
pItemUpdateActivityType - the activity type used when sending the item update agent events.

getItemUpdateActivityType

public java.lang.String getItemUpdateActivityType()
Returns:
the activity type used when sending the item update agent events.

getTicketId

public java.lang.String getTicketId()
Returns the Id of the current ticket


preCreateCreditCard

public void preCreateCreditCard(atg.servlet.DynamoHttpServletRequest pRequest,
                                atg.servlet.DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
preCreateCreditCard is for work that must happen before a new CreditCard is created.

Overrides:
preCreateCreditCard in class atg.commerce.order.purchase.CreateCreditCardFormHandler
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

postCreateCreditCard

public void postCreateCreditCard(atg.servlet.DynamoHttpServletRequest pRequest,
                                 atg.servlet.DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
postCreateCreditCard is for work that must happen after a new CreditCard is created.

Overrides:
postCreateCreditCard in class atg.commerce.order.purchase.CreateCreditCardFormHandler
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

createCreateCreditCardTicketActivity

protected void createCreateCreditCardTicketActivity(atg.repository.RepositoryItem pTicket,
                                                    java.util.Collection pPropertyUpdates)
Creates the ticket activities associated with creating a new credit card that was saved to the customer's profile.

Parameters:
pTicket -
pPropertyUpdates -

splitCommerceIdentifierPaymentInfoByAmount

protected void splitCommerceIdentifierPaymentInfoByAmount(atg.commerce.order.purchase.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 atg.commerce.order.purchase.CommerceIdentifierPaymentInfo createSpecificPaymentInfo(atg.commerce.order.purchase.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

copyContactInfoToCreditCard

public void copyContactInfoToCreditCard()
While creating a brand new credit card, user could use already existing addresses or user could enter a brand new address. If the user enters a brand new address, the system does not need to do any special functions such as cloning the existing address or attaching the address to the credit card. If a user is entering brand new credit card and address, the whole object is persisted in the database. But if the user is trying to use already existing address or clone the existing address, then the system has to clone the address if necessary and attach the address to the credit card. This method does not do anything in case of user is trying to add a brand new address to the credit card. If the user is trying to add already existing address and if the flag is set to clone (isAllowCloningContactInfo()), then the system will clone the address item and set the cloned address to the credit card. Otherwise the system will attach the existing address reference to the credit card.


getExistingAddresses

public java.util.List getExistingAddresses()
If the address holder does not have any addresses, this method calls the CSRAgentTools to generate a list of unique addresses. If the addresses are already in the address holder, then returns the addresses

Returns:
a Collection of addresses

setClearCreditCard

public void setClearCreditCard(java.lang.String pClearFlag)
After successfully adding the credit card, if we display the add credit card page, we need to clear out the credit card from the page. In order to clear out the credit card, this method could be used. This method sets the credit card to null.


setAutoSelectInitialAddress

public void setAutoSelectInitialAddress(boolean pFlag)
This method is called from the page to pre-select the addresses in the add credit card drop down box.


getTicket

public atg.repository.RepositoryItem getTicket()
Returns the current ticket