How to add another type of refund? ================================== .. note:: This cookbook describes customization of a feature available only with `Sylius/RefundPlugin `_ installed. Why would you add type of refund? --------------------------------- Refund Plugin provides a generic solution for refunding orders, it is enough for a basic refund but many shops need more custom functionalities. For example, one may need to add loyalty points as a different refund type than order item unit and shipment. How to implement a new type of refund? -------------------------------------- In the current implementation, there are 2 basic types that are defined in RefundPlugin: * order item unit * shipment If you would like to add another one, e.g. ``loyalty``, which might be used then to refund the loyalty points. You need to first add it to the RefundType enum. **1. Add the new type to the RefundType and RefundTypeInterface:** Extended RefundTypeInterface should look like this: .. code-block:: php ` and add in handler your custom logic for refunding e.g. loyalty points.