-
The
Sylius\Bundle\ApiBundle\DataProvider\CartShippingMethodsSubresourceDataProvider
has been removed and replaced bySylius\Bundle\ApiBundle\DataProvider\ShippingMethodsCollectionDataProvider
. -
The
Sylius\Bundle\ApiBundle\Serializer\ShippingMethodNormalizer
logic and constructor has been changed due to refactor above.public function __construct( private OrderRepositoryInterface $orderRepository, private ShipmentRepositoryInterface $shipmentRepository, private ServiceRegistryInterface $shippingCalculators, + private RequestStack $requestStack, + private ChannelContextInterface $channelContext ) { ... }
-
The
GET
api/v2/shop/orders/{token}/shipments/{id}/methods
andapi/v2/shop/shipments/{id}/methods
endpoints have been removed and changed into collection request with 2 parametersapi/v2/shop/shipping-methods?shipmentId={id}&tokenValue={token}
. Now when we do not provide parameters in response it returns all availableshippingMethods
in channel. Wrong parameters otherwise cause empty array[]
in response and correct parameters returnshippingMethods
available for yourshipment
.
Here is how the response looks like:{ "@context": "/api/v2/contexts/ShippingMethod", "@id": "/api/v2/shop/shipping-methods", "@type": "hydra:Collection", "hydra:member": [ { "@id": "/api/v2/shop/shipping-methods/ups", "@type": "ShippingMethod", "id": 1, "code": "ups", "position": 0, "name": "UPS", "description": "Quasi perferendis debitis officiis ut inventore exercitationem." } ], "hydra:totalItems": 1, "hydra:search": { "@type": "hydra:IriTemplate", "hydra:template": "/api/v2/shop/shipping-methods{?shipmentId,tokenValue}", "hydra:variableRepresentation": "BasicRepresentation", "hydra:mapping": [ { "@type": "IriTemplateMapping", "variable": "shipmentId", "property": null, "required": false }, { "@type": "IriTemplateMapping", "variable": "tokenValue", "property": null, "required": false } ] } }
-
Service
src/Sylius/Bundle/ApiBundle/DataProvider/CartPaymentMethodsSubresourceDataProvider.php
has been removed and logic was replaced bysrc/Sylius/Bundle/ApiBundle/DataProvider/PaymentMethodsCollectionDataProvider.php
-
Endpoints
/shop/orders/{tokenValue}/payments/{payments}/methods
,/shop/payments/{id}/methods
has been removed and replaced by/shop/payment-methods
with filterpaymentId
andtokenValue
/shop/payment-methods
returns all enable payment methods if filters are not set, payment methods related to payment if filters are filled or empty response if filters ale filled with invalid data. -
Service
Sylius\Bundle\ApiBundle\DataProvider/CartPaymentMethodsSubresourceDataProvider
has been removed and logic was replaced bySylius\Bundle\ApiBundle\DataProvider\PaymentMethodsCollectionDataProvider
-
The
GET
api/v2/shop/orders/{tokenValue}/payments/{payments}/methods
andapi/v2/shop/payments/{id}/methods
endpoints have been removed and changed into collection request with 2 parametersapi/v2/shop/payment-methods?paymentId={id}&tokenValue={token}
. Now when we do not provide parameters in response it returns all availablepaymentMethods
in channel. Wrong parameters otherwise cause empty array[]
in response and correct parameters returnpaymentMethods
available for yourpayment
. -
The 2nd parameter
MetadataInterface
has been removed fromsrc/Sylius/Bundle/ApiBundle/CommandHandler/Account/ResetPasswordHandler
and replaced bySylius\Component\User\Security\PasswordUpdaterInterface
(previously 3rd parameter). From now on a token TTL value must be used instead as the 3rd parameter. -
Constructor of
Sylius\Bundle\ApiBundle\CommandHandler\Account\RequestResetPasswordTokenHandler
has been extended withSylius\Calendar\Provider\DateTimeProviderInterface
argument:public function __construct( private UserRepositoryInterface $userRepository, private MessageBusInterface $commandBus, - private GeneratorInterface $generator + private GeneratorInterface $generator, + private DateTimeProviderInterface $calendar ) { }
-
Constructor of
\Sylius\Bundle\ApiBundle\CommandHandler\Account\VerifyCustomerAccountHandler
has been extended withSylius\Calendar\Provider\DateTimeProviderInterface
argument:- public function __construct(private RepositoryInterface $shopUserRepository) - { + public function __construct( + private RepositoryInterface $shopUserRepository, + private DateTimeProviderInterface $calendar + ) { }
-
The 2nd parameter
localeCode
has been removed fromsrc/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php
and now is set automatically bysrc/Sylius/Bundle/ApiBundle/DataTransformer/LocaleCodeAwareInputCommandDataTransformer.php
. -
The responses of endpoints
/api/v2/admin/products
and/api/v2/admin/products/{code}
have been changed in such a way that the fielddefaultVariant
has been removed.