You can add support for new refund methods by performing the following steps:
Extend the
atg.commerce.csr.returns.RefundMethod
class, 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
getMaximumRefundAmount
method. This method is used in therefundType
page. 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
refundMethod
repository item descriptor, which is defined in the/atg/commerce/custsvc/CsrRepository.xml
file, to save custom refund method information in your database.Extend the
ReturnManager.buildRefundMethodList
method, which builds the list ofRefundMethod
objects from the original order’s payment groups.This list is stored in the
returnRequest.getRefundMethodList
. It generates aRefundMethod
for 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 customRefundMethod
objects but ensure that you do not allocate money acrossRefundMethods
.Extend the
ReturnTools.createRefundMethodItem
method, which creates a refund method item for each refund method listed within thereturnRequest.getRefundMethodList
method.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.issueAlternateCreditType
method, which performs the crediting against therefundMethod
for all refund types that are not recognized by theissueCredits
method.You extend the
ReturnManager.issueLaternateCreditType
method to credit the custom refund type. TheissueCredits
method handles credit card and store credit refund methods.Extend the
ReturnTools.getRefundMethod
method, which generates aReturnMethod
object from therefundmethod
repository item when the return request is reloaded.You extend this method to generate a custom
RefundMethod
object 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
refundType
page displays the refund methods from thereturnRequest.getRefundMethodList
method.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
displayRefundMethodPageFragment
property 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 ATG Page Developer's Guide.