public class CSRPaymentGroupFormHandler
extends atg.commerce.order.purchase.PaymentGroupFormHandler
implements atg.commerce.order.purchase.CreatePaymentGroupFormHandler
CSRPaymentGroupFormHandler class is used to claim gift certificates
and coupons. A GiftCertificate is added to a PaymentGroupMapContainerGenericFormHandler,
PurchaseProcessFormHandler| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
protected static java.lang.String |
COULD_NOT_FIND_CLAIMABLE_ITEM |
protected static java.lang.String |
COULD_NOT_PROCESS_COUPON |
protected static java.lang.String |
COUPON_TYPE |
protected static java.lang.String |
EMPTY_CLAIMABLE_CODE |
protected static java.lang.String |
ERROR_CLAIMING_CLAIM_CODE |
protected static java.lang.String |
ERROR_REPRICING_ORDER |
protected static java.lang.String |
ERROR_WHILE_FETCHING_PRICE_LIST |
protected static java.lang.String |
ERROR_WHILE_PERSISTING_ORDER |
protected static java.lang.String |
GIFT_CERTIFICATE_TYPE |
protected static java.lang.String |
JSON_ERROR_ATTRIBUTE |
protected CSRAgentTools |
mCSRAgentTools |
protected CSREnvironmentTools |
mCSREnvironmentTools |
protected atg.web.messaging.MessageTools |
mMessageTools |
protected atg.commerce.csr.returns.ReturnManager |
mReturnManager |
protected static java.lang.String |
MSG_ERROR_SAVING_PAYMENT_INFO |
protected static java.lang.String |
NO_CLAIMABLE_ITEM_FUNDS |
protected static java.lang.String |
ORDERRESOURCES
Resources file
|
protected java.util.ResourceBundle |
sBundle |
protected static java.lang.String |
STORE_CREDIT_TYPE |
MSG_INVALID_PAYMENT_SPLIT_NUMBER, MSG_NO_DEFAULT_PAYMENT_GROUPLOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUEPARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS| Constructor and Description |
|---|
CSRPaymentGroupFormHandler()
Creates a new
CSRPaymentGroupFormHandler instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
claimCoupon(atg.commerce.order.Order pOrder,
atg.repository.RepositoryItem pProfile,
java.lang.String pClaimCode)
If the order hasn't been submitted yet, the ClaimableManager is
called to claim the coupon.
|
void |
claimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
claimItem claims a coupon or creates a new GiftCertificate. |
protected java.util.Map |
createRepriceParameterMap()
Creates the extra parameter map for pricing the order after
form handler modifications.
|
CSRAgentMessagingTools |
getAgentMessagingTools()
Returns component for sending agent messages
|
java.lang.String |
getClaimCode()
Return the ClaimCode property.
|
java.lang.String |
getClaimItemErrorURL()
Return the ClaimItemErrorURL property.
|
java.lang.String |
getClaimItemSuccessURL()
Return the ClaimItemSuccessURL property.
|
CSRAgentTools |
getCSRAgentTools() |
CSREnvironmentTools |
getCSREnvironmentTools() |
java.lang.String |
getGiftCertificateType()
Return the GiftCertificateType property.
|
atg.web.messaging.MessageTools |
getMessageTools()
Returns the MessageTools component
|
atg.commerce.csr.returns.ReturnManager |
getReturnManager() |
java.lang.String |
getStoreCreditType()
Return the StoreCreditType property.
|
SubmittedOrderPricingModelHolder |
getSubmittedOrderPricingModels()
Returns property SubmittedOrderPricingModels
|
java.lang.String |
getTicketId()
Returns the Id of the current ticket
|
atg.commerce.pricing.PricingModelHolder |
getUserPricingModels()
Returns the
PricingModelHolder that should be
used for the current order. |
boolean |
handleClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
handleClaimItem is used to claim the coupon or gift certificate. |
boolean |
handlePreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method is used to preserve any user inputs in the server's memeory.
|
boolean |
isAllowCouponClaim()
If the coupon is allowed to be claim as claimables for payment options with Gift Certificate/Store Credit/
Coupon,then set this falg to true to claim the coupon.
|
boolean |
isPersistOrder() |
void |
postApplyPaymentGroups(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
postApplyPaymentGroups is for work that must happen after
the PaymentGroups are applied. |
void |
postClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
postClaimItem is for work that must happen after
a coupon or GiftCertificate is claimed. |
void |
postPreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
postPreserveUserInputOnServerSide is for work that must happen after
the user selections are saved. |
void |
preApplyPaymentGroups(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
preApplyPaymentGroups is for work that must happen before
the PaymentGroups are applied to the Order. |
void |
preClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
preClaimItem is for work that must happen before
a coupon or gift certificate is claimed. |
void |
prePreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
prePreserveUserInputOnServerSide is for work that must happen before
the user selections are retained. |
protected void |
repriceOrder()
Reprice the order by invoking the reprice order pipeline chain
|
void |
setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages
|
void |
setAllowCouponClaim(boolean pAllowCouponClaim)
If the coupon is allowed to be claim as claimables for payment options with Gift Certificate/Store Credit/
Coupon,then set this falg to true to claim the coupon.
|
void |
setClaimCode(java.lang.String pClaimCode)
Set the ClaimCode property.
|
void |
setClaimItemErrorURL(java.lang.String pClaimItemErrorURL)
Set the ClaimItemErrorURL property.
|
void |
setClaimItemSuccessURL(java.lang.String pClaimItemSuccessURL)
Set the ClaimItemSuccessURL property.
|
void |
setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.
|
void |
setCSREnvironmentTools(CSREnvironmentTools pCSREnvironmentTools) |
void |
setGiftCertificateType(java.lang.String pGiftCertificateType)
Set the GiftCertificateType property.
|
void |
setMessageTools(atg.web.messaging.MessageTools pMessageTools) |
void |
setPersistOrder(boolean pPersistOrder) |
void |
setReturnManager(atg.commerce.csr.returns.ReturnManager pReturnManager)
Sets the property ReturnManager.
|
void |
setStoreCreditType(java.lang.String pStoreCreditType)
Set the StoreCreditType property.
|
void |
setSubmittedOrderPricingModels(SubmittedOrderPricingModelHolder pSubmittedOrderPricingModels)
Sets property SubmittedOrderPricingModels
|
applyCommerceIdentifierPaymentInfo, applyDefaultPaymentGroup, applyPaymentGroups, createSpecificPaymentInfo, getApplyPaymentGroupsErrorURL, getApplyPaymentGroupsSuccessURL, getCurrentList, getCurrentPaymentGroup, getDefaultPaymentGroupName, getListId, getPaymentGroup, getPaymentGroupId, getPricingTools, getSpecifyDefaultPaymentGroupErrorURL, getSpecifyDefaultPaymentGroupSuccessURL, getSplitPaymentInfosErrorURL, getSplitPaymentInfosSuccessURL, getValidatePaymentGroupsChainId, handleApplyPaymentGroups, handleSpecifyDefaultPaymentGroup, handleSplitPaymentInfos, isAllowPaymentGroupsWithZeroAmount, isApplyDefaultPaymentGroup, isPaymentGroupInOrder, postSpecifyDefaultPaymentGroup, postSplitPaymentInfos, preSpecifyDefaultPaymentGroup, preSplitPaymentInfos, runProcessValidatePaymentGroups, setAllowPaymentGroupsWithZeroAmount, setApplyDefaultPaymentGroup, setApplyPaymentGroupsErrorURL, setApplyPaymentGroupsSuccessURL, setCurrentList, setCurrentPaymentGroup, setDefaultPaymentGroupName, setListId, setPaymentGroupId, setPricingTools, setSpecifyDefaultPaymentGroupErrorURL, setSpecifyDefaultPaymentGroupSuccessURL, setSplitPaymentInfosErrorURL, setSplitPaymentInfosSuccessURL, setValidatePaymentGroupsChainId, specifyDefaultPaymentGroup, splitCommerceIdentifierPaymentInfo, splitCommerceIdentifierPaymentInfoByAmount, splitPaymentInfosacquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, copyConfiguration, 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, 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, unsetTransactionCreatedaddFormException, 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, setUseForwardsaddLogListener, clearAbsoluteNameAndContext, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, isStartServiceComplete, 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, toStringvlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static java.lang.String CLASS_VERSION
protected static final java.lang.String ORDERRESOURCES
protected final java.util.ResourceBundle sBundle
protected static final java.lang.String COUPON_TYPE
protected static final java.lang.String GIFT_CERTIFICATE_TYPE
protected static final java.lang.String STORE_CREDIT_TYPE
protected static final java.lang.String JSON_ERROR_ATTRIBUTE
protected static final java.lang.String NO_CLAIMABLE_ITEM_FUNDS
protected static final java.lang.String EMPTY_CLAIMABLE_CODE
protected static final java.lang.String COULD_NOT_FIND_CLAIMABLE_ITEM
protected static final java.lang.String COULD_NOT_PROCESS_COUPON
protected static final java.lang.String ERROR_WHILE_PERSISTING_ORDER
protected static final java.lang.String ERROR_WHILE_FETCHING_PRICE_LIST
protected static final java.lang.String ERROR_CLAIMING_CLAIM_CODE
protected static final java.lang.String MSG_ERROR_SAVING_PAYMENT_INFO
protected static final java.lang.String ERROR_REPRICING_ORDER
protected CSRAgentTools mCSRAgentTools
protected atg.commerce.csr.returns.ReturnManager mReturnManager
protected atg.web.messaging.MessageTools mMessageTools
protected CSREnvironmentTools mCSREnvironmentTools
public CSRPaymentGroupFormHandler()
CSRPaymentGroupFormHandler instance.public boolean isPersistOrder()
public void setPersistOrder(boolean pPersistOrder)
pPersistOrder - The persistOrder to set.public atg.commerce.pricing.PricingModelHolder getUserPricingModels()
PricingModelHolder that should be
used for the current order.getUserPricingModels in class atg.commerce.order.purchase.PurchaseProcessFormHandlerPricingModelHolder valueCSREnvironmentTools.getOrderPricingModelHolder(Order)public void setSubmittedOrderPricingModels(SubmittedOrderPricingModelHolder pSubmittedOrderPricingModels)
pSubmittedOrderPricingModels - a SubmittedOrderPricingModels valuepublic SubmittedOrderPricingModelHolder getSubmittedOrderPricingModels()
SubmittedOrderPricingModels valuepublic void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
public CSRAgentTools getCSRAgentTools()
public void setReturnManager(atg.commerce.csr.returns.ReturnManager pReturnManager)
public atg.commerce.csr.returns.ReturnManager getReturnManager()
public atg.web.messaging.MessageTools getMessageTools()
public void setMessageTools(atg.web.messaging.MessageTools pMessageTools)
public void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
pAgentMessagingTools - public CSRAgentMessagingTools getAgentMessagingTools()
public void setClaimCode(java.lang.String pClaimCode)
pClaimCode - a String valuepublic java.lang.String getClaimCode()
String valuepublic void setClaimItemSuccessURL(java.lang.String pClaimItemSuccessURL)
pClaimItemSuccessURL - a String valuepublic java.lang.String getClaimItemSuccessURL()
String valuepublic void setClaimItemErrorURL(java.lang.String pClaimItemErrorURL)
pClaimItemErrorURL - a String valuepublic java.lang.String getClaimItemErrorURL()
String valuepublic void setGiftCertificateType(java.lang.String pGiftCertificateType)
pGiftCertificateType - a String valuepublic java.lang.String getGiftCertificateType()
String valuepublic void setStoreCreditType(java.lang.String pStoreCreditType)
pStoreCreditType - a String valuepublic java.lang.String getStoreCreditType()
String valuepublic boolean isAllowCouponClaim()
public void setAllowCouponClaim(boolean pAllowCouponClaim)
pAllowCouponClaim - The allowCouponClaim to set.public void setCSREnvironmentTools(CSREnvironmentTools pCSREnvironmentTools)
pCSREnvironmentTools - the CSREnvironmentTools to setpublic CSREnvironmentTools getCSREnvironmentTools()
public java.lang.String getTicketId()
public boolean handleClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
handleClaimItem is used to claim the coupon or gift certificate.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valueboolean valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void preClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
preClaimItem is for work that must happen before
a coupon or gift certificate is claimed.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void postClaimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
postClaimItem is for work that must happen after
a coupon or GiftCertificate is claimed.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void claimItem(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
claimItem claims a coupon or creates a new GiftCertificate. The GiftCertficateType
property gives the type of PaymentGroup to create. The GiftCertificateNumber property
gives the name of the new PaymentGroup, as it will be referenced in the
PaymentGroupMapContainer. The GiftCertificate is added to the PaymentGroupMapContainer and either
the gift certificate amount or the total amount of the order is assigned to the gift certificate
(whichever is smaller).pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valueprotected void claimCoupon(atg.commerce.order.Order pOrder,
atg.repository.RepositoryItem pProfile,
java.lang.String pClaimCode)
throws atg.commerce.claimable.ClaimableException,
atg.repository.RepositoryException,
atg.commerce.promotion.PromotionException,
atg.commerce.CommerceException
pOrder - the order for which the coupon is being claimed (ignored)pProfile - the customer profile (ignored)pClaimCode - the coupon claim codeatg.commerce.claimable.ClaimableExceptionatg.repository.RepositoryExceptionatg.commerce.promotion.PromotionExceptionatg.commerce.CommerceExceptionCSRAgentTools.claimCoupon(String, String, Map)public void prePreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
prePreserveUserInputOnServerSide is for work that must happen before
the user selections are retained.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic void postPreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
postPreserveUserInputOnServerSide is for work that must happen after
the user selections are saved.pRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occurspublic boolean handlePreserveUserInputOnServerSide(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
pRequest - pResponse - javax.servlet.ServletExceptionjava.io.IOExceptionpublic void postApplyPaymentGroups(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
postApplyPaymentGroups is for work that must happen after
the PaymentGroups are applied.
Invokes the reprice order chain after applying the payment groups for any new order checkouts.
postApplyPaymentGroups in class atg.commerce.order.purchase.PaymentGroupFormHandlerpRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occursprotected java.util.Map createRepriceParameterMap()
createRepriceParameterMap in class atg.commerce.order.purchase.PurchaseProcessFormHandlerCSRAgentTools.addCurrentOrderPricingParameters(Map)public void preApplyPaymentGroups(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
preApplyPaymentGroups is for work that must happen before
the PaymentGroups are applied to the Order.
This method performs a check whether or not to include the appeasement refunds made on this order in the returns or exchanges refund validation. If the appeasement total needs to be included , it does validate the refund including appeasement refunds and throws error if it exceeds the available balance, otherwise an information message about the appeasement total will be displayed
This extension ensures that one of the OrderPaymentInfos in the container, if there are any, has a relationship type of ORDER_AMOUNT_REMAINING.
preApplyPaymentGroups in class atg.commerce.order.purchase.PaymentGroupFormHandlerpRequest - a DynamoHttpServletRequest valuepResponse - a DynamoHttpServletResponse valuejavax.servlet.ServletException - if an error occursjava.io.IOException - if an error occursCSRAgentTools.ensureOrderAmountRemainingType(CommerceIdentifierPaymentInfoContainer, PaymentGroupMapContainer)protected void repriceOrder()
throws atg.commerce.CommerceException
CommerceExcption - if an error occurs while
executing the re price order chainatg.commerce.CommerceExceptionCSRAgentTools#repriceOrder(String, Order, PricingModelHolder,
Locale, RepositoryItem, RepositoryItem, Map, atg.commerce.util.
PipelineErrorHandler)