Pipelines perform the majority of the returns and exchange process and are defined in atg/commerce/commercepipeline.xml
and stored in/atg/commerce/csr/returns/
.
contains the pipeline parameter constants that call into the pipeline chains and pass parameters. Pipeline IDs are configured using the
ReturnsPipelineConstantsReturnManager
.
Create Return Request Pipeline
The createReturnRequest
pipeline chain initializes a new ReturnRequest
. It includes the following processors:
Confirm Return Request Pipeline
This chain completes the return creation process. It includes the following processors:
Processor | Description |
---|---|
| Validates the refund total. To perform a return, the refund must be greater than 0. |
| Removes refund methods that have no refunds allocated. |
| Validates that the current refund is greater than 0 and that the |
| CSC Only. Sets the |
| Updates the state of each |
| Updates the state of the |
| Identifies the |
| Runs a pre-submission process on the replacement order. |
| Conditionally executes the settlement pipeline to settle the return immediately. This occurs if the |
| Saves the |
| Sends a submitted return reporting event. |
Settle Return Pipeline
The settleReturn
pipeline chain settles a return, issues credits and sends the order to fulfillment. It includes the following processors:
Processor | Description |
---|---|
| Credits the payment groups and assigns refund store credits to the owning profile. |
| Starts the pipeline that submits the replacement order to fulfillment. |
| Marks the return as settled, preventing any further settlements. |
| Sends a return completed event for reporting. |
Submit Replacement Order To Fulfillment Pipeline
The submitReplacementOrderToFulfillment
pipeline chain submits the replacement order for processing. It includes the following processor:
Processor | Description |
---|---|
| Submits the replacement order to fulfillment. |
Generate Replacement Order For Exchange Pipeline
The generateReplacementOrderForExchange
pipeline chain is executed to create a replacement order for an exchange. It includes the following processors:
Processor | Description |
---|---|
| Creates a replacement order instance. |
| Sets the origin of the replacement order based on the CSC parameter Map. The In CSC, this value in the |
| Creates the shipping groups in the replacement order based on the shipping groups in the original order. |
| Creates the payment groups in the replacement order based on the payment groups in the original order. |
Prepare Replacement Order Pipeline
This pipeline chain prepares the replacement order for submission and includes the following processors:
Processor | Description |
---|---|
| Executes a Commerce pipeline that validates that the order is ready for checkout. |
| Removes shipping groups without relationships. |
| Removes payment groups without relationships. |
| Creates relationships for orders that have a single shipping or payment group with no relationships. |
| Sets the amount of the payment groups based on the group’s relationships. |
| Authorizes payment groups in the order. |
| Sets the sales channel of the replacement order based on the CSC extra parameter. Identifies where the order was submitted. The |
| Updates the replacement order state to “pending customer return”. |
| Adds the replacement order to the repository. |
Calculate Refund Amounts Pipeline
The calculateRefundAmounts
pipeline chain calculates the suggested and actual refund amounts for a return. It includes the following processors:
Processor | Description |
---|---|
| Resets the suggested and actual refund values in the |
| Generates the |
| Calculates the suggested refund amounts for each |
| Adjusts the |
| Sets the actual refund amounts from the suggested refund amount. |
| Calculates the return fee. |
Apply Selected Items Pipeline
The applySelectedItems
pipeline chain processes the selected ReturnItems
. It includes the following processors:
Processor | Description |
---|---|
| Validates that there are selected return items that contain valid return quantities. |
| Regenerates the |
| Creates the Return Calculation Order based on the selected |
| For an exchange, resets any properties that contain Gift with Purchase meta-data needed to generate gift selection for the replacement order when a gift is returned. |
| Calculates new suggested and actual refund and promotion values. |
| Validates the refund total, which must be greater than 0. |
| Initializes the refund methods and the generated store credits used for the replacement order. |
Apply Refund Allocation Pipeline
The applyRefundAllocation
pipeline chain allocates the refund across the RefundMethods
. It includes the following processors:
Processor | Description |
---|---|
| Validates the refund total, which must be greater than 0. |
| Validates that the current refund for a return is greater than 0 and that the |
| Updates the refund store credit based on the refund method allocation. |
Record Merchandise Return Pipeline
The recordMerchandiseReturn
pipeline chain is run for each ReturnItem
that is received for a return. It includes the following processors:
Processor | Description |
---|---|
| Updates the |
| Conditionally updates the inventory for the quantity received. |
| Updates the state of the |
| Conditionally executes the pipeline to settle the return. |