You can add support for new refund methods by performing the following steps:
Extend the
atg.commerce.csr.returns.RefundMethodclass, which holds your custom refund method information.To create a limit of the refund amount for the custom refund method type, you must extend the
getMaximumRefundAmountmethod. This method is used in therefundTypepage. The maximum refund amount disables a user’s ability to enter a higher refund amount. If you do not implement the method, no refund amount limit is set.Extend the
refundMethodrepository item descriptor, which is defined in the/atg/commerce/custsvc/CsrRepository.xmlfile, to save custom refund method information in your database.Extend the
ReturnManager.buildRefundMethodListmethod, which builds the list ofRefundMethodobjects from the original order’s payment groups.This list is stored in the
returnRequest.getRefundMethodList. It generates aRefundMethodfor each credit card that has any debited amount that has not yet been credited. If there is still a refund left over, the method allocates the remainder to the generated store credit refund method. You must extend this method to add customRefundMethodobjects but ensure that you do not allocate money acrossRefundMethods.Extend the
ReturnTools.createRefundMethodItemmethod, which creates a refund method item for each refund method listed within thereturnRequest.getRefundMethodListmethod.After creating a refund method item, the method copies property values from the refund method to the refund item and then adds the item to the repository. You must extend this method to add the custom refund method to the repository. By default, this method handles the credit card and store credit refund methods.
Extend the
ReturnManager.issueAlternateCreditTypemethod, which performs the crediting against therefundMethodfor all refund types that are not recognized by theissueCreditsmethod.You extend the
ReturnManager.issueLaternateCreditTypemethod to credit the custom refund type. TheissueCreditsmethod handles credit card and store credit refund methods.Extend the
ReturnTools.getRefundMethodmethod, which generates aReturnMethodobject from therefundmethodrepository item when the return request is reloaded.You extend this method to generate a custom
RefundMethodobject whose properties are set from the repository item. By default, this method handles credit card and store credit refund methods.Add a display page fragment for the custom refund method. The
refundTypepage displays the refund methods from thereturnRequest.getRefundMethodListmethod.You must add a display page fragment for the custom refund method. Update the payment group type configuration file by updating the custom payment group
displayRefundMethodPageFragmentproperty value. This property identifies a page fragment that specifies the location of a JSP fragment. The JSP fragment displays your custom refund method type. The display fragment is used in the refund type and the return confirmation pages. For detailed information on working with page fragments, refer to the Page Developer's Guide.

