orderNumber
field onSylius\RefundPlugin\Entity\Refund
has been removed and replaced with relation toOrder
entity.Sylius\RefundPlugin\Entity\RefundInterface::getOrderNumber
function is left due to easier and smoother upgrades, but is also deprecated and will be removed in thev1.0.0
release. UseSylius\RefundPlugin\Entity\RefundInterface::getOrder
instead.Sylius\RefundPlugin\Creator\RefundCreator
takes\Sylius\Component\Core\Repository\OrderRepositoryInterface
as the 3rd argument.Sylius\RefundPlugin\Provider\OrderRefundedTotalProviderInterface::invoke
takesOrderInterface $order
as an argument instead ofstring $orderNumber
-
Support for Sylius 1.8 has been dropped, upgrade your application to Sylius 1.9 or Sylius 1.10.
-
Remove usage of:
Sylius\RefundPlugin\Entity\AdjustmentInterface
Sylius\RefundPlugin\Entity\AdjustmentTrait
Sylius\RefundPlugin\Entity\ShipmentInterface
Sylius\RefundPlugin\Entity\ShipmentTrait
-
Delete removed migrations from the migrations table by running:
bin/console doctrine:migrations:version Sylius\\RefundPlugin\\Migrations\\Version20201208105207 --delete bin/console doctrine:migrations:version Sylius\\RefundPlugin\\Migrations\\Version20201130071338 --delete bin/console doctrine:migrations:version Sylius\\RefundPlugin\\Migrations\\Version20201204071301 --delete
-
Command bus
sylius_refund_plugin.command_bus
has been replaced withsylius.command_bus
. -
Event bus
sylius_refund_plugin.event_bus
has been replaced withsylius.event_bus
. -
Sylius\RefundPlugin\Grid\Filter\ChannelFilter
andSylius\RefundPlugin\Form\Type\ChannelFilterType
services have been removed and channel filter configuration in grid has been replaced by entity filter. -
Constructor of
Sylius\RefundPlugin\Entity\CreditMemo
has been removed and nowCreditMemo
entity is created bySylius\RefundPlugin\Factory\CreditMemoFactory
. -
The constructor of
Sylius\RefundPlugin\Generator\CreditMemoGenerator
has been changed:public function __construct( LineItemsConverterInterface $lineItemsConverter, LineItemsConverterInterface $shipmentLineItemsConverter, TaxItemsGeneratorInterface $taxItemsGenerator, - NumberGenerator $creditMemoNumberGenerator, - CurrentDateTimeImmutableProviderInterface $currentDateTimeImmutableProvider, - CreditMemoIdentifierGeneratorInterface $uuidCreditMemoIdentifierGenerator + CreditMemoFactoryInterface $creditMemoFactory ) { ... }
-
Post-units refunded process (containing credit memo and refund payment generation) was changed to synchronous step. Refund payment is therefore always generated after credit memo. Technical changes:
Sylius\RefundPlugin\ProcessManager\CreditMemoProcessManager
andSylius\RefundPlugin\ProcessManager\RefundPaymentProcessManager
no longer directly listen toSylius\RefundPlugin\Event\UnitsRefunded
event.Sylius\RefundPlugin\ProcessManager\UnitsRefundedProcessManager
uses them to facilitate post-units refunding process.- Their
__invoke
methods were replaced bySylius\RefundPlugin\ProcessManager\UnitsRefundedProcessStepInterface::next(UnitsRefunded $unitsRefunded)
.
-
Sylius\RefundPlugin\Generator\NumberGenerator
has been changed toSylius\RefundPlugin\Generator\CreditMemoNumberGeneratorInterface
and its method has been changed frompublic function generate(): string
topublic function generate(OrderInterface $order, \DateTimeInterface $issuedAt): string
. -
Service name and definition has been changed from
Sylius\RefundPlugin\Generator\SequentialNumberGenerator
toSylius\RefundPlugin\Generator\SequentialCreditMemoNumberGenerator
and its last argumentCurrentDateTimeImmutableProviderInterface $currentDateTimeImmutableProvider
has been removed from constructor.
-
The
fully_refunded
state and therefund
transition have been removed fromsylius_order
state machine. -
Sylius\RefundPlugin\Provider\LabelBasedTaxRateProvider
has been changed toSylius\RefundPlugin\Provider\TaxRateProvider
. -
The method
Sylius\RefundPlugin\Provider\TaxRateProviderInterface
has been changed fromprovide(OrderItemUnitInterface $orderItemUnit): ?string
toprovide(AdjustableInterface $adjustable): ?string
. -
The
TaxRateProviderInterface $taxRateProvider
has been added as the second argument in constructor ofSylius\RefundPlugin\Converter\ShipmentLineItemsConverter
-
Service definition for
Sylius\RefundPlugin\Converter\ShipmentLineItemsConverter
has been changed fromSylius\RefundPlugin\Converter\ShipmentLineItemsConverterInterface
toSylius\RefundPlugin\Converter\ShipmentLineItemsConverter
-
Sylius\RefundPlugin\Converter\LineItemsConverter
has been changed toSylius\RefundPlugin\Converter\OrderItemUnitLineItemsConverter
and its service definition has been changed fromSylius\RefundPlugin\Converter\LineItemsConverterInterface
toSylius\RefundPlugin\Converter\OrderItemUnitLineItemsConverter
-
The suffix
Exception
has been removed from classes:Sylius\RefundPlugin\Exception\InvalidRefundAmountException
Sylius\RefundPlugin\Exception\OrderNotAvailableForRefundingException
Sylius\RefundPlugin\Exception\UnitAlreadyRefundedException
- The
Version20201208105207.php
migration was added which extends existing adjustments with additional details (context). Depending on the type of adjustment, additionally defined information are:
- Taxation details (percentage and relation to tax rate)
- Shipping details (shipping relation)
- Taxation for shipping (combined details of percentage and shipping relation)
This data is fetched based on two assumptions:
- Order level taxes relates to shipping only (default Sylius behaviour)
- Tax rate name has not change since the time, the first order has been placed
If these are not true, please adjust migration accordingly to your need. To exclude following migration from execution run following code:
bin/console doctrine:migrations:version 'Sylius\RefundPlugin\Migrations\Version20201208105207' --add
- Add traits that enhance Adjustment and Shipment models from Sylius. These traits are not covered by the backward compatibility promise and it will be removed after update Sylius to 1.9. It is a duplication of a logic from Sylius to provide proper adjustments handling.
<?php
declare(strict_types=1);
namespace Tests\Sylius\RefundPlugin\Application\Entity;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Order\Model\Adjustment as BaseAdjustment;
use Sylius\RefundPlugin\Entity\AdjustmentInterface;
use Sylius\RefundPlugin\Entity\AdjustmentTrait;
/**
* @ORM\Entity()
* @ORM\Table(name="sylius_adjustment")
*/
class Adjustment extends BaseAdjustment implements AdjustmentInterface
{
use AdjustmentTrait;
}
<?php
declare(strict_types=1);
namespace Tests\Sylius\RefundPlugin\Application\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Core\Model\Shipment as BaseShipment;
use Sylius\RefundPlugin\Entity\ShipmentInterface;
use Sylius\RefundPlugin\Entity\ShipmentTrait;
/**
* @ORM\Entity()
* @ORM\Table(name="sylius_shipment")
*/
class Shipment extends BaseShipment implements ShipmentInterface
{
use ShipmentTrait;
public function __construct()
{
parent::__construct();
/** @var ArrayCollection<array-key, BaseAdjustmentInterface> $this->adjustments */
$this->adjustments = new ArrayCollection();
}
}
-
Upgrade your application to Sylius 1.8.
-
Remove previously copied migration files (You may check names of migrations to remove here).
-
Sylius\RefundPlugin\Entity\RefundPaymentInterface
state constants values were changed to lowercase. Backward compatibility provided by migration. -
Adjust new templates from the plugin (ref. PR #198)
⚠️ Check in your git repository, what has changed and only adjust templates where neededcp -R vendor/sylius/refund-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
-
Copy new migrations
cp -R vendor/sylius/refund-plugin/migrations/{Version20200306145439.php,Version20200306153205.php,Version20200310094633.php,Version20200310185620.php} src/Migrations
-
Change usage of
Sylius\RefundPlugin\Entity\SequenceInterface
toSylius\RefundPlugin\Entity\CreditMemoSequenceInterface
-
Change usage of
Sylius\RefundPlugin\Provider\CurrentDateTimeProviderInterface
toSylius\RefundPlugin\Provider\CurrentDateTimeImmutableProviderInterface
-
Sylius\RefundPlugin\Entity\CreditMemoUnit
was changed toSylius\RefundPlugin\Entity\LineItem
which is a resource entity now. -
Sylius\RefundPlugin\Generator\CreditMemoUnitGeneratorInterface
was changed toSylius\RefundPlugin\Converter\LineItemsConverterInterface
. -
Sylius\RefundPlugin\Generator\OrderItemUnitCreditMemoUnitGenerator
was changed toSylius\RefundPlugin\Converter\LineItemsConverter
. -
Sylius\RefundPlugin\Generator\ShipmentCreditMemoUnitGenerator
was changed toSylius\RefundPlugin\Converter\ShipmentLineItemsConverter
. -
Sylius\RefundPlugin\Entity\TaxItem
became a resource entity.
There are no migrations that provide backward compatibility, save current credit memos before upgrading the version of plugin.
OfflineRefundPaymentMethodsProvider
renamed toSupportedRefundPaymentMethodsProvider
with the supported gateways array as the 2nd argument (by default onlyoffline
gateway is passed and therefore supported).
-
Removed
CreditMemoChannel
and replaced bySylius\Component\Core\Model\ChannelInterface
. -
Replaced
CustomerBillingData
andShopBillingData
value objects by entities withCustomerBillingDataInterface
andShopBillingDataInterface
interfaces.