diff --git a/config/app/winzou_state_machine.yaml b/config/app/integrations/winzou_state_machine.yaml similarity index 100% rename from config/app/winzou_state_machine.yaml rename to config/app/integrations/winzou_state_machine.yaml diff --git a/config/app/twig_hooks.yaml b/config/app/twig_hooks.yaml new file mode 100644 index 0000000..239a74a --- /dev/null +++ b/config/app/twig_hooks.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: 'twig_hooks/**/*.yaml' } diff --git a/config/config.yaml b/config/config.yaml index 7d8caf4..f04e126 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,2 +1,2 @@ imports: - - { resource: 'app/**/*.yaml' } + - { resource: 'app/*.yaml' } diff --git a/config/services.yaml b/config/services.yaml index 111d586..644c8d2 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,2 +1,2 @@ imports: - - { resource: 'services/**/*.yaml' } + - { resource: 'services/*.yaml' } diff --git a/config/integrations/sylius_shop.yaml b/config/services/integrations/sylius_shop.yaml similarity index 100% rename from config/integrations/sylius_shop.yaml rename to config/services/integrations/sylius_shop.yaml diff --git a/config/integrations/sylius_shop/http_reponse_providers.yaml b/config/services/integrations/sylius_shop/http_reponse_providers.yaml similarity index 100% rename from config/integrations/sylius_shop/http_reponse_providers.yaml rename to config/services/integrations/sylius_shop/http_reponse_providers.yaml diff --git a/config/integrations/sylius_shop/providers.yaml b/config/services/integrations/sylius_shop/providers.yaml similarity index 100% rename from config/integrations/sylius_shop/providers.yaml rename to config/services/integrations/sylius_shop/providers.yaml diff --git a/config/services/listeners.yaml b/config/services/listeners.yaml new file mode 100644 index 0000000..057cfaa --- /dev/null +++ b/config/services/listeners.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: 'listeners/workflow/*.yaml' } diff --git a/config/services/state_machine.yaml b/config/services/state_machine.yaml index 90222f3..abf2d4b 100644 --- a/config/services/state_machine.yaml +++ b/config/services/state_machine.yaml @@ -18,7 +18,6 @@ services: flux_se.sylius_stripe.state_machine.refund: public: true - class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface parent: flux_se.sylius_stripe.state_machine.payment_state arguments: - [] @@ -27,22 +26,18 @@ services: flux_se.sylius_stripe.state_machine.cancel: public: true - class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface parent: flux_se.sylius_stripe.state_machine.payment_state arguments: - - - - !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_NEW - - !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED + - 0: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_NEW + 1: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED - !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_CANCELLED - !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_CANCEL flux_se.sylius_stripe.state_machine.capture_authorized: public: true - class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface parent: flux_se.sylius_stripe.state_machine.payment_state arguments: - - - - !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED + - 0: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED - !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_COMPLETED - !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_AUTHORIZE diff --git a/config/services/stripe.yaml b/config/services/stripe.yaml new file mode 100644 index 0000000..e99f797 --- /dev/null +++ b/config/services/stripe.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: 'stripe/*.yaml' } diff --git a/public/.gitkeep b/public/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/DependencyInjection/FluxSESyliusStripeExtension.php b/src/DependencyInjection/FluxSESyliusStripeExtension.php index 37d1cef..9a61fc8 100644 --- a/src/DependencyInjection/FluxSESyliusStripeExtension.php +++ b/src/DependencyInjection/FluxSESyliusStripeExtension.php @@ -39,13 +39,19 @@ public function load(array $configs, ContainerBuilder $container): void $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); $loader->load('services.yaml'); + + if ($container->hasParameter('kernel.bundles')) { + /** @var string[] $bundles */ + $bundles = $container->getParameter('kernel.bundles'); + if (array_key_exists('SyliusShopBundle', $bundles)) { + $loader->load('services/integrations/sylius_shop.yaml'); + } + } } public function prepend(ContainerBuilder $container): void { $this->prependDoctrineMigrations($container); - - $this->prependSyliusShop($container); } protected function getMigrationsNamespace(): string @@ -67,13 +73,4 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array 'Sylius\Bundle\CoreBundle\Migrations', ]; } - - private function prependSyliusShop(ContainerBuilder $container): void - { - $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config/integrations')); - - if ($container->hasExtension('sylius_shop')) { - $loader->load('sylius_shop.yaml'); - } - } }