<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<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/form.xml" />
    </imports>

    <parameters>
        <parameter key="sylius.payment_methods_resolver.interface">Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface</parameter>
    </parameters>

    <services>
        <defaults public="true" />

        <service id="sylius.custom_factory.payment" class="Sylius\Component\Payment\Factory\PaymentFactory" decorates="sylius.factory.payment" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.payment.inner" />
        </service>
        <service id="Sylius\Component\Payment\Factory\PaymentFactoryInterface" alias="sylius.factory.payment" />

        <service id="sylius.registry.payment_methods_resolver" class="Sylius\Component\Registry\PrioritizedServiceRegistry">
            <argument>%sylius.payment_methods_resolver.interface%</argument>
            <argument>Payment methods resolver</argument>
        </service>

        <service id="sylius.payment_methods_resolver" class="Sylius\Component\Payment\Resolver\CompositeMethodsResolver">
            <argument type="service" id="sylius.registry.payment_methods_resolver" />
        </service>
        <service id="Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface" alias="sylius.payment_methods_resolver" />

        <service id="sylius.payment_methods_resolver.default" class="Sylius\Component\Payment\Resolver\PaymentMethodsResolver" public="false">
            <argument type="service" id="sylius.repository.payment_method" />
            <tag name="sylius.payment_method_resolver" type="default" label="Default" />
        </service>
    </services>
</container>
