<?xml version="1.0"?>
<!--
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Payment module (https://www.adyen.com/)
 *
 * Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
 * See LICENSE.txt for license details.
 *
 * Author: Adyen <magento@adyen.com>
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <!-- Payment Method Facade configuration -->
    <virtualType name="AdyenPaymentGenericFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenGenericConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\Cc</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\Cc</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentGenericValueHandlerPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCcFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\Cc</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\Cc</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentCcValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentCcValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentCcCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCcVaultFacade" type="Magento\Vault\Model\Method\Vault">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CC_VAULT_CODE
            </argument>
            <argument name="config" xsi:type="object">AdyenPaymentCcVaultConfig</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentCcVaultPaymentValueHandlerPool</argument>
            <argument name="vaultProvider" xsi:type="object">AdyenPaymentCcFacade</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGooglePayVaultFacade" type="Magento\Vault\Model\Method\Vault">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenGooglePayConfigProvider::GOOGLE_PAY_VAULT_CODE
            </argument>
            <argument name="config" xsi:type="object">AdyenPaymentCcVaultConfig</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentCcVaultPaymentValueHandlerPool</argument>
            <argument name="vaultProvider" xsi:type="object">AdyenPaymentGooglePayFacade</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentOneclickFacade" type="Adyen\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\Oneclick</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\Oneclick</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentOneclickValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentOneclickValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentOneclickCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentHppFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenHppConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\Hpp</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\Hpp</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentHppValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentHppValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentHppCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentBoletoFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenBoletoConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\Boleto</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\Boleto</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentBoletoValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentBoletoValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentBoletoCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPosCloudFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\PosCloud</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\PosCloud</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentPosCloudValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentPosCloudValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentPosCloudCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPayByMailFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenPayByMailConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\PayByMail</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\PayByMail</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentPayByMailValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentPayByMailValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentPayByMailCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentApplePayFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenApplePayConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\ApplePay</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\ApplePay</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentApplePayValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentApplePayValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentApplePayCommandPool</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGooglePayFacade" type="Magento\Payment\Model\Method\Adapter">
        <arguments>
            <argument name="code" xsi:type="const">Adyen\Payment\Model\Ui\AdyenGooglePayConfigProvider::CODE</argument>
            <argument name="formBlockType" xsi:type="string">Adyen\Payment\Block\Form\GooglePay</argument>
            <argument name="infoBlockType" xsi:type="string">Adyen\Payment\Block\Info\GooglePay</argument>
            <argument name="valueHandlerPool" xsi:type="object">AdyenPaymentGooglePayValueHandlerPool</argument>
            <argument name="validatorPool" xsi:type="object">AdyenPaymentGooglePayValidatorPool</argument>
            <argument name="commandPool" xsi:type="object">AdyenPaymentGooglePayCommandPool</argument>
        </arguments>
    </virtualType>

    <!-- Value handlers infrastructure -->
    <virtualType name="AdyenPaymentCcVaultPaymentValueHandler" type="VaultPaymentDefaultValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentCcVaultConfig</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCcVaultPaymentValueHandlerPool" type="VaultPaymentValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentCcVaultPaymentValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGenericValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentGenericConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGenericConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentGenericConfig</argument>
        </arguments>
    </virtualType>


    <virtualType name="AdyenPaymentCcValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentCcConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCcConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentCcConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentOneclickValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentOneclickConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentOneclickConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentOneclickConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentHppValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentHppConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentHppConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentHppConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentBoletoValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentBoletoConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentBoletoConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentBoletoConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentPosCloudConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPosCloudConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentPosCloudConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPayByMailValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentPayByMailConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPayByMailConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentPayByMailConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentApplePayValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentApplePayConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentApplePayConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentApplePayConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentGooglePayValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="default" xsi:type="string">AdyenPaymentGooglePayConfigValueHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGooglePayConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
        <arguments>
            <argument name="configInterface" xsi:type="object">AdyenPaymentGooglePayConfig</argument>
        </arguments>
    </virtualType>

    <!-- Configuration reader -->
    <virtualType name="AdyenPaymentGenericConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenGenericConfigProvider::CODE</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentCcConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCcVaultConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CC_VAULT_CODE
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentOneclickConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentHppConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenHppConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentBoletoConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenBoletoConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPosCloudConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentPayByMailConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenPayByMailConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentApplePayConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenApplePayConfigProvider::CODE</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGooglePayConfig" type="Magento\Payment\Gateway\Config\Config">
        <arguments>
            <argument name="methodCode" xsi:type="const">Adyen\Payment\Model\Ui\AdyenGooglePayConfigProvider::CODE</argument>
        </arguments>
    </virtualType>


    <!-- Commands infrastructure -->
    <virtualType name="AdyenPaymentCcCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentCcAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="vault_authorize" xsi:type="string">AdyenPaymentCcVaultAuthorizeCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- Command managers section for Vault -->
    <virtualType name="AdyenPaymentCcCommandManager" type="Magento\Payment\Gateway\Command\CommandManager">
        <arguments>
            <argument name="commandPool" xsi:type="object">AdyenPaymentCcCommandPool</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Payment\Gateway\Command\CommandManagerPool">
        <arguments>
            <argument name="executors" xsi:type="array">
                <item name="adyen_cc" xsi:type="string">AdyenPaymentCcCommandManager</item>
                <item name="adyen_google_pay" xsi:type="string">AdyenPaymentCcCommandManager</item>
            </argument>
        </arguments>
    </type>

    <virtualType name="AdyenPaymentOneclickCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentOneclickAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentCcVaultAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentCcVaultAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionAuthorization
            </argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCcVaultResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentHppCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="initialize" xsi:type="string">AdyenPaymentHppAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentBoletoCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentBoletoAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentPosCloudAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPayByMailCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="initialize" xsi:type="string">Adyen\Payment\Gateway\Command\PayByMailCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentApplePayCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentApplePayAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentGooglePayCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="authorize" xsi:type="string">AdyenPaymentGooglePayAuthorizeCommand</item>
                <item name="capture" xsi:type="string">AdyenPaymentCaptureCommand</item>
                <item name="void" xsi:type="string">AdyenPaymentCancelCommand</item>
                <item name="refund" xsi:type="string">AdyenPaymentRefundCommand</item>
                <item name="cancel" xsi:type="string">AdyenPaymentCancelCommand</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- Authorization command  -->
    <virtualType name="AdyenPaymentCcAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentCcAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCcResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentOneclickAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentOneclickAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCcResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentHppAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentHppAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCcResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentBoletoAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentBoletoAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentBoletoResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentPosCloudAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPosCloudSync</argument>
            <argument name="validator" xsi:type="object">PosCloudResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentPosCloudResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentApplePayAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentApplePayAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentGooglePayAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentGooglePayAuthorizeRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionPayment</argument>
            <argument name="validator" xsi:type="object">CheckoutResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentGooglePayResponseHandlerComposite</argument>
        </arguments>
    </virtualType>

    <!-- Capture command  -->
    <virtualType name="AdyenPaymentCaptureCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentCaptureRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionCapture</argument>
            <argument name="validator" xsi:type="object">Adyen\Payment\Gateway\Validator\CaptureResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCaptureResponseHandlerComposite</argument>
        </arguments>
    </virtualType>
    <!--Refund command-->
    <virtualType name="AdyenPaymentRefundCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentRefundRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionRefund</argument>
            <argument name="validator" xsi:type="object">Adyen\Payment\Gateway\Validator\RefundResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentRefundResponseHandlerComposite</argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCancelCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
        <arguments>
            <argument name="requestBuilder" xsi:type="object">AdyenPaymentCancelRequest</argument>
            <argument name="transferFactory" xsi:type="object">Adyen\Payment\Gateway\Http\TransferFactory</argument>
            <argument name="client" xsi:type="object">Adyen\Payment\Gateway\Http\Client\TransactionCancel</argument>
            <argument name="validator" xsi:type="object">Adyen\Payment\Gateway\Validator\CancelResponseValidator</argument>
            <argument name="handler" xsi:type="object">AdyenPaymentCancelResponseHandlerComposite</argument>
        </arguments>
    </virtualType>


    <!-- Authorization Request -->
    <virtualType name="AdyenPaymentCcAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
                <item name="vault" xsi:type="string">Adyen\Payment\Gateway\Request\VaultDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>


    <virtualType name="AdyenPaymentCcVaultAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">
                    Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder
                </item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringVaultDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentCcVaultResponseHandlerComposite"
                 type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">
                    Adyen\Payment\Gateway\Response\PaymentAuthorisationDetailsHandler
                </item>
                <item name="payment_comments" xsi:type="string">
                    Adyen\Payment\Gateway\Response\PaymentCommentHistoryHandler
                </item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentOneclickAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
                <item name="oneclick" xsi:type="string">Adyen\Payment\Gateway\Request\OneclickAuthorizationDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentHppAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentBoletoAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>

            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="poscloud" xsi:type="string">Adyen\Payment\Gateway\Request\PosCloudBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentApplePayAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\ApplePayAuthorizationDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentGooglePayAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="customer" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerDataBuilder</item>
                <item name="customerip" xsi:type="string">Adyen\Payment\Gateway\Request\CustomerIpDataBuilder</item>
                <item name="address" xsi:type="string">Adyen\Payment\Gateway\Request\AddressDataBuilder</item>
                <item name="payment" xsi:type="string">Adyen\Payment\Gateway\Request\PaymentDataBuilder</item>
                <item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
                <item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\GooglePayAuthorizationDataBuilder</item>
                <item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- Capture Request -->
    <virtualType name="AdyenPaymentCaptureRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="capture" xsi:type="string">Adyen\Payment\Gateway\Request\CaptureDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>
    <!-- Refund Request -->
    <virtualType name="AdyenPaymentRefundRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <!--<item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>-->
                <item name="refund" xsi:type="string">Adyen\Payment\Gateway\Request\RefundDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>
    <!-- Cancel Request -->
    <virtualType name="AdyenPaymentCancelRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
        <arguments>
            <argument name="builders" xsi:type="array">
                <item name="merchantaccount" xsi:type="string">Adyen\Payment\Gateway\Request\MerchantAccountDataBuilder</item>
                <item name="cancel" xsi:type="string">Adyen\Payment\Gateway\Request\CancelDataBuilder</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- Response handlers -->
    <virtualType name="AdyenPaymentCcResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentsDetailsHandler</item>
                <item name="vault_details" xsi:type="string">Adyen\Payment\Gateway\Response\VaultDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentBoletoResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentsDetailsHandler</item>
                <item name="vault_details" xsi:type="string">Adyen\Payment\Gateway\Response\VaultDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentGooglePayResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentsDetailsHandler</item>
                <item name="vault_details" xsi:type="string">Adyen\Payment\Gateway\Response\VaultDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\CheckoutPaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentPosCloudHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="payment_details" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentAuthorisationDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentCaptureResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="capture" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCaptureDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentRefundResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="capture" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentRefundDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCommentHistoryRefundHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPaymentCancelResponseHandlerComposite" type="Magento\Payment\Gateway\Response\HandlerChain">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="cancel" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCancelDetailsHandler</item>
                <item name="payment_comments" xsi:type="string">Adyen\Payment\Gateway\Response\PaymentCommentHistoryHandler</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- Value validators infrastructure -->
    <virtualType name="AdyenPaymentCcValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenCcCountryValidator</item>
                <item name="global" xsi:type="string">Adyen\Payment\Gateway\Validator\InstallmentValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenCcCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentCcConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentOneclickValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenOneclickCountryValidator</item>
                <item name="global" xsi:type="string">Adyen\Payment\Gateway\Validator\InstallmentValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenOneclickCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentOneclickConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentHppValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenHppCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenHppCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentHppConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentBoletoValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenBoletoCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenBoletoCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentBoletoConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPosCloudValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenPosCloudCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPosCloudCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentPosCloudConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentPayByMailValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenPayByMailCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenPayByMailCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentPayByMailConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentApplePayValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenApplePayCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenApplePayCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentApplePayConfig</argument>
        </arguments>
    </virtualType>

    <virtualType name="AdyenPaymentGooglePayValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="country" xsi:type="string">AdyenGooglePayCountryValidator</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AdyenGooglePayCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
        <arguments>
            <argument name="config" xsi:type="object">AdyenPaymentGooglePayConfig</argument>
        </arguments>
    </virtualType>

    <!--Checkout Response validator-->
    <virtualType name="CheckoutResponseValidator" type="Adyen\Payment\Gateway\Validator\CheckoutResponseValidator">
        <arguments>
            <argument name="loggerInterface" xsi:type="object">Adyen\Payment\Logger\AdyenLogger</argument>
        </arguments>
    </virtualType>

    <virtualType name="PosCloudResponseValidator" type="Adyen\Payment\Gateway\Validator\PosCloudResponseValidator">
        <arguments>
            <argument name="loggerInterface" xsi:type="object">Adyen\Payment\Logger\AdyenLogger</argument>
        </arguments>
    </virtualType>

    <preference for="Magento\Paypal\Model\Billing\Agreement" type="Adyen\Payment\Model\Billing\Agreement" />
    <preference for="Magento\Payment\Gateway\Data\Order\AddressAdapter" type="Adyen\Payment\Gateway\Data\Order\AddressAdapter"/>
    <type name="Adyen\Payment\Logger\Handler\AdyenDebug">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\Handler\AdyenNotification">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\Handler\AdyenResult">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\Handler\AdyenCronjob">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\Handler\AdyenInfo">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\Handler\AdyenError">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Logger\AdyenLogger">
        <arguments>
            <argument name="name" xsi:type="string">AdyenLoggerTest</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="adyenDebug" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenDebug</item>
                <item name="adyenNotification" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenNotification</item>
                <item name="adyenResult" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenResult</item>
                <item name="adyenCronjob" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenCronjob</item>
                <item name="adyenInfo" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenInfo</item>
                <item name="adyenError" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenError</item>
                <item name="system" xsi:type="object">Magento\Framework\Logger\Handler\System</item>
                <item name="debug" xsi:type="object">Magento\Framework\Logger\Handler\Debug</item>
            </argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Config\Reader">
        <arguments>
            <argument name="fileName" xsi:type="string">adyen_payment.xml</argument>
            <argument name="converter" xsi:type="object">Adyen\Payment\Model\Config\Converter</argument>
            <argument name="schemaLocator" xsi:type="object">Adyen\Payment\Model\Config\SchemaLocator</argument>
        </arguments>
    </type>

    <virtualType name="adyenPaymentConfigDataStorage" type="Magento\Framework\Config\Data">
        <arguments>
            <argument name="reader" xsi:type="object">Adyen\Payment\Model\Config\Reader</argument>
            <argument name="cacheId" xsi:type="string">adyen_payment_config</argument>
        </arguments>
    </virtualType>
    <type name="Adyen\Payment\Helper\Data">
        <arguments>
            <argument name="dataStorage" xsi:type="object">adyenPaymentConfigDataStorage</argument>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Config\Backend\Installments">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Config\Backend\InstallmentsPosCloud">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Gateway\Validator\InstallmentValidator">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Ui\AdyenCcConfigProvider">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Model\Cron">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>
    <type name="Adyen\Payment\Controller\Process\Json">
        <arguments>
            <argument name="serializer" xsi:type="object">Magento\Framework\Serialize\Serializer\Serialize</argument>
        </arguments>
    </type>

    <preference for="Adyen\Payment\Api\GuestAdyenPaymentMethodManagementInterface"
                type="Adyen\Payment\Model\GuestAdyenPaymentMethodManagement"/>
    <preference for="Adyen\Payment\Api\AdyenPaymentMethodManagementInterface"
                type="Adyen\Payment\Model\AdyenPaymentMethodManagement"/>
    <preference for="Adyen\Payment\Api\AdyenRequestMerchantSessionInterface"
                type="Adyen\Payment\Model\AdyenRequestMerchantSession"/>
    <preference for="Adyen\Payment\Api\AdyenInitiateTerminalApiInterface"
                type="Adyen\Payment\Model\AdyenInitiateTerminalApi"/>
    <preference for="Adyen\Payment\Api\AdyenPaymentDetailsInterface"
                type="Adyen\Payment\Model\AdyenPaymentDetails"/>
    <preference for="Adyen\Payment\Api\AdyenOriginKeyInterface"
                type="Adyen\Payment\Model\AdyenOriginKey"/>
    <preference for="Adyen\Payment\Api\AdyenOrderPaymentStatusInterface"
                type="Adyen\Payment\Model\AdyenOrderPaymentStatus"/>
    <type name="Magento\Vault\Api\PaymentTokenRepositoryInterface">
        <plugin name="AdyenPaymentVaultDeleteToken" type="Adyen\Payment\Plugin\PaymentVaultDeleteToken" sortOrder="10"/>
    </type>
    <type name="Magento\Checkout\Api\PaymentInformationManagementInterface">
        <plugin name="AdyenPaymentInformationResetOrderId" type="Adyen\Payment\Plugin\PaymentInformationResetOrderId"
                sortOrder="10"/>
    </type>
    <type name="Magento\Checkout\Api\GuestPaymentInformationManagementInterface">
        <plugin name="GuestAdyenPaymentInformationResetOrderId" type="Adyen\Payment\Plugin\GuestPaymentInformationResetOrderId"
                sortOrder="10"/>
    </type>
    <type name="Magento\Framework\Session\SessionStartChecker">
        <plugin name="AdyenTransparentSessionChecker" type="Adyen\Payment\Plugin\TransparentSessionChecker" sortOrder="10"/>
    </type>
    <!--Notifications overview-->
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="adyen_notifications_overview_data_source" xsi:type="string">Adyen\Payment\Model\ResourceModel\Notification\UiComponentCollection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="Adyen\Payment\Model\ResourceModel\Notification\UiComponentCollection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">adyen_notification</argument>
            <argument name="resourceModel" xsi:type="string">Adyen\Payment\Model\ResourceModel\Notification</argument>
        </arguments>
    </virtualType>

    <!--Sensitive and system-specific configuration-->
    <type name="Magento\Config\Model\Config\TypePool">
        <arguments>
            <argument name="environment" xsi:type="array">
                <item name="payment/adyen_abstract/demo_mode" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/debug" xsi:type="string">1</item>
                <item name="payment/adyen_apple_pay/full_path_location_pem_file_test" xsi:type="string">1</item>
                <item name="payment/adyen_apple_pay/full_path_location_pem_file_live" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notifications_ip_check" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notifications_hmac_check" xsi:type="string">1</item>
            </argument>
            <argument name="sensitive" xsi:type="array">
                <item name="payment/adyen_abstract/merchant_account" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/api_key_test" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/api_key_live" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notification_username" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notification_password" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/live_endpoint_url_prefix" xsi:type="string">1</item>
                <item name="payment/adyen_pos_cloud/pos_merchant_account" xsi:type="string">1</item>
                <item name="payment/adyen_pos_cloud/api_key_test" xsi:type="string">1</item>
                <item name="payment/adyen_pos_cloud/api_key_live" xsi:type="string">1</item>
                <item name="payment/adyen_pos_cloud/pos_store_id" xsi:type="string">1</item>
                <item name="payment/adyen_pay_by_mail/skin_code" xsi:type="string">1</item>
                <item name="payment/adyen_pay_by_mail/hmac_test" xsi:type="string">1</item>
                <item name="payment/adyen_pay_by_mail/hmac_live" xsi:type="string">1</item>
                <item name="payment/adyen_apple_pay/merchant_identifier_test" xsi:type="string">1</item>
                <item name="payment/adyen_apple_pay/merchant_identifier_live" xsi:type="string">1</item>
                <item name="payment/adyen_google_pay/merchant_identifier" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notification_hmac_key_test" xsi:type="string">1</item>
                <item name="payment/adyen_abstract/notification_hmac_key_live" xsi:type="string">1</item>
            </argument>
        </arguments>
    </type>
</config>
