public class B2BShoppingCartFormHandler extends SoftGoodFormHandler
B2BShoppingCartFormHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
mGenerateInvoiceCCName |
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle
|
MSG_NO_EMAIL_ADDR, MSG_UNABLE_TO_CREATE_SG, MSG_UNABLE_TO_INIT_SG, NO_SG_TO_INIT
BILLING_ADDR_PROP_NAME, CONTACT_INFO_ITEM_NAME, CREDIT_CARD_PROPERTIES, DEFAULT_CREDIT_CARD, ERROR_MISSING_BILLING_ADDRESS, ERROR_MISSING_CREDIT_CARD, GIFT_CERTIFICATE_PROPERTIES, MSG_ADDRESS_ALREADY_EXISTS, MSG_ERROR_ADDING_ADDRESS, MSG_ERROR_MOVING_ITEM_TO_NEW_ADDRESS, MSG_ERROR_UNABLE_TO_ADD_CC, MSG_NO_CREDIT_CARD_NUMBER, MSG_NO_NEW_ADDRESS_ENTERED, MSG_NO_NICKNAME, MSG_UNABLE_TO_COPY_CREDIT_CARD, NEW, NO_CREDIT_CARD, REDUNDANT_CREDIT_CARD, SECONDARY_ADDRESS_PROPERTY_NAME, UNEQUAL_GC_SIZE, UNSUPPORTED_PAYMENTGROUP
CC_PAYMENT_GROUP_TYPE_NAME, GC_PAYMENT_GROUP_TYPE_NAME, MSG_DUPLICATE_ORDER_DESCRIPTION, MSG_ERROR_ADDING_ITEM, MSG_ERROR_EDIT_ITEM, MSG_ERROR_MOVE_TO_CONFIRMATION, MSG_ERROR_MOVE_TO_ORDER_COMMIT, MSG_ERROR_MOVE_TO_PAYMENT, MSG_ERROR_MOVE_TO_PURCHASE_INFO, MSG_ERROR_REMOVING_ITEM, MSG_ERROR_REPRICE_ORDER, MSG_ERROR_UPDATE_ORDER, MSG_INVALID_QUANTITY, MSG_ORDER_ALREADY_SUBMITTED, MSG_UNABLE_TO_COPY_ADDRESS, MSG_UNSUPPORTED_RELATIONSHIP, NO_GIFTCERTIFICATE_FOUND
ERROR_MISSING_LOCK_MANAGER, ERROR_MISSING_LOCK_PROFILE, ERROR_MISSING_TRANSACTION_MANAGER, MSG_CONCURRENT_UPDATE_ATTEMPT, MSG_ERROR_ADDING_TO_ORDER, MSG_ERROR_REMOVING_FROM_ORDER, MSG_ERROR_REMOVING_RROM_ORDER, MSG_NO_ITEM_FOUND, MSG_NO_ITEMS_TO_ADD, MSG_NO_ORDER_TO_MODIFY, MSG_NO_SKU_WITH_ID, MSG_QUANTITY_LESSTHAN_OR_EQUALTO_ZERO, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUE
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
B2BShoppingCartFormHandler()
Constructs an instanceof B2BShoppingCartFormHandler
|
Modifier and Type | Method and Description |
---|---|
protected void |
addItemToOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
boolean pIsGift)
Adds the given item to the order (the shopping cart).
|
RepositoryItem |
getBillingAddress()
Get the billing address used when paying by invoice.
|
java.lang.String |
getBillingAddressId()
Return the repository id of the repository item that specifies which
billing address to use when paying by invoice.
|
java.lang.String |
getCancelOrderErrorURL()
Return the cancelOrderErrorURL property.
|
java.lang.String |
getCancelOrderSuccessURL()
Return the cancelOrderSuccessURL property.
|
CostCenter |
getCostCenter()
Returns property CostCenter
|
CostCenterManager |
getCostCenterManager()
Returns property CostCenterManager
|
java.lang.String |
getGenerateInvoiceCCName()
Return a magic string that, when used as the selectedCreditCardName,
indicates to this shopping cart form handler that the user wants to
pay by invoice instead of by credit card.
|
java.lang.String |
getOrderIdToCancel()
Return the orderIdToCancel property.
|
java.lang.String |
getPONumber()
Get the purchase order number associated with payment for the current
order.
|
protected java.lang.String |
getProductId(java.lang.String pSkuId,
DynamoHttpServletRequest pRequest)
we do not want to assume that the skus all come from the same product so we will maintain a sku to product mapping
a naming convention is used to look up a product id in the request given a skuid.
|
boolean |
handleCancelOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
boolean |
isPayByInvoice()
Return true if we should pay for this order by generating an
invoice.
|
void |
postCancelOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
void |
preCancelOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
void |
preMoveToConfirmation(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Override superclass preMoveToConfirmation to support purchasing by
invoice.
|
void |
setBillingAddressId(java.lang.String pBillingAddressId)
Set the repository id of the repository item that specifies which
billing address to use when paying by invoice.
|
void |
setCancelOrderErrorURL(java.lang.String pCancelOrderErrorURL)
Set the cancelOrderErrorURL property.
|
void |
setCancelOrderSuccessURL(java.lang.String pCancelOrderSuccessURL)
Set the cancelOrderSuccessURL property.
|
void |
setConfiguration(ShoppingCartModifierConfiguration pConfiguration)
Sets property Configuration, and in the process configures the following properties in addition to the base
properties:
costCenterManager
|
void |
setCostCenter(CostCenter pCostCenter)
Sets property CostCenter
|
void |
setCostCenterManager(CostCenterManager pCostCenterManager)
Sets property CostCenterManager
|
void |
setOrderIdToCancel(java.lang.String pOrderIdToCancel)
Set the orderIdToCancel property.
|
void |
setPONumber(java.lang.String pPONumber)
Set the purchase order number associated with payment for the current
order.
|
addSoftGoodToOrder, getAddSoftGoodToOrderErrorURL, getAddSoftGoodToOrderSuccessURL, getSoftGoodRecipientEmailAddress, getSoftGoodShippingGroupName, handleAddSoftGoodToOrder, initializeElectronicShippingGroup, initializeShippingGroup, postAddSoftGoodToOrder, preAddSoftGoodToOrder, setAddSoftGoodToOrderErrorURL, setAddSoftGoodToOrderSuccessURL, setSoftGoodRecipientEmailAddress, setSoftGoodShippingGroupName
addNewShippingAddress, copyAddressesToProfile, copyCreditCard, copyCreditCard, copyCreditCardToPaymentGroup, copyCreditCardToProfile, copyExistingAddress, copyProfileAddressToShippingGroupAddress, copyShallowCreditCardProperties, createGiftCertificatePaymentGroups, getAddGiftItemToOrderErrorURL, getAddGiftItemToOrderSuccessURL, getAddressesToCopy, getClaimableManager, getClaimableTools, getCommerceProfileTools, getCreateAddressErrorURL, getCreateAddressSuccessURL, getCreditCardProperties, getExpressCheckoutErrorURL, getExpressCheckoutSuccessURL, getGiftCertificateProperties, getMoveToNewShippingAddressErrorURL, getMoveToNewShippingAddressSuccessURL, getNewShippingAddressName, getOriginalShippingAddressName, getProfileAddressNames, getPropertyManager, getQuantityToMove, getSelectedCreditCardName, getShipToAddressName, getShipToDoneErrorURL, getShipToDoneSuccessURL, getShipToMultipleDoneErrorURL, getShipToMultipleDoneSuccessURL, getShipToMultipleErrorURL, getShipToMultipleSuccessURL, getValidateShippingGroupsChainId, handleAddGiftItemToOrder, handleCreateAddress, handleExpressCheckout, handleMoveToNewShippingAddress, handleShipToDone, handleShipToMultiple, handleShipToMultipleDone, isCreditCardEmpty, isGiftCertificateEmpty, isNewCreditCards, isNewGiftCertificates, isOrderRelationshipExists, isPaymentGroupEmpty, isSingletonRelationship, mergePaymentGroupsToOrder, moveCommerceItemsToNewShippingGroup, postAddGiftItemToOrder, postCreateAddress, postExpressCheckout, postMoveToConfirmation, postMoveToNewShippingAddress, postShipToDone, postShipToMultiple, postShipToMultipleDone, preAddGiftItemToOrder, preCreateAddress, preExpressCheckout, preMoveToNewShippingAddress, preShipToDone, preShipToMultiple, preShipToMultipleDone, removeAddedNickNameEntries, removeCreditCardPaymentGroupsFromOrder, removePaymentGroupsFromOrder, runProcessValidateShippingGroups, setAddGiftItemToOrderErrorURL, setAddGiftItemToOrderSuccessURL, setAddressesToCopy, setClaimableManager, setClaimableTools, setCommerceProfileTools, setCreateAddressErrorURL, setCreateAddressSuccessURL, setCreditCardProperties, setExpressCheckoutErrorURL, setExpressCheckoutSuccessURL, setGiftCertificateProperties, setMoveToNewShippingAddressErrorURL, setMoveToNewShippingAddressSuccessURL, setNewShippingAddressName, setOriginalShippingAddressName, setPaymentMethodsInOrder, setPropertyManager, setQuantityToMove, setSelectedCreditCardName, setShipToAddressName, setShipToDoneErrorURL, setShipToDoneSuccessURL, setShipToMultipleDoneErrorURL, setShipToMultipleDoneSuccessURL, setShipToMultipleErrorURL, setShipToMultipleSuccessURL, setValidateShippingGroupsChainId, updateShippingAddress
addConfigurableItemToOrder, addMoreParams, checkDuplicateDescription, checkFormRedirect, copyBillingAddrToShippingAddr, deleteItems, deleteItemsByRelationshipId, doStartService, getAddItemToOrderChainId, getAddItemToOrderErrorURL, getAddItemToOrderPricingOp, getAddItemToOrderSuccessURL, getCatalogKey, getCommerceItemIdToEdit, getCommerceItemToEdit, getConfigurableItemTypeName, getConfiguration, getCopyBillingAddrToShippingAddr, getCreditCardPaymentGroups, getCreditCardPaymentTypeName, getDeletedSkus, getDeleteItemsFromOrderPricingOp, getDescription, getEditItem, getEditItemErrorURL, getEditItemSuccessURL, getGiftCertificateNumbers, getGiftCertificatePaymentGroups, getGiftCertificatePaymentTypeName, getGiftlistId, getGiftlistItemId, getGiftlistManager, getItemAddedToOrderEventType, getItemRemovedFromOrderEventType, getLastOrder, getModifyOrderPricingOp, getMoveToConfirmationChainId, getMoveToConfirmationErrorURL, getMoveToConfirmationSuccessURL, getMoveToOrderCommitErrorURL, getMoveToOrderCommitSuccessURL, getMoveToPurchaseInfoByRelIdErrorURL, getMoveToPurchaseInfoByRelIdSuccessURL, getMoveToPurchaseInfoChainId, getMoveToPurchaseInfoErrorURL, getMoveToPurchaseInfoSuccessURL, getOrder, getOrderId, getOrderSavedEventType, getPaymentGroup, getRemovalCatalogRefIds, getRemovalCommerceIds, getRemovalRelationshipIds, getRemoveAndAddItemToOrderErrorURL, getRemoveAndAddItemToOrderSuccessURL, getRemoveItemFromOrderByRelationshipIdErrorURL, getRemoveItemFromOrderByRelationshipIdSuccessURL, getRemoveItemFromOrderErrorURL, getRemoveItemFromOrderSuccessURL, getRepriceOrder, getRepriceOrderChainId, getRepriceOrderErrorURL, getRepriceOrderSuccessURL, getSaveOrderErrorURL, getSaveOrderSuccessURL, getSessionExpirationURL, getSetOrderByRelationshipIdErrorURL, getSetOrderByRelationshipIdSuccessURL, getSetOrderChainId, getSetOrderErrorURL, getSetOrderSuccessURL, getShippingGroup, getShippingGroupCommerceItemRelationships, getShoppingCart, getUserPricingModels, handleAddConfigurableItemToOrder, handleAddItemToOrder, handleCheckForExpiredSession, handleEditItem, handleMoveToConfirmation, handleMoveToOrderCommit, handleMoveToPurchaseInfo, handleMoveToPurchaseInfoByRelId, handleRemoveAndAddItemToOrder, handleRemoveItemFromOrder, handleRemoveItemFromOrderByRelationshipId, handleRepriceOrder, handleSaveOrder, handleSetOrder, handleSetOrderByRelationshipId, haveId, isCheckForChangedQuantity, isFormSubmission, isFormSubmition, modifyOrder, modifyOrderByRelationshipId, postAddItemToOrder, postEditItem, postMoveToOrderCommit, postMoveToPurchaseInfo, postRemoveAndAddItemToOrder, postRemoveItemFromOrder, postRemoveItemFromOrderByRelationshipId, postRepriceOrder, postSaveOrder, postSetOrder, postSetOrderByRelationshipId, preAddItemToOrder, preEditItem, preMoveToOrderCommit, preMoveToPurchaseInfo, preRemoveAndAddItemToOrder, preRemoveItemFromOrder, preRemoveItemFromOrderByRelationshipId, preRepriceOrder, preSaveOrder, preSetOrder, preSetOrderByRelationshipId, runProcessAddItemToOrder, runProcessAddItemToOrder, runProcessMoveToConfirmation, runProcessMoveToPurchaseInfo, runProcessRepriceOrder, runProcessRepriceOrder, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSetOrder, runRepricingProcess, saveOrder, setAddItemToOrderChainId, setAddItemToOrderErrorURL, setAddItemToOrderPricingOp, setAddItemToOrderSuccessURL, setCheckForChangedQuantity, setCommerceItemIdToEdit, setCommerceItemProperties, setConfigurableItemTypeName, setCopyBillingAddrToShippingAddr, setCreditCardPaymentGroups, setCreditCardPaymentTypeName, setDeletedSkus, setDeleteItemsFromOrderPricingOp, setDescription, setEditItem, setEditItemErrorURL, setEditItemSuccessURL, setGiftCertificateNumbers, setGiftCertificatePaymentGroups, setGiftCertificatePaymentTypeName, setGiftlistId, setGiftlistItemId, setGiftlistManager, setItemAddedToOrderEventType, setItemRemovedFromOrderEventType, setModifyOrderPricingOp, setMoveToConfirmationChainId, setMoveToConfirmationErrorURL, setMoveToConfirmationSuccessURL, setMoveToOrderCommitErrorURL, setMoveToOrderCommitSuccessURL, setMoveToPurchaseInfoByRelIdErrorURL, setMoveToPurchaseInfoByRelIdSuccessURL, setMoveToPurchaseInfoChainId, setMoveToPurchaseInfoErrorURL, setMoveToPurchaseInfoSuccessURL, setOrderId, setOrderSavedEventType, setPaymentGroup, setRemovalCatalogRefIds, setRemovalCommerceIds, setRemovalRelationshipIds, setRemoveAndAddItemToOrderErrorURL, setRemoveAndAddItemToOrderSuccessURL, setRemoveItemFromOrderByRelationshipIdErrorURL, setRemoveItemFromOrderByRelationshipIdSuccessURL, setRemoveItemFromOrderErrorURL, setRemoveItemFromOrderSuccessURL, setRepriceOrder, setRepriceOrderChainId, setRepriceOrderErrorURL, setRepriceOrderSuccessURL, setSaveOrderErrorURL, setSaveOrderSuccessURL, setSessionExpirationURL, setSetOrderByRelationshipIdErrorURL, setSetOrderByRelationshipIdSuccessURL, setSetOrderChainId, setSetOrderErrorURL, setSetOrderSuccessURL, setShippingGroup, setShoppingCart, setUserPricingModels
acquireTransactionLock, addNewItemToOrder, afterSet, beforeSet, commitTransaction, createCommerceItem, defaultLocalLockManager, defaultUserProfile, ensureTransaction, findCommerceItem, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddress, getCatalogRefIds, getCatalogTools, getCreditCard, getCurrentTransaction, getDefaultLocale, getGeneralFailureURL, getGeneralSuccessURL, getGiftCertificate, getHardgoodShippingGroup, getLocalLockManager, getOrderManager, getPipelineManager, getProductId, getProfile, getQuantity, getQuantity, getResourceBundle, getResourceBundleName, getTransactionLockFactory, getTransactionManager, getUserLocale, handlePipelineError, isEnsureTransaction, isStringEmpty, isTransactionCreated, isTransactionMarkedAsRollBack, isUseLocksAroundTransactions, isUseRequestLocale, processException, processPipelineErrors, releaseTransactionLock, removeItemFromOrder, runProcess, runProcess, runProcess, setAddress, setCatalogRefIds, setCatalogTools, setCreditCard, setCurrentTransaction, setDefaultLocale, setEnsureTransaction, setGeneralFailureURL, setGeneralSuccessURL, setGiftCertificate, setHardgoodShippingGroup, setLocalLockManager, setOrder, setOrderManager, setPipelineManager, setProductId, setProfile, setQuantity, setTransactionCreated, setTransactionLockFactory, setTransactionManager, setTransactionToRollbackOnly, setUseLocksAroundTransactions, setUseRequestLocale, transactionLockName, unsetTransactionCreated
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
afterGet, beforeGet
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
public static final java.lang.String mGenerateInvoiceCCName
public B2BShoppingCartFormHandler()
public void setConfiguration(ShoppingCartModifierConfiguration pConfiguration)
setConfiguration
in class SoftGoodFormHandler
public void setCostCenterManager(CostCenterManager pCostCenterManager)
public CostCenterManager getCostCenterManager()
public void setCostCenter(CostCenter pCostCenter)
public CostCenter getCostCenter()
public java.lang.String getOrderIdToCancel()
public void setOrderIdToCancel(java.lang.String pOrderIdToCancel)
pOrderIdToCancel
- public java.lang.String getCancelOrderSuccessURL()
public void setCancelOrderSuccessURL(java.lang.String pCancelOrderSuccessURL)
pCancelOrderSuccessURL
- public java.lang.String getCancelOrderErrorURL()
public void setCancelOrderErrorURL(java.lang.String pCancelOrderErrorURL)
pCancelOrderErrorURL
- protected void addItemToOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, boolean pIsGift) throws javax.servlet.ServletException, java.io.IOException
After the item has been added to the order, the order will be repriced and a scenario event will be fired of type ItemAddedToOrder.
If pIsGift is true, this item is a gift and requires special handling. The giftlistManagers addGiftToOrder will get called.
addItemToOrder
in class ShoppingCartFormHandler
pRequest
- the servlet's requestpResponse
- the servlet's responsepIsGift
- If this is true, the added items are gifts. see
the giftlist property.javax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected java.lang.String getProductId(java.lang.String pSkuId, DynamoHttpServletRequest pRequest)
public java.lang.String getGenerateInvoiceCCName()
This is a big hack, but it appears to be necessary to support the user interface where each registered credit card is associated with one radio button and the "generate invoice" option is associated with a separate radio button, and all the radio buttons are mutually exclusive.
public void setPONumber(java.lang.String pPONumber)
public java.lang.String getPONumber()
public void setBillingAddressId(java.lang.String pBillingAddressId)
public java.lang.String getBillingAddressId()
public RepositoryItem getBillingAddress()
public boolean isPayByInvoice()
public void preMoveToConfirmation(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
This method consults the payByInvoice property to determine whether we are purchasing by invoice or by some other method. If the property is false, meaning payment is being made by credit card or some other method, the call is delegated to the superclass version of preMoveToConfirmation. (NB: jhtml authors will set the selectedCreditCardName to a magic value to indicate that the customer wants to pay by invoice. The payByInvoice property is computed by examining this property and looking for the magic value, which is itself specified by the genericInvoiceCCName property.
If payByInvoice is true, this method examines the current order and arranges for it to have a single payment group of type InvoiceRequest, whose properties are initialized from the PONumber and billingAddress properties of the form handler. (NB: jhtml authors will set the billingAddressId property in their jhtml forms. The id specified will be converted to a billing address object by the getBillingAddress method.)
This method will try to reuse an existing InvoiceRequest payment group if one is present in the order, and is the only payment group associated with the order. Otherwise it will delete any existing payment groups and payment relationships and replace them with a new InvoiceRequest.
preMoveToConfirmation
in class FullShoppingCartFormHandler
pRequest
- a value of type 'DynamoHttpServletRequest'pResponse
- a value of type 'DynamoHttpServletResponse'javax.servlet.ServletException
- if an error occursjava.io.IOException
- if an error occurspublic void preCancelOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void postCancelOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean handleCancelOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException