Order processing occurs when a customer has supplied all the necessary information for the Order and has submitted it for checkout. The processing of an Order begins with a call to OrderManager.processOrder(), which calls into the PipelineManager to execute the processOrder pipeline. The processOrder pipeline first validates the Order and then processes it. Note that, by default, Oracle ATG Web Commerce does not process an incomplete Order. To allow the processing of incomplete Orders, you must modify the pipeline accordingly.

The PipelineManager Nucleus component for Commerce is located at /atg/commerce/PipelineManager. The related XML configuration file is defined in <ATG10dir>/DCS/config/atg/commerce/commercepipeline.xml.

Note: You can use the credit card information listed below to process payments during testing of the order checkout process. The expiration date for all cards can be any date in the future.

The following table describes the processors in the processOrder pipeline. They are listed in order of execution.

PipelineLink name

Description

executeValidateForCheckoutChain

Executes the validateForCheckout pipeline (Refer to the next table in this section.) The atg.commerce.order.processor.ProcExecuteChain class implements this functionality. Its properties file defines the execution chain to run in the chainToRun property. By default, this property is set to validateForCheckout.

If any errors occur during the execution of this processor, execution of the processOrder pipeline stops.

executeApproveOrderChain

Executes the approveOrder pipeline, which begins the approval process. The atg.commerce.order.processor.ProcExecuteChain class implements this functionality.

See the Managing the Order Approval Process chapter for more information.

stopChainIfOrderRequiresApproval

Checks the state of the Order. If the Order requires approval and has not been approved yet, execution of the processOrder pipeline stops. If the Order required approval and has been approved, the processOrder pipeline continues with executeValidatePostApprovalChain. If the Order did not require approval, the pipeline continues with executeValidateNoApprovalChain.

The atg.commerce.order.processor.ProcDispatchOnOrderState class implements this functionality. See the Managing the Order Approval Process chapter for more information.

executeValidatePostApprovalChain

For Orders that have been approved. This processor executes the validatePostApproval pipeline, which revalidates information the approver may have changed. Specifically, the pipeline revalidates payment information (all payment groups and cost centers) and checks that all Order and shipping costs are accounted for.

The atg.commerce.order.processor.ProcExecuteChain class implements this functionality. See the Managing the Order Approval Process chapter for more information.

executeValidateNoApprovalChain

For Orders that didn’t require approval. This processor executes the validateNoApproval pipeline, which validates information intentionally skipped by the executeValidateForCheckout pipeline processor. Specifically, by default the pipeline validates InvoiceRequests, which are intentionally skipped by the validateForCheckout pipeline until it is determined that the Order requires approval.

The atg.commerce.order.processor.ProcExecuteChain class implements this functionality. See the Managing the Order Approval Process chapter for more information.

checkForExpiredPromotions

Checks that expired promotions are not used in Order that is being checked out. The atg.commerce.order.processor.ProcCheckForExpiredPromotions class implements this functionality.

removeEmptyShippingGroups

Removes any empty (unused) shipping groups from the Order. An empty ShippingGroup is one without any CommerceItemRelationships. The atg.commerce.order.processor.ProcRemoveEmptyShippingGroups class implements this functionality.

removeEmptyPaymentGroups

Removes any empty (unused) payment groups from the Order. An empty PaymentGroup is one without any CommerceItemRelationships, ShippingGroupRelationships, and OrderRelationships. The atg.commerce.order.processor.ProcRemoveEmptyPaymentGroups class implements this functionality.

createImplicitRelationships

Validates the special case of an Order having one ShippingGroup and/or one PaymentGroup and no Relationships. In this situation, the processor actually creates relationships between all the CommerceItems and the ShippingGroup. It also creates a relationship between the PaymentGroup and the Order. The atg.commerce.order.processor.ProcCreateImplicitRelationships class implements this functionality.

setPaymentGroupAmount

Determines and sets the amount to charge in each PaymentGroup based on the Relationships in the Order. The atg.commerce.order.processor.ProcSetPaymentGroupAmount class implements this functionality.

setCostCenterAmount

Determines and sets the amount to assign to each cost center in the Order. The atg..order.processor.ProcSetCostCenterAmount class implements this functionality.

See the Implementing Cost Centers chapter of the ATG Commerce Guide to Setting Up a Store for more information.

moveUsedPromotions

Moves all promotions that a customer used in the Order to the usedPromotions list in the customer’s profile. If the promotion is a single-use promotion, it is also removed from the activePromotions list and added to the customer’s inactivePromotions list. The atg.commerce.order.processor.ProcMoveUsedPromotions class implements this functionality.

authorizePayment

Authorizes all PaymentGroups (CreditCard, or GiftCertificate, or StoreCredit) in the Order. The atg.commerce.order.processor.ProcAuthorizePayment class implements this functionality.

Note: For information on how to prevent the authorization of a user’s credit card under certain circumstances, such as when the items in the Order don’t exist in inventory, see Preventing Payment Authorization for Unfulfilled Orders later in this section.

updateGiftRepository

Updates the Gift List Repository to reflect the purchase of any gifts in the order. The atg.commerce.order.processor.ProcUpdateGiftRepository class implements this functionality

sendGiftPurchasedMessage

Sends a message to the messaging system that describes the gifts that were purchased. The message can then be used to execute scenarios. The atg.commerce.order.processor.ProcSendGiftPurchasedMessage class implements this functionality.

addOrderToRepository

This processor first calls OrderManager.updateOrder() to save the Order to the Order Repository. (See Updating an Order with the OrderManager.) The atg.commerce.order.processor.ProcAddOrderToRepository class implements this functionality.

sendPromotionUsedMessage

Sends a message to the messaging system that describes the promotions that were used in the Order. The message can then be used to execute scenarios. The atg.commerce.order.processor.ProcSendPromotionUsedMessage class implements this functionality.

sendFulfillmentMessage

Sends a message that includes the Order to the fulfillment system. This message indicates to the fulfillment system that it can fulfill the Order. The atg.commerce.order.processor.ProcSendFulfillmentMessage class implements this functionality.

The first processor in the processOrder pipeline, named executeValidateForCheckoutChain, in turn executes the validateForCheckout pipeline. The following table describes the processors in the validateForCheckout pipeline. They are listed in order of execution.

PipelineLink name

Description

ValidateOrderForCheckout

Verifies that the Order contains at least one CommerceItem, ShippingGroup, and PaymentGroup. The atg.commerce.order.processor.ProcValidateOrderForCheckout class implements this functionality.

VerifyOrderAddresses

Verifies the addresses for shipping groups and payment groups. The atg.commerce.order.processor.ProcVerifyOrderAddresses class implements this functionality.

validateShippingGroupsForCheckout

Verifies that all CommerceItems in the Order are assigned to a ShippingGroup. The processor also verifies that all required fields have been supplied to all ShippingGroups in the Order. The atg.commerce.order.processor.ProcValidateShippingGroupsForCheckout class that implements this functionality is.

creditCardModCheck

Verifies that the credit card number and expiration date are valid. The credit card is not authorized by a processing system at this point. (See the previous table, which describes the processors in the processOrder pipeline.) Rather, the processor applies a simple algorithm to the credit card number to determine if it is valid. It then checks the date to determine if the card has expired. The atg.commerce.order.processor.ProcCreditCardModCheck class implements this functionality.

validatePaymentGroupsForCheckout

Verifies that all CommerceItems in the Order can account for their costs, which means that the processor verifies all PaymentGroupCommerceItemRelationships. It also verifies that all required fields have been supplied to all PaymentGroups in the Order. The atg.commerce.order.processor.ProcValidatePaymentGroupsForCheckout class implements this functionality.

validateShippingCostsForCheckout

Verifies that all ShippingGroups can account for their costs, which means that the processor verifies all PaymentGroupShippingGroupRelationships. The atg.commerce.order.processor.ProcValidateShippingCostsForCheckout class implements this functionality.

validateOrderCostsForCheckout

Verifies the Order can account for its cost, which means the processor verifies all PaymentGroupOrderRelationships. The atg.commerce.order.processor.ProcValidateOrderCostsForCheckout class implements this functionality.

validateHandlingInstructionsForCheckout

Verifies that all HandlingInstructions are assigned to a valid ShippingGroup and CommerceItem combination. The atg.commerce.order.processor.ProcValidateHandlingInstructionsForCheckout class implements this functionality.

validateCurrencyCodes

Validates that all the currency codes in the PriceInfo objects are the same. Also validates that all the items, shipping, tax, and order have been priced. The atg.commerce.order.processor.ProcValidateCurrencyCodes class implements this functionality.

For more information about pipelines, the PipelineManager, and the transactional modes and transitions of the processors in the processOrder and validateForCheckout pipelines, see Appendix F, Pipeline Chains.

Preventing Payment Authorization for Unfulfilled Orders

The processOrder pipeline performs several checkout functions, including authorizing a user’s credit card for the amount of the order. Under certain circumstances, you may want to prevent the authorization of a credit card, for example, when the order contains items that do not exist in inventory. In this example, the user could be alerted of the lack of inventory and allowed to modify the order before checkout.

You can modify the processOrder pipeline to prevent credit card authorization under certain conditions. To do so, you need to modify the pipeline to include a branch. One processor in the pipeline should check that the items being purchased do exist in inventory. If they do, then the Order should continue through the pipeline for checkout (and authorization of the user’s credit card). If the items do not exist in inventory, then the Order should branch to an alternate pipeline that does not authorize the user’s credit card. Instead, the pipeline might redirect the user to a page that indicates which items could not be allocated from inventory and allows the user to change the Order. The important concept is that the processOrder pipeline branches so that the user’s credit card is not authorized.

As previously mentioned, the PipelineManager Nucleus component for Oracle ATG Web Commerce is located at /atg/commerce/PipelineManager. In Commerce, the related XML configuration file is defined in <ATG10dir>/DCS/config/atg/commerce/commercepipeline.xml.

For information on how to set up a branching pipeline, see the Processor Chains and the Pipeline Manager chapter.