Sylius / Sylius/RefundPlugin

[Bug] Document how to properly extend possible refunds

Open
#417 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
PHP
Stars
73
Forks
76
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the custom RefundType implementation, the base RefundType enum, and the overridden orderRefunds.html.twig mentioned in the report. Document the supported extension steps for adding a refund type such as commission, including how to prevent the enum rendering error; done means a user can follow the guidance without relying on an undocumented template override.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.