<?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">
    <parameters>
        <parameter key="sylius.form.type.gateway_config.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
    </parameters>
    <services>
        <defaults public="true" />

        <service id="sylius.form.type.gateway_config" class="Sylius\Bundle\PayumBundle\Form\Type\GatewayConfigType">
            <argument>%sylius.model.gateway_config.class%</argument>
            <argument>%sylius.form.type.gateway_config.validation_groups%</argument>
            <argument type="service" id="sylius.form_registry.payum_gateway_config" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.extension.type.gateway_config.crypted" class="Sylius\Bundle\PayumBundle\Form\Extension\CryptedGatewayConfigTypeExtension">
            <argument type="service" id="payum.dynamic_gateways.cypher" on-invalid="null" />
            <tag name="form.type_extension" extended-type="Sylius\Bundle\PayumBundle\Form\Type\GatewayConfigType" priority="100" />
        </service>

        <service id="sylius.form.type.gateway_configuration.paypal" class="Sylius\Bundle\PayumBundle\Form\Type\PaypalGatewayConfigurationType">
            <tag name="sylius.gateway_configuration_type" type="paypal_express_checkout" label="sylius.payum_gateway_factory.paypal_express_checkout" priority="100" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.gateway_configuration.stripe" class="Sylius\Bundle\PayumBundle\Form\Type\StripeGatewayConfigurationType">
            <tag name="sylius.gateway_configuration_type" type="stripe_checkout" label="sylius.payum_gateway_factory.stripe_checkout" priority="50" />
            <tag name="form.type" />
        </service>
    </services>
</container>
