public class SimpleOrderManager extends OrderManager
OrderManager om = getOrderManager();
String profileId = "10000";
String catalogRefId1 = "sku-1";
String catalogRefId2 = "sku-2";
String productId1 = "product-1";
String productId2 = "product-2";
long quantity1 = 1;
long quantity2 = 2;
// create the Order. The Order has a ShippingGroup and PaymentGroup in it when
// constructed
Order order = om.createOrder(profileId);
// get the ShippingGroup and add the items to it
ShippingGroup sg = (ShippingGroup) order.getShippingGroups().get(0);
item1 = om.addItemToShippingGroup(order, catalogRefId1, productId1, quantity1, sg.getId());
item2 = om.addItemToShippingGroup(order, catalogRefId2, productId2, quantity2, sg.getId());
// checkout the Order and iterate through the result object displaying errors
PipelineResult pr = om.processOrder(order);
if (pr.hasErrors()) {
Object[] keys = pr.getErrorKeys();
for (int i = 0; i < keys.length; i++)
System.out.println(pr.getError(keys[i]));
}
OrderManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
mOrderManager, mOrderMergeListeners, mUserPricingModelsPath, sResourceBundle
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 |
---|
SimpleOrderManager()
Constructs a SimpleOrderManager object.
|
Modifier and Type | Method and Description |
---|---|
CommerceItem |
addItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity,
ShippingGroup pShippingGroup)
This method adds a new item to the order and shippingGroup.
|
CommerceItem |
addItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity,
java.lang.String pShippingGroupId)
This method adds a new item to the order and shippingGroup.
|
void |
moveItemToShippingGroup(Order pOrder,
CommerceItem pCommerceItem,
long pQuantity,
ShippingGroup pSrcShippingGroup,
ShippingGroup pDestShippingGroup)
This method moves an item from one ShippingGroup to another.
|
void |
moveItemToShippingGroup(Order pOrder,
java.lang.String pCatalogRefId,
long pQuantity,
java.lang.String pSrcShippingGroupId,
java.lang.String pDestShippingGroupId)
This method moves an item from one ShippingGroup to another.
|
void |
removeItemFromShippingGroup(Order pOrder,
CommerceItem pCommerceItem,
ShippingGroup pShippingGroup,
long pQuantity)
This method removes an item from the order and shippingGroup.
|
void |
removeItemFromShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
This method removes an item from the order and shippingGroup.
|
addAsSeparateItemToOrder, addHandlingInstructionToShippingGroup, addItemAmountToPaymentGroup, addItemQuantityToShippingGroup, addItemToOrder, addOrder, addOrderAmountToPaymentGroup, addOrderMergeListener, addPaymentGroupToOrder, addPaymentGroupToOrder, addRemainingItemAmountToPaymentGroup, addRemainingItemQuantityToShippingGroup, addRemainingOrderAmountToPaymentGroup, addRemainingShippingCostToPaymentGroup, addRemainingTaxAmountToPaymentGroup, addShippingCostAmountToPaymentGroup, addShippingGroupToOrder, addTaxAmountToPaymentGroup, areOrdersMergeable, cloneShippingGroup, compareElectronicShippingGroups, compareGiftlistHandlingInstructions, compareHandlingInstructions, compareHardgoodShippingGroups, compareInStorePickupShippingGroups, copyAddress, copyAddress, copyAddress, copyHandlingInstruction, createCommerceItem, createCommerceItem, createCommerceItem, createCommerceItem, createCommerceItem, createCommerceItem, createCommerceItem, createCommerceItem, createHandlingInstruction, createHandlingInstruction, createHandlingInstruction, createHandlingInstruction, createOrder, createOrder, createOrder, createOrder, createOrder, createOrder, createPaymentGroup, createPaymentGroup, createRelationship, createShippingGroup, createShippingGroup, createShippingGroup, doStartService, getAllCommerceItemRelationships, getAllOrderRelationships, getAllPaymentGroupRelationships, getAllShippingGroupRelationships, getCatalogTools, getCommerceItemItemDescriptorName, getCommerceItemManager, getCommerceItemOrderPropertyName, getCommerceItemsFromPaymentGroup, getCommerceItemsFromShippingGroup, getCostCenterItemDescriptorName, getCostCenterOrderPropertyName, getDateRangeQuery, getDebugOrderRepositoryItemUpdateTransaction, getDefaultLocale, getDefaultOrderByDirection, getDefaultOrderByProperty, getHandlingInstructionManager, getHandlingInstructionsForCommerceItem, getJNDIContext, getOrderCommerceItemsPropertyName, getOrderCostCentersPropertyName, getOrderCountForProfile, getOrderCountForProfileInState, getOrderForCommerceItem, getOrderForCostCenter, getOrderForPaymentGroup, getOrderForRelationship, getOrderForShippingGroup, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfile, getOrderIdsForProfileWithinDateRange, getOrderIdsWithinDateRange, getOrderItemDescriptorName, getOrderManager, getOrderPaymentGroupsPropertyName, getOrderQueries, getOrderRelationshipsPropertyName, getOrdersForProfile, getOrdersForProfile, getOrdersForProfile, getOrdersForProfile, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrdersForProfileInState, getOrderShippingGroupsPropertyName, getOrderTools, getOrderVersionPropertyName, getPaymentGroupCommerceItemRelationship, getPaymentGroupItemDescriptorName, getPaymentGroupManager, getPaymentGroupOrderPropertyName, getPaymentGroupOrderRelationship, getPaymentGroupShippingGroupRelationship, getPipelineManager, getProcessOrderMap, getRelationshipItemDescriptorName, getRelationshipOrderPropertyName, getRemainingQuantityForShippingGroup, getShipItemRelsForRange, getShippingGroupByDescription, getShippingGroupCommerceItemRelationship, getShippingGroupItemDescriptorName, getShippingGroupManager, getShippingGroupOrderPropertyName, getSiteGroupManager, getUnassignedQuantityForCommerceItem, getUniqueCatalogRefIds, getUserPricingModelsPath, getValidOrderProcessingStates, getValidProcessOrderErrorStates, initializeCreditCard, initializeDefaultPropertyValues, initializeGiftCertificate, isCreateSGRelationshipsOnMerge, isOrderStateValidForProcessing, isTransactionMarkedAsRollBack, loadOrder, loadOrders, markTransactionForRollback, mergeOrders, mergeOrders, orderExists, processOrder, processOrder, processOrder, processOrder, processOrderWithReprice, processOrderWithReprice, recalculatePaymentGroupAmounts, removeAllCommerceItemsFromOrder, removeAllHandlingInstructionsFromShippingGroup, removeAllPaymentGroupsFromOrder, removeAllRelationshipsFromCommerceItem, removeAllRelationshipsFromPaymentGroup, removeAllRelationshipsFromShippingGroup, removeAllShippingGroupsFromOrder, removeEmptyPaymentGroups, removeEmptyShippingGroups, removeHandlingInstructionFromShippingGroup, removeHandlingInstructionsFromShippingGroup, removeItemAmountFromPaymentGroup, removeItemFromOrder, removeItemFromPaymentGroupInternal, removeItemQuantityFromShippingGroup, removeOrder, removeOrderAmountFromPaymentGroup, removeOrderFromPaymentGroupInternal, removeOrderMergeListener, removePaymentGroupFromOrder, removeRemainingItemAmountFromPaymentGroup, removeRemainingItemQuantityFromShippingGroup, removeRemainingOrderAmountFromPaymentGroup, removeRemainingShippingCostFromPaymentGroup, removeRemainingTaxAmountFromPaymentGroup, removeShippingCostAmountFromPaymentGroup, removeShippingCostFromPaymentGroupInternal, removeShippingGroupFromOrder, removeTaxAmountFromPaymentGroup, resetOrder, resetOrderCommerceItemRelationships, returnCommerceItem, sendOrderMergeEvent, setCommerceItemItemDescriptorName, setCommerceItemManager, setCommerceItemOrderPropertyName, setCostCenterItemDescriptorName, setCostCenterOrderPropertyName, setCreateSGRelationshipsOnMerge, setDebugOrderRepositoryItemUpdateTransaction, setDefaultLocale, setDefaultOrderByDirection, setDefaultOrderByProperty, setHandlingInstructionManager, setOrderCommerceItemsPropertyName, setOrderCostCentersPropertyName, setOrderItemDescriptorName, setOrderPaymentGroupsPropertyName, setOrderQueries, setOrderRelationshipsPropertyName, setOrderShippingGroupsPropertyName, setOrderTools, setOrderVersionPropertyName, setPaymentGroupItemDescriptorName, setPaymentGroupManager, setPaymentGroupOrderPropertyName, setRelationshipItemDescriptorName, setRelationshipOrderPropertyName, setShippingGroupItemDescriptorName, setShippingGroupManager, setShippingGroupOrderPropertyName, setSiteGroupManager, setUserPricingModelsPath, setValidOrderProcessingStates, setValidProcessOrderErrorStates, splitShippingGroup, splitShippingGroup, splitShippingGroupWithImplicitRelationships, updateOrder, validateOrder, validateOrder, validateOrder
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 SimpleOrderManager()
public CommerceItem addItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, java.lang.String pShippingGroupId) throws CommerceException
pOrder
- the order which the item is to be added topCatalogRefId
- the catalogRefId of the item being addedpProductId
- the productId of the item being addedpQuantity
- the quantity to addpShippingGroupId
- the id of the shippingGroup to add the item toCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public CommerceItem addItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity, ShippingGroup pShippingGroup) throws CommerceException
pOrder
- the order which the item is to be added topCatalogRefId
- the catalogRefId of the item being addedpProductId
- the productId of the item being addedpQuantity
- the quantity to addpShippingGroup
- the shippingGroup to add the item toCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the order which the item is to be added topCommerceItem
- the CommerceItem to removepShippingGroup
- the shippingGroup to remove the item frompQuantity
- the quantity to removeCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemFromShippingGroup(Order pOrder, CommerceItem pCommerceItem, ShippingGroup pShippingGroup, long pQuantity) throws CommerceException
pOrder
- the order which the item is to be added topCommerceItem
- the CommerceItem to removepShippingGroup
- the shippingGroup to remove the item frompQuantity
- the quantity to removeCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToShippingGroup(Order pOrder, java.lang.String pCatalogRefId, long pQuantity, java.lang.String pSrcShippingGroupId, java.lang.String pDestShippingGroupId) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcShippingGroupId
- the id of the shippingGroup to move the item frompDestShippingGroupId
- the id of the shippingGroup to move the item toCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToShippingGroup(Order pOrder, CommerceItem pCommerceItem, long pQuantity, ShippingGroup pSrcShippingGroup, ShippingGroup pDestShippingGroup) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcShippingGroup
- the shippingGroup to move the item frompDestShippingGroup
- the shippingGroup to move the item toCommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.