From dbdd2264196e2a700da956c3c578f93e664fd448 Mon Sep 17 00:00:00 2001 From: Francis Hilaire Date: Mon, 16 Sep 2024 22:27:17 +0200 Subject: [PATCH] Prioritize PaymentRequest --- config/services_test_cached_payum.yaml | 20 ++++++++++- .../services/integrations/payum/offline.xml | 2 +- .../offline/command_handlers.xml | 2 ++ .../offline/command_providers.xml | 4 ++- .../integrations/order_pay/providers.xml | 33 ++++++++++--------- 5 files changed, 42 insertions(+), 19 deletions(-) diff --git a/config/services_test_cached_payum.yaml b/config/services_test_cached_payum.yaml index 1a0c660f47..a4eff75f60 100644 --- a/config/services_test_cached_payum.yaml +++ b/config/services_test_cached_payum.yaml @@ -2,9 +2,27 @@ imports: - { resource: "services_test_cached.yaml" } services: + ## + # Prioritize Payum by tagging services with a higher priority (or lower for tagged_iterator). + ## + 'sylius.payment_request.command_provider.payum.offline': class: Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\ActionsCommandProvider arguments: - !tagged_locator { tag: 'sylius.payment_request.command_provider.payum.offline', index_by: 'action' } tags: - - { name: 'sylius.payment_request.command_provider', gateway-factory: 'offline', priority: -200 } + - { name: 'sylius.payment_request.command_provider', gateway-factory: 'offline', priority: -100 } + + 'sylius.shop.order_pay.provider.pay_response.payum': + parent: Sylius\Bundle\CoreBundle\OrderPay\Provider\PayumPayResponseProvider + arguments: + - '@sylius.shop.resolver.payment_to_pay' + tags: + - { name: 'sylius.shop.order_pay.provider.pay_response', priority: -150 } + + 'sylius.shop.order_pay.provider.after_pay_response.payum': + parent: Sylius\Bundle\CoreBundle\OrderPay\Provider\PayumAfterPayResponseProvider + arguments: + - '@sylius.shop.order_pay.handler.payment_state_flash' + tags: + - { name: 'sylius.shop.order_pay.provider.after_pay_response', priority: -50 } diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/payum/offline.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/payum/offline.xml index d6454020af..70a31852ca 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/payum/offline.xml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/services/integrations/payum/offline.xml @@ -20,7 +20,7 @@ - + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_handlers.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_handlers.xml index 6678f28e62..1d449b1255 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_handlers.xml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_handlers.xml @@ -16,6 +16,8 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" > + + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_providers.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_providers.xml index 512b7b513b..1980809280 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_providers.xml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/services/payment_request/offline/command_providers.xml @@ -16,9 +16,11 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" > + + - + diff --git a/src/Sylius/Bundle/ShopBundle/Resources/config/services/integrations/order_pay/providers.xml b/src/Sylius/Bundle/ShopBundle/Resources/config/services/integrations/order_pay/providers.xml index 1fde0738b4..0189bc86e3 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/config/services/integrations/order_pay/providers.xml +++ b/src/Sylius/Bundle/ShopBundle/Resources/config/services/integrations/order_pay/providers.xml @@ -17,6 +17,7 @@ > + %sylius_shop.order_pay.after_pay_route% @@ -32,35 +33,35 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +