Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vasilvestre opened this issue Dec 7, 2023 · 0 comments
Open

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

vasilvestre opened this issue Dec 7, 2023 · 0 comments
Labels
Bug Confirmed bugs or bugfixes.

Comments

@vasilvestre
Copy link

vasilvestre commented Dec 7, 2023

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").

@vasilvestre vasilvestre added the Bug Confirmed bugs or bugfixes. label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bugs or bugfixes.
Projects
None yet
Development

No branches or pull requests

1 participant