- The
Sylius\RefundPlugin\Listener\ShipmentRefundedEventListener
has been removed in favor ofSylius\RefundPlugin\Listener\UnitRefundedEventListener
and theUnitRefundedEventListener
listens now to all events implementingSylius\RefundPlugin\Event\UnitRefundedInterface
.
All changes below are backward compatible, but we recommend upgrading to 1.4 as in the next major version we remove deprecated code:
-
The constructor of the
Sylius\RefundPlugin\Command\GenerateCreditMemo
command has been changed:public function __construct( private string $orderNumber, private int $total, - /** @var array|OrderItemUnitRefund[] */ + /** @var array|UnitRefundInterface[] */ private array $units, - /** @var array|ShipmentRefund[] */ - private array $shipments, private string $comment, ) { // ... }
and
Sylius\RefundPlugin\Command\GenerateCreditMemo::shipments
method has been removed. -
The constructor of the
Sylius\RefundPlugin\Command\RefundUnits
command has been changed:public function __construct( private string $orderNumber, - /** @var array|OrderItemUnitRefund[] */ + /** @var array|UnitRefundInterface[] */ private array $units, - /** @var array|ShipmentRefund[] */ - private array $shipments, + private int $paymentMethodId, private string $comment, ) { // ... }
and
Sylius\RefundPlugin\Command\RefundUnits::shipments
method has been removed. -
The constructor of the
Sylius\RefundPlugin\CommandHandler\RefundUnitsHandler
has been changed:public function __construct( - private RefunderInterface $orderUnitsRefunder, - private RefunderInterface $orderShipmentsRefunder, + private iterable $refunders, private MessageBusInterface $eventBus, private OrderRepositoryInterface $orderRepository, private RefundUnitsCommandValidatorInterface $refundUnitsCommandValidator, ) { // ... }
-
The
Sylius\RefundPlugin\Converter\LineItemsConverterInterface
interface implemented bySylius\RefundPlugin\Converter\OrderItemUnitLineItemsConverter
andSylius\RefundPlugin\Converter\ShipmentLineItemsConverter
has been replaced withSylius\RefundPlugin\Converter\LineItemsConverterUnitRefundAwareInterface
. -
The interface method
Sylius\RefundPlugin\Converter\RefundUnitsConverterInterface::convert
has been changed:- public function convert(array $units, RefundTypeInterface $refundType, string $unitRefundClass): array; + public function convert(array $units, string $unitRefundClass): array;
-
The constructor of the
Sylius\RefundPlugin\Creator\RefundUnitsCommandCreator
has been changed:- public function __construct(private RefundUnitsConverterInterface $refundUnitsConverter) + public function __construct(private RequestToRefundUnitsConverterInterface $requestToRefundUnitsConverter) { // ... }
-
The
Sylius\RefundPlugin\Creator\RefundUnitsCommandCreatorInterface
interface has been replaced withSylius\RefundPlugin\Converter\RequestCommandCreatorInterface
. -
The constructor of the
Sylius\RefundPlugin\Event\UnitsRefunded
event has been changed:public function __construct( private string $orderNumber, + /** @var array|UnitRefundInterface[] */ private array $units, - private array $shipments, private int $paymentMethodId, private int $amount, private string $currencyCode, private string $comment, ) { // ... }
and
Sylius\RefundPlugin\Event\UnitsRefunded::shipments
method has been removed. -
The constructor of the
Sylius\RefundPlugin\Generator\CreditMemoGenerator
has been changed:public function __construct( private LineItemsConverterInterface $lineItemsConverter, - private LineItemsConverterInterface $shipmentLineItemsConverter, private TaxItemsGeneratorInterface $taxItemsGenerator, private CreditMemoFactoryInterface $creditMemoFactory, private CustomerBillingDataFactoryInterface $customerBillingDataFactory, private ShopBillingDataFactoryInterface $shopBillingDataFactory, ) { // ... }
-
The interface method
Sylius\RefundPlugin\Generator\CreditMemoGeneratorInterface::generate
has been changed:public function generate( OrderInterface $order, int $total, array $units, - array $shipments, string $comment ): CreditMemoInterface;
-
A static method has been added to the
Sylius\RefundPlugin\Model\UnitRefundInterface
interface:+ public static function type(): RefundType;
-
The constructor of the
Sylius\RefundPlugin\Provider\RemainingTotalProvider
has been changed:public function __construct( - private RepositoryInterface $orderItemUnitRepository, - private RepositoryInterface $adjustmentRepository, + private ServiceProviderInterface $refundUnitTotalProvider, private RepositoryInterface $refundRepository, ) { // ... }
-
The constructor of the
Sylius\RefundPlugin\Refunder\OrderItemUnitsRefunder
has been changed:public function __construct( private RefundCreatorInterface $refundCreator, private MessageBusInterface $eventBus, + private UnitRefundFilterInterface $unitRefundFilter, ) { // ... }
-
The constructor of the
Sylius\RefundPlugin\Refunder\OrderShipmentsRefunder
has been changed:public function __construct( private RefundCreatorInterface $refundCreator, private MessageBusInterface $eventBus, + private UnitRefundFilterInterface $unitRefundFilter, ) { // ... }
-
The interface method
Sylius\RefundPlugin\Validator\RefundAmountValidatorInterface::validateUnits
has been changed:- public function validateUnits(array $unitRefunds, RefundTypeInterface $refundType): void; + public function validateUnits(array $unitRefunds): void;
-
The constructor of the
Sylius\RefundPlugin\Validator\RefundUnitsCommandValidator
has been changed:public function __construct( private OrderRefundingAvailabilityCheckerInterface $orderRefundingAvailabilityChecker, private RefundAmountValidatorInterface $refundAmountValidator, + private iterator $refundUnitsBelongingToOrderValidators, ) { // ... }
-
A static method has been added to the
Sylius\RefundPlugin\Provider\RefundUnitTotalProviderInterface
interface:+ public static function refundType(): string;
and it replaces the
refund_type
attribute for thesylius_refund.refund_unit_total_provider
tag. Therefore, therefund_type
attribute becomes deprecated as well. -
The interface method
Sylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface::findForChannel
has been replaced withSylius\RefundPlugin\Provider\RefundPaymentMethodsProviderInterface::findForOrder
:- public function findForChannel(ChannelInterface $channel): array; + public function findForOrder(OrderInterface $order): array;