-
Removed overwriting of shipping address in
CompleteOrderActionand introduced shipping address update to PayPal.Previously, the
Sylius\PayPalPlugin\Payum\Action\CompleteOrderActionclass retrieved the shipping address from PayPal after order completion and overwrote the existing shipping address in Sylius. This behavior was incorrect because if a customer changed their address after completing the PayPal checkout, the system would revert it back to the PayPal-provided address.This mechanism has been removed. Instead, a new mechanism has been introduced: if shipping is required, the order completion process now updates the PayPal shipping address with the one stored in Sylius. This ensures that the shipping address remains consistent with the one confirmed in the store.
-
The following classes have been deprecated and will be removed in Sylius/PayPalPlugin 3.0:
Sylius\PayPalPlugin\Processor\PayPalAddressProcessorSylius\PayPalPlugin\Processor\PayPalAddressProcessorInterface
-
The following constructor signatures have been changed:
Sylius\PayPalPlugin\Payum\Action\CompleteOrderAction:
public function __construct(
private CacheAuthorizeClientApiInterface $authorizeClientApi,
private UpdateOrderApiInterface $updateOrderApi,
private CompleteOrderApiInterface $completeOrderApi,
private OrderDetailsApiInterface $orderDetailsApi,
- private PayPalAddressProcessorInterface $payPalAddressProcessor,
+ private ?PayPalAddressProcessorInterface $payPalAddressProcessor,
private PaymentUpdaterInterface $payPalPaymentUpdater,
private StateResolverInterface $orderPaymentStateResolver,
+ private ?UpdateOrderAddressApiInterface $updateOrderAddressApi = null,
)- The following constructor signatures have been changed:
Sylius\PayPalPlugin\Controller\ProcessPayPalOrderAction:
public function __construct(
private readonly OrderRepositoryInterface $orderRepository,
private readonly CustomerRepositoryInterface $customerRepository,
private readonly FactoryInterface $customerFactory,
private readonly AddressFactoryInterface $addressFactory,
private readonly ObjectManager $orderManager,
private readonly StateMachineFactoryInterface|StateMachineInterface $stateMachineFactory,
private readonly PaymentStateManagerInterface $paymentStateManager,
private readonly CacheAuthorizeClientApiInterface $authorizeClientApi,
private readonly OrderDetailsApiInterface $orderDetailsApi,
private readonly OrderProviderInterface $orderProvider,
+ private readonly ?PaymentAmountVerifierInterface $paymentAmountVerifier = null,
)Sylius\PayPalPlugin\Controller\CompletePayPalOrderFromPaymentPageAction:
public function __construct(
private readonly PaymentStateManagerInterface $paymentStateManager,
private readonly UrlGeneratorInterface $router,
private readonly OrderProviderInterface $orderProvider,
private readonly FactoryInterface|StateMachineInterface $stateMachine,
private readonly ObjectManager $orderManager,
+ private readonly ?PaymentAmountVerifierInterface $paymentAmountVerifier = null,
+ private readonly ?OrderProcessorInterface $orderProcessor = null,
)-
Support for Sylius 2.0 has been added, it is now the recommended Sylius version to use with PayPalPlugin.
-
Support for Sylius 1.X has been dropped, upgrade your application to Sylius 2.0.
-
The minimum supported version of PHP has been increased to 8.2.
-
The configuration root node has been changed from
sylius_pay_paltosylius_paypal. -
The factory name has been changed from
sylius.pay_paltosylius_paypal. -
The translations' prefix has been changed from
sylius.pay_paltosylius_paypal. Additionally, all occurrences ofpay_palhave been replaced withpaypal. -
The directories structure has been updated to the current Symfony recommendations:
@SyliusPayPalPlugin/Resources/config->@SyliusPayPalPlugin/config@SyliusPayPalPlugin/Resources/translations->@SyliusPayPalPlugin/translations@SyliusPayPalPlugin/Resources/views->@SyliusPayPalPlugin/templates
You need to adjust the import of configuration file in your end application:
imports: - - { resource: "@SyliusPayPalPlugin/Resources/config/config.yml" } + - { resource: '@SyliusPayPalPlugin/config/config.yaml' }
The routes have been consolidated into a single
config/routes.yamlfile. It is sufficient to import this file instead of defining each route explicitly:sylius_paypal: resource: "@SyliusPayPalPlugin/config/routes.yaml"
However, if you have customized the routes, you need to adjust the paths to reflect the new structure:
sylius_paypal_admin: - resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yaml" - prefix: /admin + resource: "@SyliusPayPalPlugin/config/routes/admin.yaml" + prefix: '/%sylius_admin.path_name%' sylius_paypal_shop: - resource: "@SyliusPayPalPlugin/Resources/config/shop_routing.yaml" + resource: "@SyliusPayPalPlugin/config/routes/shop.yaml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ sylius_paypal_webhook: - resource: "@SyliusPayPalPlugin/Resources/config/webhook_routing.yaml" + resource: "@SyliusPayPalPlugin/config/routes/webhook.yaml"
And the paths to assets and templates if you are using them.
-
The following routes have been renamed:
| Old route | New route |
|---|---|
sylius_paypal_plugin_admin_download_payouts_report |
sylius_paypal_admin_download_payouts_report |
sylius_paypal_plugin_admin_enable_seller |
sylius_paypal_admin_enable_seller |
sylius_paypal_plugin_pay_with_paypal_form |
sylius_paypal_shop_pay_with_paypal_form |
sylius_paypal_plugin_create_paypal_order |
sylius_paypal_shop_create_paypal_order |
sylius_paypal_plugin_create_paypal_order_from_cart |
sylius_paypal_shop_create_paypal_order_from_cart |
sylius_paypal_plugin_complete_paypal_order |
sylius_paypal_shop_complete_paypal_order |
sylius_paypal_plugin_process_paypal_order |
sylius_paypal_shop_process_paypal_order |
sylius_paypal_plugin_update_paypal_order |
sylius_paypal_shop_update_paypal_order |
sylius_paypal_plugin_create_paypal_order_from_payment_page |
sylius_paypal_shop_create_paypal_order_from_payment_page |
sylius_paypal_plugin_complete_paypal_order_from_payment_page |
sylius_paypal_shop_complete_paypal_order_from_payment_page |
sylius_paypal_plugin_cancel_order |
sylius_paypal_shop_cancel_order |
sylius_paypal_plugin_cancel_payment |
sylius_paypal_shop_cancel_payment |
sylius_paypal_plugin_cancel_last_payment |
sylius_paypal_shop_cancel_last_payment |
sylius_paypal_plugin_cancel_checkout_payment |
sylius_paypal_shop_cancel_checkout_payment |
sylius_paypal_plugin_payment_error |
sylius_paypal_shop_payment_error |
sylius_paypal_plugin_webhook_refund_order |
sylius_paypal_webhook_refund_order |
-
The route
sylius_paypal_plugin_create_paypal_order_from_producthas been removed and replaced with theAddToCartFormComponent. -
The route
sylius_paypal_plugin_complete_paypal_paymenthas been removed because the associated controller does not exist. -
The following callbacks of WinzouStateMachine have been renamed:
complete_pay_pal_order->complete_paypal_orderrefund_pay_pal_order->refund_paypal_order
-
The Twig function
sylius_is_pay_pal_enabledhas been renamed tosylius_is_paypal_enabled. -
No need to overwrite templates:
Thanks to the use of Twig Hooks and the refactoring of templates, you no longer need to overwrite templates to use plugin features. -
The following classes have been removed:
Sylius\PayPalPlugin\Controller\PayPalOrderItemControllerSylius\PayPalPlugin\Form\Type\ChangePaymentMethodTypeSylius\PayPalPlugin\Form\Type\SelectPaymentTypeSylius\PayPalPlugin\Resolver\CompleteOrderPaymentResolverSylius\PayPalPlugin\Resolver\CompleteOrderPaymentResolverInterface
-
The definition of
Http\Discovery\Psr18Clienthas been removed, usesylius.http_clientservice instead. -
The command
sylius:pay-pal-plugin:complete-paymentshas been changed tosylius-paypal:complete-payments. -
Aliases introduced in PayPalPlugin 1.7 have now become the primary service IDs in PayPalPlugin 2.0. The old service IDs have been removed, and all references must be updated accordingly:
Old ID New ID Sylius\PayPalPlugin\ApiPlatform\PayPalPaymentsylius_paypal.api_platform.paypal_paymentSylius\PayPalPlugin\Command\CompletePaidPaymentsCommandsylius_paypal.console.command.complete_paid_paymentsSylius\PayPalPlugin\Controller\CancelLastPayPalPaymentActionsylius_paypal.controller.cancel_last_paypal_paymentSylius\PayPalPlugin\Controller\CancelPayPalCheckoutPaymentActionsylius_paypal.controller.cancel_paypal_checkout_paymentSylius\PayPalPlugin\Controller\CancelPayPalOrderActionsylius_paypal.controller.cancel_paypal_orderSylius\PayPalPlugin\Controller\CancelPayPalPaymentActionsylius_paypal.controller.cancel_paypal_paymentSylius\PayPalPlugin\Controller\CompletePayPalOrderActionsylius_paypal.controller.complete_paypal_orderSylius\PayPalPlugin\Controller\CompletePayPalOrderFromPaymentPageActionsylius_paypal.controller.complete_paypal_order_from_payment_pageSylius\PayPalPlugin\Controller\CreatePayPalOrderActionsylius_paypal.controller.create_paypal_orderSylius\PayPalPlugin\Controller\CreatePayPalOrderFromCartActionsylius_paypal.controller.create_paypal_order_from_cartSylius\PayPalPlugin\Controller\CreatePayPalOrderFromPaymentPageActionsylius_paypal.controller.create_paypal_order_from_payment_pageSylius\PayPalPlugin\Controller\DownloadPayoutsReportActionsylius_paypal.controller.download_payouts_reportSylius\PayPalPlugin\Controller\EnableSellerActionsylius_paypal.controller.enable_sellerSylius\PayPalPlugin\Controller\PayPalButtonsControllersylius_paypal.controller.paypal_buttonsSylius\PayPalPlugin\Controller\PayPalPaymentOnErrorActionsylius_paypal.controller.paypal_payment_on_errorSylius\PayPalPlugin\Controller\PayWithPayPalFormActionsylius_paypal.controller.pay_with_paypal_formSylius\PayPalPlugin\Controller\ProcessPayPalOrderActionsylius_paypal.controller.process_paypal_orderSylius\PayPalPlugin\Controller\UpdatePayPalOrderActionsylius_paypal.controller.update_paypal_orderSylius\PayPalPlugin\Controller\Webhook\RefundOrderActionsylius_paypal.controller.webhook.refund_orderSylius\PayPalPlugin\EventListener\Workflow\CompletePayPalOrderListenersylius_paypal.listener.workflow.complete_paypal_orderSylius\PayPalPlugin\EventListener\Workflow\RefundPaymentListenersylius_paypal.listener.workflow.refund_paymentSylius\PayPalPlugin\Factory\PayPalPaymentMethodNewResourceFactorysylius_paypal.factory.paypal_payment_method_new_resourceSylius\PayPalPlugin\Form\Extension\PaymentMethodTypeExtensionsylius_paypal.form.extension.payment_methodSylius\PayPalPlugin\Form\Type\PayPalConfigurationTypesylius_paypal.form.type.paypal_configurationSylius\PayPalPlugin\Listener\PayPalPaymentMethodListenersylius_paypal.listener.paypal_payment_methodSylius\PayPalPlugin\Payum\Action\AuthorizeActionsylius_paypal.payum.action.authorizeSylius\PayPalPlugin\Payum\Action\CaptureActionsylius_paypal.payum.action.captureSylius\PayPalPlugin\Payum\Action\CompleteOrderActionsylius_paypal.payum.action.complete_orderSylius\PayPalPlugin\Payum\Action\ResolveNextRouteActionsylius_paypal.payum.action.resolve_next_routeSylius\PayPalPlugin\Processor\AfterCheckoutOrderPaymentProcessorsylius_paypal.order_processing.order_payment_processor.after_checkoutSylius\PayPalPlugin\Processor\OrderPaymentProcessorsylius_paypal.order_processing.order_payment_processor.checkoutSylius\PayPalPlugin\Processor\PayPalAddressProcessorsylius_paypal.processor.paypal_addressSylius\PayPalPlugin\Processor\PayPalOrderCompleteProcessorsylius_paypal.processor.paypal_order_completeSylius\PayPalPlugin\Processor\UiPayPalPaymentRefundProcessorsylius_paypal.processor.ui_paypal_payment_refundSylius\PayPalPlugin\Resolver\PayPalDefaultPaymentMethodResolversylius_paypal.resolver.payment_method.paypalSylius\PayPalPlugin\Resolver\PayPalPrioritisingPaymentMethodsResolversylius_paypal.resolver.payment_method.paypal_prioritisingSylius\PayPalPlugin\Twig\OrderAddressExtensionsylius_paypal.twig.extension.order_addressSylius\PayPalPlugin\Twig\PayPalExtensionsylius_paypal.twig.extension.paypalsylius.paypal.client.sftpsylius_paypal.client.sftpsylius.plugin.pay_pal.gateway_factory_buildersylius_paypal.gateway_factory_buildersylius_pay_pal_plugin.repository.pay_pal_credentialssylius_paypal.repository.paypal_credentials -
The following services had new aliases added in PayPalPlugin 1.7. In PayPalPlugin 2.0, these aliases have become the primary service IDs, and the old service IDs remain as aliases:
Current ID New Alias Sylius\PayPalPlugin\Api\AuthorizeClientApiInterfacesylius_paypal.api.authorize_clientSylius\PayPalPlugin\Api\CacheAuthorizeClientApiInterfacesylius_paypal.api.cache_authorize_clientSylius\PayPalPlugin\Api\CompleteOrderApiInterfacesylius_paypal.api.complete_orderSylius\PayPalPlugin\Api\CreateOrderApiInterfacesylius_paypal.api.create_orderSylius\PayPalPlugin\Api\GenericApiInterfacesylius_paypal.api.genericSylius\PayPalPlugin\Api\IdentityApiInterfacesylius_paypal.api.identitySylius\PayPalPlugin\Api\OrderDetailsApiInterfacesylius_paypal.api.order_detailsSylius\PayPalPlugin\Api\RefundPaymentApiInterfacesylius_paypal.api.refund_paymentSylius\PayPalPlugin\Api\UpdateOrderApiInterfacesylius_paypal.api.update_orderSylius\PayPalPlugin\Api\WebhookApiInterfacesylius_paypal.api.webhookSylius\PayPalPlugin\Client\PayPalClientInterfacesylius_paypal.client.paypalSylius\PayPalPlugin\Downloader\ReportDownloaderInterfacesylius_paypal.downloader.reportSylius\PayPalPlugin\Enabler\PaymentMethodEnablerInterfacesylius_paypal.enabler.payment_methodSylius\PayPalPlugin\Generator\PayPalAuthAssertionGeneratorInterfacesylius_paypal.generator.paypal_auth_assertionSylius\PayPalPlugin\Manager\PaymentStateManagerInterfacesylius_paypal.manager.payment_stateSylius\PayPalPlugin\Onboarding\Initiator\OnboardingInitiatorInterfacesylius_paypal.onboarding.initiatorSylius\PayPalPlugin\Onboarding\Processor\OnboardingProcessorInterfacesylius_paypal.onboarding.processor.basicSylius\PayPalPlugin\Processor\PaymentCompleteProcessorInterfacesylius_paypal.processor.payment_completeSylius\PayPalPlugin\Processor\LocaleProcessorInterfacesylius_paypal.processor.localeSylius\PayPalPlugin\Processor\PaymentRefundProcessorInterfacesylius_paypal.processor.payment_refundSylius\PayPalPlugin\Provider\AvailableCountriesProviderInterfacesylius_paypal.provider.available_countriesSylius\PayPalPlugin\Provider\OrderItemNonNeutralTaxProviderInterfacesylius_paypal.provider.order_item_non_neutral_taxSylius\PayPalPlugin\Provider\OrderProviderInterfacesylius_paypal.provider.orderSylius\PayPalPlugin\Provider\PaymentProviderInterfacesylius_paypal.provider.paymentSylius\PayPalPlugin\Provider\PaymentReferenceNumberProviderInterfacesylius_paypal.provider.payment_reference_numberSylius\PayPalPlugin\Provider\PayPalConfigurationProviderInterfacesylius_paypal.provider.paypal_configurationSylius\PayPalPlugin\Provider\PayPalItemDataProviderInterfacesylius_paypal.provider.paypal_item_dataSylius\PayPalPlugin\Provider\PayPalPaymentMethodProviderInterfacesylius_paypal.provider.paypal_payment_methodSylius\PayPalPlugin\Provider\PayPalRefundDataProviderInterfacesylius_paypal.provider.paypal_refund_dataSylius\PayPalPlugin\Provider\RefundReferenceNumberProviderInterfacesylius_paypal.provider.refund_reference_numberSylius\PayPalPlugin\Provider\UuidProviderInterfacesylius_paypal.provider.uuidSylius\PayPalPlugin\Registrar\SellerWebhookRegistrarInterfacesylius_paypal.registrar.seller_webhookSylius\PayPalPlugin\Resolver\CapturePaymentResolverInterfacesylius_paypal.resolver.capture_paymentSylius\PayPalPlugin\Updater\PaymentUpdaterInterfacesylius_paypal.updater.payment -
The following parameters have been renamed:
Old parameter New parameter sylius.paypal.prioritized_factory_namesylius_paypal.prioritized_factory_namesylius.pay_pal.request_trials_limitsylius_paypal.request_trials_limitsylius.paypal.logging.increasedsylius_paypal.logging.increasedsylius.pay_pal.facilitator_urlsylius_paypal.facilitator_urlsylius.pay_pal.api_base_urlsylius_paypal.api_base_urlsylius.pay_pal.reports_sftp_hostsylius_paypal.reports_sftp_host -
The parameter
sylius.paypal.logging_level_increasedhas been removed. -
The following constructor signatures have been changed:
Sylius\PayPalPlugin\Client\PayPalClientpublic function __construct( - private readonly GuzzleClientInterface|ClientInterface $client, + private readonly ClientInterface $client, private readonly LoggerInterface $logger, private readonly UuidProviderInterface $uuidProvider, private readonly PayPalConfigurationProviderInterface $payPalConfigurationProvider, private readonly ChannelContextInterface $channelContext, private readonly string $baseUrl, private int $requestTrialsLimit, - private readonly bool $loggingLevelIncreased = false, - private readonly ?RequestFactoryInterface $requestFactory = null, - private readonly ?StreamFactoryInterface $streamFactory = null, + private readonly RequestFactoryInterface $requestFactory, + private readonly StreamFactoryInterface $streamFactory, + private readonly bool $loggingLevelIncreased = false, )
Sylius\PayPalPlugin\Api\GenericApipublic function __construct( - private readonly GuzzleClientInterface|ClientInterface $client, + private readonly ClientInterface $client, - private readonly ?RequestFactoryInterface $requestFactory = null, + private readonly RequestFactoryInterface $requestFactory, )
Sylius\PayPalPlugin\Api\WebhookApipublic function __construct( - private readonly GuzzleClientInterface|ClientInterface $client, + private readonly ClientInterface $client, private readonly string $baseUrl, - private readonly ?RequestFactoryInterface $requestFactory = null, - private readonly ?StreamFactoryInterface $streamFactory = null, + private readonly RequestFactoryInterface $requestFactory, + private readonly StreamFactoryInterface $streamFactory, )
Sylius\PayPalPlugin\Onboarding\Processor\BasicOnboardingProcessorpublic function __construct( - private readonly GuzzleClientInterface|ClientInterface $client, + private readonly ClientInterface $client, private readonly SellerWebhookRegistrarInterface $sellerWebhookRegistrar, private readonly string $url, - private readonly ?RequestFactoryInterface $requestFactory = null, + private readonly RequestFactoryInterface $requestFactory, )
Sylius\PayPalPlugin\Controller\ProcessPayPalOrderActionpublic function __construct( - private ?OrderRepositoryInterface $orderRepository, private CustomerRepositoryInterface $customerRepository, private FactoryInterface $customerFactory, private AddressFactoryInterface $addressFactory, private ObjectManager $orderManager, - private StateMachineFactoryInterface|StateMachineInterface $stateMachineFactory, + private StateMachineInterface $stateMachineFactory, private PaymentStateManagerInterface $paymentStateManager, private CacheAuthorizeClientApiInterface $authorizeClientApi, private OrderDetailsApiInterface $orderDetailsApi, private OrderProviderInterface $orderProvider, )
Sylius\PayPalPlugin\Controller\UpdatePayPalOrderActionpublic function __construct( PaymentProviderInterface $paymentProvider, CacheAuthorizeClientApiInterface $authorizeClientApi, - ?OrderDetailsApiInterface $orderDetailsApi, UpdateOrderApiInterface $updateOrderApi, AddressFactoryInterface $addressFactory, OrderProcessorInterface $orderProcessor, )Sylius\PayPalPlugin\Payum\Action\CompleteOrderActionpublic function __construct( CacheAuthorizeClientApiInterface $authorizeClientApi, UpdateOrderApiInterface $updateOrderApi, CompleteOrderApiInterface $completeOrderApi, OrderDetailsApiInterface $orderDetailsApi, PayPalAddressProcessorInterface $payPalAddressProcessor, PaymentUpdaterInterface $payPalPaymentUpdater, StateResolverInterface $orderPaymentStateResolver, - ?PayPalItemDataProviderInterface $payPalItemsDataProvider, )Sylius\PayPalPlugin\Console\Command\CompletePaidPaymentsCommandpublic function __construct( PaymentRepositoryInterface $paymentRepository, ObjectManager $paymentManager, CacheAuthorizeClientApiInterface $authorizeClientApi, OrderDetailsApiInterface $orderDetailsApi, - FactoryInterface|StateMachineInterface $stateMachineFactory, + StateMachineInterface $stateMachine, )