public class OrderFacadeClient extends CommonOrderFacadeClient
This class provides common methods that the order facade can use. This class also provides a set of convenient Java APIs to represent particular order operations. This set of Java APIs also includes APIs for Web-based requests to transform the name-value pair request into the appropriate request documents.
COMPONENT_NAMECHANGE_VERB_ACTION_ADD, CHANGE_VERB_ACTION_CHANGE, CHANGE_VERB_ACTION_CREATE, CHANGE_VERB_ACTION_DELETE, CHANGE_VERB_ACTION_UPDATE| Constructor and Description |
|---|
OrderFacadeClient()
The default constructor of the class.
|
OrderFacadeClient(BusinessContextType businessContext,
javax.security.auth.callback.CallbackHandler callbackHandler)
This method constructs an object by business context and call back
handler.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map |
addConfigurationToCart(java.util.Map parameters)
This method adds a configuration of dynamic kit to shopping cart
based on the enumerated parameters.
|
RespondOrderDataAreaType |
addDynamicKitOrderItem(OrderType order,
OrderItemType[] orderItems)
This method adds dynamic kit order items.
|
java.util.Map |
addOrderItem(java.util.Map parameters)
This method adds an order item based on the enumerated parameters.
|
java.util.Map |
addPreConfigurationToCart(java.util.Map parameters)
This method adds a pre-configuration of dynamic kit to shopping cart
based on the enumerated parameters.
|
java.util.Map |
cancelScheduledOrder(java.util.Map parameters)
This method cancels a scheduled order based on the enumerated parameters.
|
java.util.Map |
changeReceipt(java.util.Map parameters)
This method populates parameters to a string array from the input then
updates receipt information to order.
|
java.util.Map |
deleteOrderItem(java.util.Map parameters)
This method deletes order items based on the enumerated parameters.
|
java.util.Map |
findReceiptByOrderId(java.util.Map parameters)
This method find receipt information of the order based on the enumerated
parameters.
|
java.util.Map |
scheduleOrder(java.util.Map parameters)
This method creates a scheduled order based on the enumerated parameters.
|
java.util.Map |
updateConfigurationInCart(java.util.Map parameters)
This method updates configuration of a dynamic kit in shopping cart
based on the enumerated parameters.
|
RespondOrderDataAreaType |
updateDynamicKitOrderItem(OrderType order,
OrderItemType[] orderItems)
This method updates dynamic kit order items.
|
java.util.Map |
updateOrderGiftInfo(java.util.Map parameters)
This method updates the gift information of the order based on the
enumerated parameters.
|
java.util.Map |
updateOrderItem(java.util.Map parameters)
This method updates multiple order items of an order based on the
enumerated parameters.
|
java.util.Map |
updateOrderShippingInfo(java.util.Map parameters)
This method updates the shipping information of the order based on the
enumerated parameters.
|
java.util.Map |
updateOrderStatus(java.util.Map parameters)
This methods updates the Order status.
|
addOrderItem, addOrderItem, addOrderItem, addPaymentInstruction, addPaymentInstruction, applyCoupon, applyCoupon, applyPromotionCode, applyPromotionCode, calculateOrder, calculateOrder, cancelShoppingCart, cancelShoppingCart, changeOrder, createAcknowledgeOrder, createChangeOrder, createGetOrder, createGetVerb, createProcessOrder, createRespondOrder, createShowOrder, createSyncOrder, findByOrderId, findByOrderId, findByOrderId, findByOrderStatus, findByOrderStatus, findConfigurationByOrderItemId, findCurrentShoppingCart, findCurrentShoppingCart, findCurrentShoppingCart, findOrderByExternalOrderID, findOrderByStoreMemberAndPlacedDate, findOrderItemByStoreMemberAndCreateDate, findPurchaseHistory, findPurchaseHistoryItemsWithProductID, findPurchaseHistoryItemsWithValue, findQuoteByExternalQuoteID, findQuotesByStatus, findScheduledOrder, findShoppingCartItemsWithProductID, findShoppingCartItemsWithValue, findUsablePaymentOrShipInformation, findUsableShippingInfoByOrderID, lockOrder, lockOrder, prepareOrder, prepareOrder, processOrder, processOrder, removeCoupon, removeCoupon, removePaymentInstruction, removePaymentInstruction, removePromotionCode, removePromotionCode, repay, repay, submitOrder, submitOrder, syncOrder, syncOrder, unlockOrder, unlockOrder, updateOrderItem, updateOrderItem, updateOrderShippingInfo, updateOrderShippingInfo, updatePaymentInstruction, updatePaymentInstruction, updateRewardOption, updateRewardOptionchangeOrder, changeOrder, changeQuote, getOrder, getOrder, getOrder, getQuote, getQuote, getQuote, processOrder, processOrder, processQuote, syncOrder, syncQuotecreateActionExpression, createChangeVerb, createGetVerb, createGetVerb, createProcessVerb, createSyncVerbpublic OrderFacadeClient()
public OrderFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
businessContext - the business context.callbackHandler - the call back handler.public java.util.Map addOrderItem(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#addOrderItem(Map) method
to add the order items.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("quantity_0", new String[] { "3" });
parameters.put("catEntryId_0", new String[] { "10002"});
parameters.put("externalId_0", new String[] { "1000" });
parameters.put("giftMessage_0", new String[] { "Happy Birthday" });
parameters.put("quantity_1", new String[] { "4" });
parameters.put("catEntryId_1", new String[] { "10003");
parameters.put("externalId_1", new String[] { "1001" });
parameters.put("giftMessage_1", new String[] { "A Wedding Gift" });
parameters.put("contractId", new String[] { "10001"});
parameters.put("UOM", new String[] { "C62" });
parameters.put("attrName_0_0", new String[]{"10238"});
parameters.put("attrName_0_1", new String[]{"10239"});
parameters.put("attrName_0_2", new String[]{"10240"});
parameters.put("attrName_1_0", new String[]{"10235"});
parameters.put("attrName_1_1", new String[]{"10236"});
parameters.put("attrName_1_2", new String[]{"10237"});
parameters.put("attrValue_0_0", new String[]{"Red"});
parameters.put("attrValue_0_1", new String[]{"1"});
parameters.put("attrValue_0_2", new String[]{"Dinner plate only"});
parameters.put("attrValue_1_0", new String[]{"Red"});
parameters.put("attrValue_1_1", new String[]{"1"});
parameters.put("attrValue_1_2", new String[]{"5-piece setting"});
Map response = client.addOrderItem(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
addOrderItem in class CommonOrderFacadeClientparameters - The map that contains the orderId, quantity,
catEntryId, contractId, UOM,
externalId and giftMessage. The last
two parameters, externalId and
giftMessage are related with
gift list. They should be put into the map when
the order item is a gift which is purchased by the gift giver.
orderId : The order ID of the order to which the order item will be added;
if no order ID is provided, the current pending order
is used. Abbreviations can be used: '.' stands for current pending order,
'**' means to create a new order.
quantity: The quantity of the added product.
catEntryId: The catalog entry ID of the added product.
contractId : The contract ID of the contract on which the order item addition is based.
UOM: The unit of measure of the order item.
externalId: The external gift list id.
giftMessage: The gift message along with the gift.
OrderExceptionpublic java.util.Map updateOrderItem(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#updateOrderItem(Map) method to
update the order items.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("quantity_0",new String[]{"30"});
parameters.put("orderItemId_0",new String[]{"10001");
parameters.put("shipToRegistrant_0", new String[]{"1"};
parameters.put("quantity_1",new String[]{"40"});
parameters.put("orderItemId_1",new String[]{"10002");
parameters.put("shipToRegistrant_1", new String[]{"1"};
parameters.put("contractId",new String[]{"10001"});
parameters.put("UOM",new String[]{"C62"});
parameters.put("allocate", new String[] {"*aig,*ubg"});
parameters.put("backorder", new String[] {"***"});
Map response = client.updateOrderItem(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
updateOrderItem in class CommonOrderFacadeClientparameters - The map that contains the quantity, orderId, orderItemId,
contractId, UOM and shipToRegistrant
.
orderId : An optional parameter which is the order ID that contains the updated order items.
quantity: The quantity of the updated product.
orderItemId: The order item ID to be updated.
contractId: The contract ID of the contract on which the order item update is based.
UOM: The unit of measure of the order item.
shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
OrderExceptionpublic java.util.Map deleteOrderItem(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#deleteOrderItem(Map)
method to delete the order items.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderItemId_0", new String[] { "10002" });
parameters.put("orderItemId_1", new String[] { "10003" });
Map response = client.deleteOrderItem(parameters);
String[] outorderId = (String[]) response.get("orderId");
deleteOrderItem in class CommonOrderFacadeClientparameters - The map that contains the orderId and orderItemId.
orderId : An optional parameter that contains the order ID of the order from which the order item will be deleted.
orderItemId: The order item ID to delete.
OrderExceptionpublic java.util.Map updateOrderShippingInfo(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#updateOrderShippingInfo(Map) method
to update the shipping information.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("ShipAsComplete",new String[]{"N"});
parameters.put("orderId",new String[]{"10001"});
parameters.put("requestedShipDate",new String[]{"2006-12-24T03:32:34.953Z"});
parameters.put("shipModeId_0",new String[]{"10001"});
parameters.put("shipModeId_1",new String[]{"10002"});
parameters.put("addressId",new String[]{"11301"});
parameters.put("shipInstructions",new String[]{"hello"});
parameters.put("orderItemId_0",new String[]{"120001"});
parameters.put("orderItemId_1",new String[]{"120002"});
parameters.put("shipToRegistrant_0", new String[]{"1"};
parameters.put("shipToRegistrant_1", new String[]{"1"};
parameters.put("allocate", new String[] {"*aig,*ubg"});
parameters.put("backorder", new String[] {"***"});
Map response = client.updateOrderShippingInfo(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
updateOrderShippingInfo in class CommonOrderFacadeClientparameters - The map that contains the following keys: ShipAsComplete,
orderId, orderItemId, requestedShipDate, shipModeId,
isExpedited, addressId, shipInstructions, tieShipCode,
shipToRegistrant.
orderId : The order ID to be updated.
orderItemId: The order item ID to be updated.
ShipAsComplete: The flag to specify whether the order is shipped as complete.
requestedShipDate : The requested ship date of the order item.
shipModeId: The ship mode ID.
isExpedited: The value to specify whether the ship information is expedited.
addressId: The address ID.
shipInstructions: The ship instructions of the order.
tieShipCode: The tie ship code.
shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
OrderExceptionpublic java.util.Map updateOrderGiftInfo(java.util.Map parameters)
throws OrderException
Gift Registry when the order is made by the gift sender to
purchase gifts. It applies to all the gift items inside the order. It
calls the
CommonOrderFacadeClient#updateOrderShippingInfo(Map) method
to update the gift information.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderId",new String[]{"10001"});
parameters.put("giftMessage", new String[]{"Happy Birthday"};
parameters.put("shipToRegistrant", new String[]{"1"};
Map response = client.updateOrderGiftInfo(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
updateOrderGiftInfo in class CommonOrderFacadeClientparameters - The map that contains the following keys: orderId,
giftMessage, shipToRegistrant.
orderId : The order ID to be updated.
giftMessage: A parameter indicating a gift message along with the gift.
shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
OrderExceptionpublic java.util.Map updateOrderStatus(java.util.Map parameters)
throws OrderException
SyncOrder
with an action of Update.
The following sample code demonstrates how to compose the parameter map:
Map mapOrderStatus = new HashMap();
mapOrderStatus.put("orderId", orderId);
mapOrderStatus.put("merchantOrderNumber", "MO001");
mapOrderStatus.put("currency", "USD");
mapOrderStatus.put("priceTotal", "100");
mapOrderStatus.put("shippingTotal", "10");
mapOrderStatus.put("taxTotal", "8");
mapOrderStatus.put("shippingTaxTotal", "0.8");
mapOrderStatus.put("orderStatus", "G");
mapOrderStatus.put("comment", "Commet1");
mapOrderStatus.put("placeDateTime", "2008-06-01T15:30:11.656Z");
mapOrderStatus.put("lastUpdateTime", "2008-06-18T15:30:11.656Z");
mapOrderStatus.put("sequenceNumber", "10");
mapOrderStatus.put("requestShipDateTime", "2008-06-20 15:30:11.656");
mapOrderStatus.put("shipCondtion", "SC");
mapOrderStatus.put("shippingModeFlag", "O");
Vector vecOrderItems = new Vector(orderItemIdOut.length);
for(int i=0; i<orderItemIdOut.length; i++) {
Map mapOrderItemStatus = new HashMap();
mapOrderItemStatus.put("orderItemId", orderItemIdOut[i]);
mapOrderItemStatus.put("merchantItemNumber", "MOI00"+i);
mapOrderItemStatus.put("partNumber", "FULO-0101");
mapOrderItemStatus.put("quantityRequested", "9");
mapOrderItemStatus.put("itemComment", "ItemComment"+i);
mapOrderItemStatus.put("orderItemStatus", "G");
mapOrderItemStatus.put("actualShipDateTime", "2008-06-05T15:30:11.656Z");
mapOrderItemStatus.put("unitPrice", "1.20");
mapOrderItemStatus.put("currency", "USD");
mapOrderItemStatus.put("priceTotal", "58");
mapOrderItemStatus.put("shippingTotal", "6");
mapOrderItemStatus.put("taxTotal", "5");
mapOrderItemStatus.put("shippingTaxTotal", "0.8");
mapOrderItemStatus.put("requestShipDateTime", "2008-06-06T15:30:11.656Z");
vecOrderItems.add(mapOrderItemStatus); }
mapOrderStatus.put("itemsVector", vecOrderItems);
parameters - The parameters to format into the SyncOrder
document.OrderException - if an exception occurs.public java.util.Map scheduleOrder(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#scheduleOrder(Map)
method to create the schedule order.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderId_0",new String[]{"10001"});
parameters.put("strStartDate_0",new String[]{"2006-12-24T03:32:34.953Z"});
parameters.put("interval_0",new String[]{"10"});
Map response = client.scheduleOrder(parameters);
String[] outorderId = (String[]) response.get("orderId");
scheduleOrder in class CommonOrderFacadeClientparameters - The map that contains the following keys: orderId,
strStartDate, interval.
orderId : The order ID to be updated.
strStartDate: The startDate when this order will be placed.
interval: At which time interval this order will be repeated placed.
The unit is second.
OrderExceptionpublic java.util.Map cancelScheduledOrder(java.util.Map parameters)
throws OrderException
CommonOrderFacadeClient#cancelScheduledOrder(Map) method to
cancel the schedule order.
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderId_0",new String[]{"10001"});
Map response = client.cancelScheduledOrder(parameters);
String[] outorderId = (String[]) response.get("orderId");
cancelScheduledOrder in class CommonOrderFacadeClientparameters - The map that contains the following keys: orderId.
orderId : The order ID to be canceled.
OrderExceptionpublic java.util.Map changeReceipt(java.util.Map parameters)
throws OrderException
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderId",new String[]{"10001"});
parameters.put(OrderFacadeConstants.RECEIPT_TYPE,new String[]{"Company"});
parameters.put(OrderFacadeConstants.RECEIPT_TITLE,new String[]{"ABC Company"});
parameters.put(OrderFacadeConstants.RECEIPT_CONTENT,new String[]{"furniture"});
parameters.put(OrderFacadeConstants.RECEIPT_INSTRUCTION,new String[]{"One receipt for each item."});
parameters.put(OrderFacadeConstants.RECEIPT_ADDRESS_ID,new String[]{"10003"});
Map response = client.changeReceipt(parameters);
String[] outorderId = (String[]) response.get("orderId");
parameters - The map that contains the one keys : OrderFacadeConstants.ORDER_ID : the order Id. It is
mandatory field. OrderFacadeConstants.RECEIPT_ACTION : the action. It
is mandatory field. OrderFacadeConstants.RECEIPT_ACTION_DISCARD for
discard. OrderFacadeConstants.RECEIPT_ACTION_CHANGE for
change. OrderFacadeConstants.RECEIPT_TYPE : the
receipt type. It is optional field. OrderFacadeConstants.RECEIPT_TITLE : the receipt
title. It is optional field. OrderFacadeConstants.RECEIPT_CONTENT : the receipt
content. It is optional field. OrderFacadeConstants.RECEIPT_INSTRUCTION : the receipt
instruction. It is optional field. OrderFacadeConstants.RECEIPT_ADDRESS_ID : the receipt
shipping address Id. It is optional field. OrderFacadeConstants.RECEIPT_FIELD1 : the receipt
extra field 1. It is optional field. OrderFacadeConstants.RECEIPT_FIELD2 : the receipt
extra field 2. It is optional field. OrderFacadeConstants.RECEIPT_FIELD3 : the receipt
extra field 3. It is optional field.OrderExceptionpublic java.util.Map findReceiptByOrderId(java.util.Map parameters)
throws OrderException
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderId",new String[]{"10001"});
Map response = client.findReceiptByOrderId(parameters);
String[] receiptType = (String[]) response.get(OrderReceiptConstants.RECEIPT_TYPE);
String[] receiptTitle = (String[]) response.get(OrderReceiptConstants.RECEIPT_TITLE);
String[] receiptContent = (String[]) response.get(OrderReceiptConstants.RECEIPT_CONTENT);
parameters - The map that contains the one keys :
orderId : The order ID to be updated.
OrderReceiptConstants#RECEIPT_TYPE : the receipt type.
OrderReceiptConstants#RECEIPT_TITLE : the receipt
title. OrderReceiptConstants#RECEIPT_CONTENT : the
receipt content. OrderReceiptConstants#RECEIPT_INSTRUCTION : the receipt
instruction. OrderReceiptConstants#RECEIPT_ADDRESS_ID
: the receipt shipping address Id. OrderReceiptConstants#RECEIPT_FIELD1 : the receipt extra
field 1. OrderReceiptConstants#RECEIPT_FIELD2 : the
receipt extra field 2. OrderReceiptConstants#RECEIPT_FIELD3 : the receipt extra
field 3.OrderExceptionpublic java.util.Map addPreConfigurationToCart(java.util.Map parameters)
throws OrderException
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("quantity_1", "3");
parameters.put("catEntryId_1", "2000001");
Map response = client.addPreConfigurationToCart(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
parameters - The map that contains quantity and catEntryId
quantity: The quantity of the dynamic kit to be added.
catEntryId: The catalog entry ID of the dynamic kit to be added.
OrderExceptionpublic java.util.Map addConfigurationToCart(java.util.Map parameters)
throws OrderException
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("ConfigXML_1", configurationXML);
Map response = client.addConfigurationToCart(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
parameters - The map that contains configurationXML
ConfigXML: The configuration XML of the dynamic kit to be added.
OrderExceptionpublic java.util.Map updateConfigurationInCart(java.util.Map parameters)
throws OrderException
The following sample code demonstrates how to use the API:
Map parameters = new HashMap();
parameters.put("orderItemId_1", orderItemId);
parameters.put("ConfigXML_1", configurationXML);
Map response = client.updateConfigurationInCart(parameters);
String[] outorderId = (String[]) response.get("orderId");
String[] outOrderItemId = (String[]) response.get("orderItemId");
parameters - The map that contains orderItemId and configurationXML
orderItemId: Id of the order item to be updated
ConfigXML: The new configuration XML of the dynamic kit.
OrderExceptionpublic RespondOrderDataAreaType addDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems) throws OrderException
order - The order to which the order items are added.orderItems - An array of order items to be added.RespondOrderDataAreaType that contains the
order Id and order item IDs.OrderExceptionpublic RespondOrderDataAreaType updateDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems) throws OrderException
order - The order in which the order items are updated.orderItems - An array of order items to be updated.RespondOrderDataAreaType that contains the
order Id and order item IDs.OrderException