This plugin provides basic refunds functionality for Sylius application.
📖 Full documentation is available here: 👉 Refund Plugin Documentation
If you need to add custom refund types (e.g., fees, commissions), you can extend the RefundType class:
- Create your custom RefundType class:
<?phpdeclare(strict_types=1);
namespaceApp\Model;
useSylius\RefundPlugin\Model\RefundTypeasBaseRefundType;
useSylius\RefundPlugin\Model\RefundTypeInterface;
class RefundType extends BaseRefundType implements RefundTypeInterface
{
publicconstORDER_FEES = 'commission';
publicstaticfunctioncommission(): self
{
returnnewself(self::ORDER_FEES);
}
}- Create your custom Doctrine RefundEnumType:
<?phpdeclare(strict_types=1);
namespaceApp\Doctrine\Type;
useApp\Model\RefundType;
useSylius\RefundPlugin\Entity\Type\RefundEnumTypeasBaseRefundEnumType;
useSylius\RefundPlugin\Model\RefundTypeInterface;
class RefundEnumType extends BaseRefundEnumType
{
protectedfunctioncreateType(string$value): RefundTypeInterface
{
returnnewRefundType($value);
}
}- Configure your application to use the custom classes:
# config/packages/sylius_refund.yamlimports:
- { resource: "@SyliusRefundPlugin/config/parameters.php" }parameters:
sylius_refund.refund_type: App\Model\RefundTypesylius_refund.refund_enum_type: App\Doctrine\Type\RefundEnumType- Clear the cache:
php bin/console cache:clearNow you can use your custom refund type in templates and business logic.
If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
Instead, all security issues must be sent to security@sylius.com.
For online communication, we invite you to chat with us and other users on Sylius Slack.
This plugin includes telemetry that collects anonymous usage data. For more information, see TELEMETRY_POLICY.md.
This plugin is released under the MIT License.

