From 253d10dbf976dfdccc8ebcae2d971104a9b676e9 Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Tue, 26 Nov 2024 18:10:09 +0100 Subject: [PATCH 1/4] Extract Tpay Apple Pay as a separate payment method --- config/config/sylius_fixtures.php | 6 ++-- .../services/apple_pay_payment/controller.php | 19 +++++++++++ config/services/apple_pay_payment/form.php | 9 ++++++ .../services/apple_pay_payment/form/type.php | 19 +++++++++++ config/services/apple_pay_payment/payum.php | 9 ++++++ .../apple_pay_payment/payum/action.php | 32 +++++++++++++++++++ .../apple_pay_payment/payum/factory.php | 19 +++++++++++ config/services/payum/action.php | 26 +++++---------- .../Form/Type/GatewayConfigurationType.php | 29 +++++++++++++++++ .../Payum/Factory/GatewayFactory.php | 17 ++++++++++ .../Checkout/Complete/_navigation.html.twig | 4 +-- .../shop/cart/complete/_apple_pay.html.twig | 4 +-- .../complete/_apple_pay_regulations.html.twig | 5 +-- .../shop/paying_for_orders_by_apple_pay.yml | 5 ++- 14 files changed, 170 insertions(+), 33 deletions(-) create mode 100644 config/services/apple_pay_payment/controller.php create mode 100644 config/services/apple_pay_payment/form.php create mode 100644 config/services/apple_pay_payment/form/type.php create mode 100644 config/services/apple_pay_payment/payum.php create mode 100644 config/services/apple_pay_payment/payum/action.php create mode 100644 config/services/apple_pay_payment/payum/factory.php create mode 100644 src/ApplePayPayment/Form/Type/GatewayConfigurationType.php create mode 100644 src/ApplePayPayment/Payum/Factory/GatewayFactory.php diff --git a/config/config/sylius_fixtures.php b/config/config/sylius_fixtures.php index 528377a9..2847d0a4 100644 --- a/config/config/sylius_fixtures.php +++ b/config/config/sylius_fixtures.php @@ -132,9 +132,9 @@ 'apple_pay' => [ 'code' => 'tpay_apple_pay', 'name' => 'Apple Pay (Tpay)', - 'gatewayFactory' => 'tpay', - 'gatewayName' => 'tpay', - 'gatewayConfig' => $tpayConfig + ['type' => PaymentType::APPLE_PAY], + 'gatewayFactory' => 'tpay_apple_pay', + 'gatewayName' => 'tpay_apple_pay', + 'gatewayConfig' => $tpayConfig, 'channels' => [ 'FASHION_WEB', ], diff --git a/config/services/apple_pay_payment/controller.php b/config/services/apple_pay_payment/controller.php new file mode 100644 index 00000000..5d4c855c --- /dev/null +++ b/config/services/apple_pay_payment/controller.php @@ -0,0 +1,19 @@ +services(); + + $services->set(InitApplePayPaymentAction::class) + ->args([ + service('payum'), + service('sylius.context.cart.composite'), + ]) + ->tag('controller.service_arguments') + ; +}; diff --git a/config/services/apple_pay_payment/form.php b/config/services/apple_pay_payment/form.php new file mode 100644 index 00000000..0c78f855 --- /dev/null +++ b/config/services/apple_pay_payment/form.php @@ -0,0 +1,9 @@ +import('form/**/*.php'); +}; diff --git a/config/services/apple_pay_payment/form/type.php b/config/services/apple_pay_payment/form/type.php new file mode 100644 index 00000000..78cf7728 --- /dev/null +++ b/config/services/apple_pay_payment/form/type.php @@ -0,0 +1,19 @@ +services(); + + $services->set('commerce_weavers_sylius_tpay.apple_pay_payment.form.type.gateway_configuration', GatewayConfigurationType::class) + ->parent('commerce_weavers_sylius_tpay.form.type.abstract_tpay_gateway_configuration') + ->tag('sylius.gateway_configuration_type', ['label' => 'commerce_weavers_sylius_tpay.admin.gateway_name.tpay_apple_pay', 'type' => GatewayFactory::NAME]) + ->tag('form.type') + ; +}; diff --git a/config/services/apple_pay_payment/payum.php b/config/services/apple_pay_payment/payum.php new file mode 100644 index 00000000..32161d65 --- /dev/null +++ b/config/services/apple_pay_payment/payum.php @@ -0,0 +1,9 @@ +import('payum/**/*.php'); +}; diff --git a/config/services/apple_pay_payment/payum/action.php b/config/services/apple_pay_payment/payum/action.php new file mode 100644 index 00000000..493d52f3 --- /dev/null +++ b/config/services/apple_pay_payment/payum/action.php @@ -0,0 +1,32 @@ +services(); + + $services->defaults() + ->public() + ; + + $services->set(CreateApplePayTransactionAction::class) + ->args([ + service('commerce_weavers_sylius_tpay.tpay.factory.create_apple_pay_payment_payload'), + service('commerce_weavers_sylius_tpay.payum.factory.token.notify'), + ]) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.create_apple_pay_transaction']) + ; + + $services->set(InitializeApplePayPaymentAction::class) + ->args([ + service('commerce_weavers_sylius_tpay.tpay.factory.create_initialize_apple_pay_payment_payload'), + ]) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.initialize_apple_pay_payment']) + ; +}; diff --git a/config/services/apple_pay_payment/payum/factory.php b/config/services/apple_pay_payment/payum/factory.php new file mode 100644 index 00000000..4161992b --- /dev/null +++ b/config/services/apple_pay_payment/payum/factory.php @@ -0,0 +1,19 @@ +services(); + + $services->set('commerce_weavers_sylius_tpay.apple_pay_payment.payum.factory.gateway', GatewayFactoryBuilder::class) + ->args([ + GatewayFactory::class, + ]) + ->tag('payum.gateway_factory_builder', ['factory' => GatewayFactory::NAME]) + ; +}; diff --git a/config/services/payum/action.php b/config/services/payum/action.php index f9da2129..94f96044 100644 --- a/config/services/payum/action.php +++ b/config/services/payum/action.php @@ -4,14 +4,12 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\GatewayFactory as ApplePayGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\BlikPayment\Payum\Factory\GatewayFactory as BlikGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\CardPayment\Payum\Factory\GatewayFactory as CardGatewayFactory; use CommerceWeavers\SyliusTpayPlugin\PayByLinkPayment\Payum\Factory\GatewayFactory as PayByLinkGatewayFactory; -use CommerceWeavers\SyliusTpayPlugin\RedirectPayment\Payum\Factory\GatewayFactory as RedirectGatewayFactory; -use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateApplePayTransactionAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateGooglePayTransactionAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateVisaMobileTransactionAction; -use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\InitializeApplePayPaymentAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\NotifyAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\CaptureAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\GetStatusAction; @@ -19,6 +17,7 @@ use CommerceWeavers\SyliusTpayPlugin\Payum\Action\RefundAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Action\ResolveNextRouteAction; use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\TpayGatewayFactory; +use CommerceWeavers\SyliusTpayPlugin\RedirectPayment\Payum\Factory\GatewayFactory as RedirectGatewayFactory; return static function(ContainerConfigurator $container): void { $services = $container->services(); @@ -30,6 +29,7 @@ ->args([ service('commerce_weavers_sylius_tpay.payum.factory.create_transaction'), ]) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.capture']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.capture']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.capture']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.capture']) @@ -37,14 +37,6 @@ ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.capture']) ; - $services->set(CreateApplePayTransactionAction::class) - ->args([ - service('commerce_weavers_sylius_tpay.tpay.factory.create_apple_pay_payment_payload'), - service('commerce_weavers_sylius_tpay.payum.factory.token.notify'), - ]) - ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.create_apple_pay_transaction']) - ; - $services->set(CreateGooglePayTransactionAction::class) ->args([ service('commerce_weavers_sylius_tpay.tpay.factory.create_google_pay_payment_payload'), @@ -67,6 +59,7 @@ service('commerce_weavers_sylius_tpay.tpay.security.notification.verifier.checksum'), service('commerce_weavers_sylius_tpay.tpay.security.notification.verifier.signature'), ]) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.notify']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.notify']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.notify']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.notify']) @@ -75,6 +68,7 @@ ; $services->set(GetStatusAction::class) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.get_status']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.get_status']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.get_status']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.get_status']) @@ -83,6 +77,7 @@ ; $services->set(PartialRefundAction::class) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.partial_refund']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.partial_refund']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.partial_refund']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.partial_refund']) @@ -91,6 +86,7 @@ ; $services->set(RefundAction::class) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.refund']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.refund']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.refund']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.refund']) @@ -98,14 +94,8 @@ ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.refund']) ; - $services->set(InitializeApplePayPaymentAction::class) - ->args([ - service('commerce_weavers_sylius_tpay.tpay.factory.create_initialize_apple_pay_payment_payload'), - ]) - ->tag('payum.action', ['factory' => TpayGatewayFactory::NAME, 'alias' => 'cw.tpay.initialize_apple_pay_payment']) - ; - $services->set(ResolveNextRouteAction::class) + ->tag('payum.action', ['factory' => ApplePayGatewayFactory::NAME, 'alias' => 'cw.tpay_apple_pay.resolve_next_route']) ->tag('payum.action', ['factory' => BlikGatewayFactory::NAME, 'alias' => 'cw.tpay_blik.resolve_next_route']) ->tag('payum.action', ['factory' => CardGatewayFactory::NAME, 'alias' => 'cw.tpay_card.resolve_next_route']) ->tag('payum.action', ['factory' => PayByLinkGatewayFactory::NAME, 'alias' => 'cw.tpay_pbl.resolve_next_route']) diff --git a/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php b/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php new file mode 100644 index 00000000..dcd9d9c9 --- /dev/null +++ b/src/ApplePayPayment/Form/Type/GatewayConfigurationType.php @@ -0,0 +1,29 @@ +add( + 'apple_pay_merchant_id', + TextType::class, + [ + 'empty_data' => '', + 'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.apple_pay_merchant_id', + 'required' => true, + ], + ) + ; + } +} diff --git a/src/ApplePayPayment/Payum/Factory/GatewayFactory.php b/src/ApplePayPayment/Payum/Factory/GatewayFactory.php new file mode 100644 index 00000000..1fa1c00d --- /dev/null +++ b/src/ApplePayPayment/Payum/Factory/GatewayFactory.php @@ -0,0 +1,17 @@ + @@ -15,4 +16,3 @@ {% endif %} {# SyliusTpayPlugin customization <<< #} - diff --git a/templates/shop/cart/complete/_apple_pay.html.twig b/templates/shop/cart/complete/_apple_pay.html.twig index b58d19a4..2c8eb50e 100644 --- a/templates/shop/cart/complete/_apple_pay.html.twig +++ b/templates/shop/cart/complete/_apple_pay.html.twig @@ -1,6 +1,4 @@ -{% if payment is not null and - cw_tpay_get_gateway_config_value(payment.method.gatewayConfig, 'type') == constant('CommerceWeavers\\SyliusTpayPlugin\\Tpay\\PaymentType::APPLE_PAY') -%} +{% if payment is not null and payment.method.gatewayConfig.gatewayName == 'tpay_apple_pay' %} diff --git a/templates/shop/cart/complete/_apple_pay_regulations.html.twig b/templates/shop/cart/complete/_apple_pay_regulations.html.twig index 255b30e5..11c128f5 100644 --- a/templates/shop/cart/complete/_apple_pay_regulations.html.twig +++ b/templates/shop/cart/complete/_apple_pay_regulations.html.twig @@ -1,9 +1,6 @@ {% set payment = order.lastCartPayment() %} -{% if payment is not null and - cw_tpay_get_gateway_config_value(payment.method.gatewayConfig, 'type') == - constant('CommerceWeavers\\SyliusTpayPlugin\\Tpay\\PaymentType::APPLE_PAY') -%} +{% if payment is not null and payment.method.gatewayConfig.gatewayName == 'tpay_apple_pay' %}
diff --git a/tests/Api/DataFixtures/shop/paying_for_orders_by_apple_pay.yml b/tests/Api/DataFixtures/shop/paying_for_orders_by_apple_pay.yml index 868bf118..5e0d8c44 100644 --- a/tests/Api/DataFixtures/shop/paying_for_orders_by_apple_pay.yml +++ b/tests/Api/DataFixtures/shop/paying_for_orders_by_apple_pay.yml @@ -14,15 +14,14 @@ Sylius\Component\Core\Model\PaymentMethod: Sylius\Bundle\PayumBundle\Model\GatewayConfig: gateway_tpay_apple_pay: - gatewayName: 'tpay' - factoryName: 'tpay' + gatewayName: 'tpay_apple_pay' + factoryName: 'tpay_apple_pay' config: client_id: 'encrypted_' client_secret: 'encrypted_' notification_security_code: 'encrypted_' merchant_id: 'encrypted_' apple_pay_merchant_id: 'encrypted_' - type: 'apple_pay' production_mode: false encrypted: true From 842b2522ec54db096444820137e6c9deca32399b Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Tue, 26 Nov 2024 18:51:18 +0100 Subject: [PATCH 2/4] Move all `Apple Pay`-related services under the `ApplePayPayment` namespace --- config/routes_webhook.php | 2 +- config/services.php | 5 +- config/services/api/command.php | 2 +- .../apple_pay_payment/payum/action.php | 4 +- .../apple_pay_payment/payum/factory.php | 6 ++ config/services/controller.php | 10 +-- config/services/payum/factory.php | 6 -- config/services/refunding.php | 1 - config/validation/Pay.xml | 4 +- .../InitializeApplePaySessionHandler.php | 2 +- .../Controller/InitApplePayPaymentAction.php | 7 +- .../CreateApplePayTransactionAction.php | 3 +- .../InitializeApplePayPaymentAction.php | 5 +- .../InitializeApplePayPaymentFactory.php | 4 +- ...tializeApplePayPaymentFactoryInterface.php | 4 +- .../Request}/InitializeApplePayPayment.php | 2 +- src/Refunding/Dispatcher/RefundDispatcher.php | 18 ++++- .../InitializeApplePaySessionHandlerTest.php | 4 +- .../CreateApplePayTransactionActionTest.php | 4 +- .../InitializeApplePayPaymentActionTest.php | 6 +- .../InitializeApplePayPaymentFactoryTest.php | 8 +-- .../Dispatcher/RefundDispatcherTest.php | 65 +++++++++++++++---- 22 files changed, 112 insertions(+), 60 deletions(-) rename src/{ => ApplePayPayment}/Controller/InitApplePayPaymentAction.php (84%) rename src/{Payum/Action/Api => ApplePayPayment/Payum/Action}/CreateApplePayTransactionAction.php (95%) rename src/{Payum/Action/Api => ApplePayPayment/Payum/Action}/InitializeApplePayPaymentAction.php (87%) rename src/{ => ApplePayPayment}/Payum/Factory/InitializeApplePayPaymentFactory.php (74%) rename src/{ => ApplePayPayment}/Payum/Factory/InitializeApplePayPaymentFactoryInterface.php (67%) rename src/{Payum/Request/Api => ApplePayPayment/Payum/Request}/InitializeApplePayPayment.php (89%) rename tests/Unit/{Payum/Action/Api => ApplePayPayment/Payum/Action}/CreateApplePayTransactionActionTest.php (98%) rename tests/Unit/{Payum/Action/Api => ApplePayPayment/Payum/Action}/InitializeApplePayPaymentActionTest.php (95%) rename tests/Unit/{ => ApplePayPayment}/Payum/Factory/InitializeApplePayPaymentFactoryTest.php (75%) diff --git a/config/routes_webhook.php b/config/routes_webhook.php index d10a8d86..37f437c7 100644 --- a/config/routes_webhook.php +++ b/config/routes_webhook.php @@ -4,7 +4,7 @@ namespace Symfony\Component\Routing\Loader\Configurator; -use CommerceWeavers\SyliusTpayPlugin\Controller\InitApplePayPaymentAction; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Controller\InitApplePayPaymentAction; use CommerceWeavers\SyliusTpayPlugin\Controller\PaymentNotificationAction; use CommerceWeavers\SyliusTpayPlugin\Controller\TpayNotificationAction; use CommerceWeavers\SyliusTpayPlugin\Routing; diff --git a/config/services.php b/config/services.php index b84b43b5..c927c1a8 100644 --- a/config/services.php +++ b/config/services.php @@ -4,6 +4,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\GatewayFactory; use Payum\Core\Gateway; return function(ContainerConfigurator $container): void { @@ -11,8 +12,8 @@ $services = $container->services(); - $services->set('commerce_weavers_sylius_tpay.gateway', Gateway::class) + $services->set('commerce_weavers_sylius_tpay.apple_pay_gateway', Gateway::class) ->factory([service('payum'), 'getGateway']) - ->args(['tpay']) + ->args([GatewayFactory::NAME]) ; }; diff --git a/config/services/api/command.php b/config/services/api/command.php index 0d6c0047..cfc6c3a9 100644 --- a/config/services/api/command.php +++ b/config/services/api/command.php @@ -50,7 +50,7 @@ ->args([ service('sylius.repository.order'), service('sylius.repository.payment'), - service('commerce_weavers_sylius_tpay.gateway'), + service('commerce_weavers_sylius_tpay.apple_pay_gateway'), service('commerce_weavers_sylius_tpay.payum.factory.initialize_apple_pay_payment'), ]) ->tag('messenger.message_handler') diff --git a/config/services/apple_pay_payment/payum/action.php b/config/services/apple_pay_payment/payum/action.php index 493d52f3..3650e959 100644 --- a/config/services/apple_pay_payment/payum/action.php +++ b/config/services/apple_pay_payment/payum/action.php @@ -4,9 +4,9 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Action\CreateApplePayTransactionAction; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Action\InitializeApplePayPaymentAction; use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\GatewayFactory as ApplePayGatewayFactory; -use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateApplePayTransactionAction; -use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\InitializeApplePayPaymentAction; return function(ContainerConfigurator $container): void { $services = $container->services(); diff --git a/config/services/apple_pay_payment/payum/factory.php b/config/services/apple_pay_payment/payum/factory.php index 4161992b..3454cb30 100644 --- a/config/services/apple_pay_payment/payum/factory.php +++ b/config/services/apple_pay_payment/payum/factory.php @@ -5,6 +5,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\GatewayFactory; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\InitializeApplePayPaymentFactory; +use CommerceWeavers\SyliusTpayPlugin\ApplePayPayment\Payum\Factory\InitializeApplePayPaymentFactoryInterface; use Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder; return function(ContainerConfigurator $container): void { @@ -16,4 +18,8 @@ ]) ->tag('payum.gateway_factory_builder', ['factory' => GatewayFactory::NAME]) ; + + $services->set('commerce_weavers_sylius_tpay.payum.factory.initialize_apple_pay_payment', InitializeApplePayPaymentFactory::class) + ->alias(InitializeApplePayPaymentFactoryInterface::class, 'commerce_weavers_sylius_tpay.payum.factory.initialize_apple_pay_payment') + ; }; diff --git a/config/services/controller.php b/config/services/controller.php index 66ffaea4..b37f1a80 100644 --- a/config/services/controller.php +++ b/config/services/controller.php @@ -8,9 +8,8 @@ use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayThankYouPageAction; use CommerceWeavers\SyliusTpayPlugin\Controller\DisplayWaitingForPaymentPage; use CommerceWeavers\SyliusTpayPlugin\Controller\PaymentNotificationAction; -use CommerceWeavers\SyliusTpayPlugin\Controller\InitApplePayPaymentAction; -use CommerceWeavers\SyliusTpayPlugin\Controller\TpayNotificationAction; use CommerceWeavers\SyliusTpayPlugin\Controller\RetryPaymentAction; +use CommerceWeavers\SyliusTpayPlugin\Controller\TpayNotificationAction; return function(ContainerConfigurator $container): void { $services = $container->services(); @@ -42,13 +41,6 @@ ->tag('controller.service_arguments') ; - $services->set(InitApplePayPaymentAction::class) - ->args([ - service('payum'), - ]) - ->tag('controller.service_arguments') - ; - $services->set(PaymentNotificationAction::class) ->args([ service('payum'), diff --git a/config/services/payum/factory.php b/config/services/payum/factory.php index 0466c94e..3670d449 100644 --- a/config/services/payum/factory.php +++ b/config/services/payum/factory.php @@ -6,8 +6,6 @@ use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\CreateTransactionFactory; use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\CreateTransactionFactoryInterface; -use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\InitializeApplePayPaymentFactory; -use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\InitializeApplePayPaymentFactoryInterface; use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\NotifyDataFactory; use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\NotifyDataFactoryInterface; use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\NotifyFactory; @@ -35,10 +33,6 @@ ->alias(CreateTransactionFactoryInterface::class, 'commerce_weavers_sylius_tpay.payum.factory.create_transaction') ; - $services->set('commerce_weavers_sylius_tpay.payum.factory.initialize_apple_pay_payment', InitializeApplePayPaymentFactory::class) - ->alias(InitializeApplePayPaymentFactoryInterface::class, 'commerce_weavers_sylius_tpay.payum.factory.initialize_apple_pay_payment') - ; - $services->set('commerce_weavers_sylius_tpay.payum.factory.notify_data', NotifyDataFactory::class) ->alias(NotifyDataFactoryInterface::class, 'commerce_weavers_sylius_tpay.payum.factory.notify_data') ; diff --git a/config/services/refunding.php b/config/services/refunding.php index 6f4032c5..4c68b560 100644 --- a/config/services/refunding.php +++ b/config/services/refunding.php @@ -21,7 +21,6 @@ $services->set('commerce_weavers_sylius_tpay.refunding.dispatcher.refund', RefundDispatcher::class) ->public() ->args([ - service('commerce_weavers_sylius_tpay.gateway'), service('commerce_weavers_sylius_tpay.refunding.checker.refund_plugin_availability'), ]) ->alias(RefundDispatcherInterface::class, 'commerce_weavers_sylius_tpay.refunding.dispatcher.refund') diff --git a/config/validation/Pay.xml b/config/validation/Pay.xml index 2fbf601e..4c96a100 100644 --- a/config/validation/Pay.xml +++ b/config/validation/Pay.xml @@ -24,8 +24,8 @@ - - + +