<?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">

    <services>
        <service id="Swag\PayPal\Storefront\Controller\PayPalController" public="true">
            <argument type="service" id="Swag\PayPal\Checkout\SalesChannel\CreateOrderRoute"/>
            <argument type="service" id="Swag\PayPal\Checkout\SalesChannel\MethodEligibilityRoute"/>
            <argument type="service" id="Swag\PayPal\Checkout\PUI\SalesChannel\PUIPaymentInstructionsRoute"/>
            <argument type="service" id="Swag\PayPal\Checkout\ExpressCheckout\SalesChannel\ExpressPrepareCheckoutRoute"/>
            <argument type="service" id="Swag\PayPal\Checkout\ExpressCheckout\SalesChannel\ExpressCreateOrderRoute"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\SalesChannel\ContextSwitchRoute"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartDeleteRoute"/>
            <argument type="service" id="Swag\PayPal\Checkout\SalesChannel\ClearVaultRoute"/>
            <argument type="service" id="monolog.logger.paypal"/>

            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Swag\PayPal\Storefront\Framework\Cookie\PayPalCookieProvider"
                 decorates="Shopware\Storefront\Framework\Cookie\CookieProviderInterface">
            <argument type="service" id="Swag\PayPal\Storefront\Framework\Cookie\PayPalCookieProvider.inner"/>
        </service>

        <service id="Swag\PayPal\Storefront\Framework\Cookie\GooglePayCookieProvider"
                 decorates="Shopware\Storefront\Framework\Cookie\CookieProviderInterface">
            <argument type="service" id="Swag\PayPal\Storefront\Framework\Cookie\GooglePayCookieProvider.inner"/>
            <argument type="service" id="payment_method.repository"/>
        </service>

        <service id="Swag\PayPal\Storefront\RequestSubscriber">
            <argument type="service" id="monolog.logger.paypal"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\FundingSubscriber">
            <argument type="service" id="Swag\PayPal\Setting\Service\SettingsValidationService"/>
            <argument type="service" id="Swag\PayPal\Storefront\Data\Service\FundingEligibilityDataService"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\VaultSubscriber">
            <argument type="service" id="Swag\PayPal\Setting\Service\SettingsValidationService"/>
            <argument type="service" id="Swag\PayPal\Storefront\Data\Service\VaultDataService"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\Service\FundingEligibilityDataService">
            <argument type="service" id="Swag\PayPal\Setting\Service\CredentialsUtil"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Swag\PayPal\Util\LocaleCodeProvider"/>
            <argument type="service" id="router"/>
            <argument type="service" id="request_stack"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\Service\VaultDataService">
            <argument type="service" id="swag_paypal_vault_token.repository"/>
            <argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService" abstract="true">
            <argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry"/>
            <argument type="service" id="Swag\PayPal\Util\LocaleCodeProvider"/>
            <argument type="service" id="router"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Swag\PayPal\Setting\Service\CredentialsUtil"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\Service\ACDCCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService" />
        <service id="Swag\PayPal\Storefront\Data\Service\ApplePayCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService"/>
        <service id="Swag\PayPal\Storefront\Data\Service\GooglePayCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService" />
        <service id="Swag\PayPal\Storefront\Data\Service\PayLaterCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService" />
        <service id="Swag\PayPal\Storefront\Data\Service\SEPACheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService" />
        <service id="Swag\PayPal\Storefront\Data\Service\SPBCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService">
            <argument type="service" id="Swag\PayPal\Checkout\SalesChannel\CustomerVaultTokenRoute"/>
        </service>
        <service id="Swag\PayPal\Storefront\Data\Service\VenmoCheckoutDataService" public="true" parent="Swag\PayPal\Storefront\Data\Service\AbstractCheckoutDataService">
            <argument type="service" id="Swag\PayPal\Checkout\SalesChannel\CustomerVaultTokenRoute"/>
        </service>

        <service id="Swag\PayPal\Storefront\Data\CheckoutDataSubscriber">
            <argument type="service" id="logger"/>
            <argument type="service" id="Swag\PayPal\Setting\Service\SettingsValidationService"/>
            <argument type="service" id="request_stack"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="tagged_iterator" tag="swag.paypal.payment.storefront.checkout.data"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Swag\PayPal\Storefront\Controller\ApplePayController" public="true">
            <argument type="service" id="Swag\PayPal\Setting\Service\CredentialsUtil" />
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>
    </services>
</container>
