Skip to content

[Bug] Document how to properly extend possible refunds #417

@vasilvestre

Description

@vasilvestre

SyliusRefundPlugin version affected: na

Description
I use another type of adjustment as "fees", I need to be able to refund it. So far I'm overriding the orderRefunds.html.twig file and add refund type to the Enum but it's not smooth or documentated.

My type is not found in my own refundType implementation

<?php

declare(strict_types=1);

namespace App\Refund\SyliusRefundPlugin\Model;

use Sylius\RefundPlugin\Model\RefundType as BaseRefundType;
use Sylius\RefundPlugin\Model\RefundTypeInterface;

class RefundType extends BaseRefundType implements RefundTypeInterface
{
    public const ORDER_FEES = 'commission';

    public static function commission(): self
    {
        return new self(self::ORDER_FEES);
    }
}

An exception has been thrown during the rendering of a template ("Value 'commission' is not part of the enum Sylius\RefundPlugin\Model\RefundType").

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConfirmed bugs or bugfixes.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions