ReturnRequests represent Shipping Groups as a ReturnShippingGroup and Commerce Items as a ReturnItem. The return refund amount is distributed from RefundMethods

If you extend a repository item object, you may need to extend these return objects, as well as the load and save methods.

You can modify the following methods to load and save return objects in ReturnRequest:

You can modify the following methods to load and save return objects in ReturnItem:

You can modify the following methods to load and save return objects in RefundMethod:

Creating a Return Request Instance

A returnRequest can be based upon the returnRequestClass property values listed in /atg/commerce/custsvc/returns/ReturnTools.properties file. The default for the returnRequestClass property is:

returnRequestClass=atg.commerce.csr.returns.ReturnRequest

Use the atg.commerce.scr.returns.ReturnTools.createReturnRequestInstance(0rder) method to create the instance.

Creating a Return Shipping Group Instance

The atg.commercecsr.returns.ReturnTools.createReturnShippingGroupInstance
(ShippingGroup)
method creates a return shipping group instance based on the returnShippingTypeClassMap property value. If a shipping group type is configured with a ReturnShippingGroup class, a return shipping group instance is created. If not, a default value instance is created. This method calls the ReturnShippingGroup(ShippingGroup) constructor to load return items.

The default configuration for the returnShippingTypeClassMap property is:

/atg/commerce/custsvc/returns/ReturnTools.properties
returnShippingTypeClassMap=\
        default=atg.commerce.csr.returns.ReturnShippingGroup,\
        hardgoodShippingGroup=atg.commerce.csr.returns.ReturnShippingGroup
Creating a Return Item Instance

The atg.commerce.csr.returns.ReturnTools.createReturnItemInstance(CommerceItem) method creates a return item instance based on the returnItemTypeClassMap property value. If a commerce item type is configured with a return item class, a return item instance is created. This method calls the ReturnItem(CommerceItem) constructor and sets the commerce item property.

The default configuration for the returnItemTypeClassMap property is:

/atg/commerce/custsvc/returns/ReturnTools.properties
returnItemTypeClassMap=\
           default=atg.commerce.csr.returns.ReturnItem
Creating a Refund Method Instance

The atg.commerce.csr.returns.ReturnTools.createRefundMethodInstance(String) method creates a refund method instance based on the refundMethodTypeClassMap property value. If the given type is configured with a refund method class, a refund method instance is created. The payment group class type is used to create refund method instances.

The default configuration for refundMethodTypeClassMap property is:

/atg/commerce/custsvc/returns/ReturnTools.properties
refundMethodTypeClassMap=\
           default=atg.commerce.csr.returns.RefundMethod,\
           creditCard=atg.commerce.csr.returns.CreditCardRefundMethod,\
           storeCredit=atg.commerce.csr.returns.StoreCreditRefundMethod
Creating Item Descriptor Mapping

The beanNameToItemDescriptorMap property creates a repository item based on the return-related class. If a class is not configured the item will not be saved in the repository.

The default configuration for the beanNameToItemDescriptorMap property is:

/atg/commerce/custsvc/returns/ReturnTools.properties
beanNameToItemDescriptorMap=\
           atg.commerce.csr.returns.ReturnRequest=returnRequest,\
           atg.commerce.csr.returns.ReturnItem=returnItem,\
           atg.commerce.csr.returns.RefundMethod=refundMethod,\
           atg.commerce.csr.returns.CreditCardRefundMethod=creditCard,\
           atg.commerce.csr.returns.StoreCreditRefundMethod=storeCredit
Extending Amount Distribution Methods

The atg.commerce.csr.returns.ReturnManager.buildRefundMethodList(Order, ReturnRequest,double,double) builds the refund methods from an order and allocates the refund amount. The refund methods are generated using the generateRefundMethodsForReturn
(ReturnRequest)
method.

The total refund amount is distributed as follows:

For example, you can extend the getRefundAmountRemaningRefundMethod to return any of the supported refund method types, if the buildRefundMethodList method receives a zero store credit amount.

Creating a Return Request Immediate Exchange

The ReturnManager.submitReplacementOrder calls into the normal processOrderpipeline change when an exchange replacement order is ready for submission. If the return request’s processImmediately is true, the exchange order is submitted immediately. If the processImmediately flag is set to false, the exchange replacement order is held until the returned goods have been received.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices