<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <imports>
        <import resource="services/subscribers.xml" />
        <import resource="services/rule.xml" />
    </imports>

    <services>
        <service id="NetInventors\NetiNextOrderAmountHandler\Service\PluginConfigFactory">
            <argument id="Shopware\Core\System\SystemConfig\SystemConfigService" type="service"/>
            <argument id="request_stack" type="service"/>
        </service>

        <service class="NetInventors\NetiNextOrderAmountHandler\Struct\PluginConfigStruct" id="neti_order_amount_handler.plugin_config">
            <factory
                service="NetInventors\NetiNextOrderAmountHandler\Service\PluginConfigFactory"
                method="create"
            />
        </service>

        <service id="NetInventors\NetiNextOrderAmountHandler\Service\PaymentMethodRoute"
                 decorates="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute">
            <argument type="service" id="NetInventors\NetiNextOrderAmountHandler\Service\PaymentMethodRoute.inner"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\SalesChannel\SalesChannelContextSwitcher"/>
            <argument type="service" id="session.factory"/>
            <argument type="service" id="neti_order_amount_handler.plugin_config"/>
            <argument type="service" id="request_stack"/>
            <argument type="service" id="order.repository"/>
            <argument>%kernel.shopware_version%</argument>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartContextHasher"/>
        </service>

        <service id="NetInventors\NetiNextOrderAmountHandler\Service\PaymentHandler\FreePayment">
            <argument type="service"
                      id="Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler"/>
            <tag name="shopware.payment.method"/>
        </service>

        <service id="NetInventors\NetiNextOrderAmountHandler\Service\PaymentMethodValidator">
            <tag name="shopware.cart.validator" priority="1000"/>
        </service>
    </services>
</container>
