This URL submits an order. The order must have been locked by OrderPrepare. Once the OrderProcess URL begins running, the order cannot be cancelled with OrderCancel.
URL structure
- http://host_name/path/
- The fully qualified name of your WebSphere Commerce Server and the configuration path.
Parameter values
- forUser
- The logon ID of the user on whose behalf the command will be run; only a person with the authority to process orders can specify this parameter.
- forUserId
- Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
- langId
- Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
- storeId
- The reference number of the store with which the order is to be placed. This value is ignored unless an error occurs before the order is resolved. It is used only to call the correct store's exception handler.
- orderId
- (Required) The reference number of the order to be processed. This parameter can be repeated.
- externalUserId
- Specifies a user ID to be sent with the order transfer request.
- externalPassword
- Specifies a password for the user ID specified by the externalUserId parameter.
- transferMode
- Specifies the mode of transfer to an external system. A value of 0 transfers the order without payment information (shopping-cart transfer). A value of 1 transfers the order with payment information (purchase-order transfer). The default value of this parameter is 0.
- billtoAddressId
- The reference number of the address to bill.
- field1, field2, and field3
- Customizable fields.
- notify_[msgtype]_transportname_attributename
- Specifies configuration attributes applicable to order notification for a given message type and message transport. Message type is optional. If it is not specified, the configuration attribute is applicable to all message types.
For example:
- Send the "order received" e-mail notification for orders processed by this command to 2 e-mail addresses, john@ibm.com and victor@ibm.com:
-
notify_OrderReceived_EMailSender_recipient=john@ibm.com,victor@ibm.com
where OrderReceived is from MSGTYPES.NAME and EMailSender is from TRANSPORT.NAME. - Send all types of order e-mail notifications to jack@ibm.com:
notify_EMailSender_recipient=jack@ibm.com
where EMailSender is from TRANSPORT.NAME.
- notifyMerchant
- Whether the store is notified when the order processing is complete. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments.
1=Yes
0=No - notifyShopper
- Whether the customer is notified when the order processing is complete. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments.
1=Yes
0=No - quoteExpiryPolicy
- Defines the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation. Order total expires if the current time is greater than or equal to the order last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:
- alwaysProceed
- Always proceed with processing the order after recalculating order total.
- stopOnBiggerTotal
- Proceed with processing the order if the recalculated order total is unchanged or less than the previous order total. Otherwise, redirect to a URL specified by the quoteExpiredUrl.
- neverProceed
- Always redirect to the URL specified by the quoteExpiredUrl parameter.
- quoteExpiredURL
- Specifies the URL to redirect to if the order total expired in agreement with the expiry policy specified by the quoteExpiryPolicy parameter.
- notifyOrderSubmitted
- Specifies whether the customer is notified when the order is successfully submitted for processing. 1=Yes 0=No (default)
- availabilityChangeURL
- Specifies the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the maxAvailabilityChange parameter. This parameter is ignored if ATP inventory allocation is not enabled.
- maxAvailabilityChange
- Specifies the time interval, in seconds, mentioned in the availabilityChangeURL parameter description. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL parameter is not specified, or if ATP inventory allocation is not enabled.
- noInventoryURL
- Specifies the URL to redirect to if any of the order items in the order cannot be allocated or backordered. This parameter is ignored if ATP inventory allocation is not enabled.
- tcId
- The identifier of a Terms and Conditions object (refer to the TERMCOND table). If this is specified, and if it identifies a PaymentTC, and if that PaymentTC specifies a memberId and an address nickName (refer to the PaymentTC mapping), then the memberId and address nickName are used to determine the billing address, in which case the billToAddressId parameter is ignored.
-
Notes about payments: The OrderProcess command does not itself handle payments. To handle payments, use the DoPaymentCmd interface class, which DoPayment task commands would implement. The parameters that are passed from OrderProcess to this command can be anything, although they would typically implement credit card information.
WebSphere Commerce includes two implementation classes of the OH task command, the DoPaymentCmdImpl class and the DoPaymentMPFCmdImpl class. The DoPaymentCmdImpl class is a sample implementation used to show how one could write a DoPayment task command implementation that works with the OrderProcess command. The DoPaymentMPFCmdImpl class is the standard DoPaymentCmd implementation class designed for use with the IBM WebSphere Payment Manager, Version 3.1 and includes support for the Business-to-Business functions introduced with this release of WebSphere Commerce Business Edition.
Notes about order notification:
If you need to configure order notification, you will need to do the following:- Enable outbound messaging.
- Create message composition templates for composing order notification messages.
- quotationSubmission
- Controls whether the relType attribute values for "selection" OrderQuotationRel objects that identify the order being processed with their childId attribute should be changed to "submission". A value of 0 does not change the relType attributes of the OrderQuotationRel objects in the list to indicate "submission"; a value of 1 changes the relType attributes of the OrderQuotationRel objects in the list to indicate "submission". The default value is 0.
- reduceParentQuantities
- Controls whether quantities of order items in the selection parent order are reduced by the quantities of order items in the order being processed. A value of 0 does not reduce parent quantities; a value of 1 reduces parent quantities. The default value is 0.
In any case, the parent order is only updated when it has a status attribute 'P' or 'E'; and only those order items that have the same CatalogEntryId, SpecifiedItemId, and correlationGroup attribute values as the order items in the order being processed are updated.
Example 1
The following command processes the placing of an order whose reference number is 3.
http://myhostname/webapp/wcs/stores/servlet/OrderProcess?orderId=3
Example 2
Assuming that Payment Manager has been already set up, this command passes the customer's payment information to Payment Manager. The parameter policyId=200 refers to the OfflineCard method which the store model uses by default for Payment Manager.
http://myhostname/webapp/wcs/stores/servlet/OrderProcess?storeId=34 &orderId=556677&policy=200&cardBrand=Visa &cardNumber=41111111111111111&cardExpiryMonth=12&cardExpiryYear=2001
Note: The payMethodId parameter is supported for backward compatibility only. For new Payment Manager Cassettes and new Business-to-Business functions, use the policyId parameter instead (as in Example 2). You can read more about defined payment policies in the online help.
The DoPaymentMPFCmdImpl class supports an additional parameter called tcId, which is used for specifying the ID of the payment terms and conditions to be used for an order. The terms and conditions must be one of the common payment terms and conditions specified in the contracts associated with the ordered items. To assist in selecting a common payment terms and conditions JSP file, use the UsablePaymentTCListDataBean. The tcId parameter is mandatory if any of the contracts used for the OrderItems has a payment terms and conditions associated with it.
Behavior
- The OrderProcess command calls the ProcessOrder task command to do the following:
- If the order is not locked (indicating that the order has not changed since it was prepared by the OrderPrepare command), or if the order status is not 'P', 'I', 'E', 'W', 'N', or 'B', an ECApplicationException exception is thrown.
- When the value of the QUOTEGOODFOR column in the STORE table is not NULL, the parameters quoteExpiryPolicy and quoteExpiredURL are specified, and the order has status 'P', 'I', 'W', or 'N', the command checks the last update time stamp of the order. If the current time is greater than or equal to the last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column, OrderProcess calls PrepareOrder task command to refresh the order amounts and then does one of the following, based on the value of the quoteExpiryPolicy:
- If the re-calculated order total is unchanged, and the quoteExpiryPolicy parameter does not disallow it, proceed as normal.
- If the re-calculated order total is less, and the quoteExpiryPolicy parameter does not disallow it, proceed as normal.
- If the re-calculated order total is more, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- Otherwise, do not process the order, but instead re-direct to the URL specified by the quoteExpiredURL parameter.
- If ATP inventory allocation is enabled then:
- Any orderitems that are not yet allocated or backordered, or that have changed since they were last allocated or backordered, are allocated, or backordered if they cannot be allocated, by calling the AllocateInventory task command.
- If any order items cannot be allocated or backordered:
- If the noInventoryURL parameter is specified, the command returns a redirection to that URL.
- Otherwise, the order status is changed to L and the command returns.
- If the availabilityChangeURL parameter is specified, and the estimated availability times for any of the order items moved further into the future than specified by the maxAvailabilityChange parameter when they were allocated or backordered, the command returns a redirection to that URL.
- If the AllocateInventory task command unlocked the Order, indicating that the fulfillment center for an order item changed, then:
- Shipping charges and tax amounts are re-calculated, and the order is locked, by calling the ReprepareOrder task command. If this changes the total amount for the order, and the quoteExpiryPolicy and quoteExpiredUrl parameters are specified, then:
- If the re-calculated order total is unchanged, and the quoteExpiryPolicy parameter does not disallow it, proceed as normal.
- If the re-calculated order total is less, and the quoteExpiryPolicy parameter does not disallow it, proceed as normal.
- If the re-calculated order total is more, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- Otherwise, do not process the order, but instead re-direct to the URL specified by the quoteExpiredURL parameter.
- Shipping charges and tax amounts are re-calculated, and the order is locked, by calling the ReprepareOrder task command. If this changes the total amount for the order, and the quoteExpiryPolicy and quoteExpiredUrl parameters are specified, then:
- The order item promised availability times are set to their current estimated availability times.
- If the order status is 'I', the CheckOrder task command is called to verify that this order has not already been submitted for processing.
- The CheckOrderAcceptance task command is called to verify that the order item contracts are active.
- The ORDOPTIONS table is updated to reflect the values of the notifyMerchant and notifyCustomer parameters.
- The billing address, if any, as specified by the tcId or billToAddressId parameters, is stored in the order.
- The field1, field2, and field3 parameter values, if specified, are stored in the order (refer to the ORDERS table).
- If ATP inventory allocation is not enabled, and if the implementation of the DoPayment task command interface does not also implement the DoInventory interface, the UpdateInventory task command is called to decrement the inventory for the ordered items. (The DoInventory interface declares no methods. A DoPayment task command that implements this interface declares to the world that the command implementation or its related functions and commands will handle updating of the inventory.)
- The appropriate DoPayment task command is called to perform additional error checking and process the payment, passing the payment information name-value pairs from the ORDPAYINFO table, merged with the parameters passed to the OrderProcess URL. If any of the parameters passed to the OrderProcess URL have the same name as any of the name-value pairs from the ORDPAYINFO table, the former values replace the latter ones. The merged list of name-value pairs is stored in the ORDPAYINFO table, replacing the previous payment information. However, parameters specifically known to the OrderProcess URL (the ones documented above, on this page), with the exception of the tcId parameter, are not considered payment information and are not stored in the ORDPAYINFO table.
- If the DoPayment task command returns an order status value, the order status is set to that value. Otherwise, the status is set to 'C', or, if ATP inventory allocation is enabled and the order contains any backordered items, the status is set to 'B'.
- If the order status is not 'I', the ExtOrderProcess task command is called. (The PaySynchronizePM scheduler command will call the ExtOrderProcess task command later, when it changes the order status from 'I' to something else.)
- Release the order to fulfillment by calling the ReleaseOrderToFulfillment task command.
- The OrderMessaging task command is called.
- If the notifyOrderSubmitted parameter specifies 1 (Yes), the OrderNotify task command is called to notify the customer that the order was submitted.
- If the DoPayment task command returned byte data, it is passed to the DirectView view, to be passed directly to the customer's browser (for example, to launch an electronic payment "wallet" application). Otherwise, the RedirectView view is passed the OrderOKView redirection URL to display an order acknowledgement to the customer.
Exception conditions
- If the order is not locked, the command throws the ECApplicationException exception specifying the OrderUnlockErrorView error view command.
- If the customer typed incorrect data, the command throws the ECApplicationException exception specifying the BadOrderDataErrorView error view command to notify the customer.
- If the order is not pending, the command throws the ECApplicationException exception specifying the OrderNoneErrorView error view command.
- If any of the contracts used by the order is not valid, the command throws the ECApplicationException.
Related concepts
Related reference