<?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>
 */
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
    <group id="adyen_cc" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
        <label><![CDATA[CreditCard API integration]]></label>
        <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
        <fieldset_css>adyen-method-adyen-cc</fieldset_css>
        <comment>Process creditcard payments inside your checkout.</comment>
        <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Enabled</label>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <config_path>payment/adyen_cc/active</config_path>
        </field>
        <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Title</label>
            <config_path>payment/adyen_cc/title</config_path>
        </field>
        <field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Sort Order</label>
            <frontend_class>validate-number</frontend_class>
            <config_path>payment/adyen_cc/sort_order</config_path>
        </field>
        <field id="cctypes" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Credit Card Types</label>
            <source_model>Adyen\Payment\Model\Config\Source\CcType</source_model>
            <config_path>payment/adyen_cc/cctypes</config_path>
        </field>
        <field id="cse_library_token_test" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Library token of Test Adyen Web Service User</label>
            <tooltip>Copy this from the Test Adyen Customer Area => Settings => Users => System => [web service user]=> Library token.</tooltip>
            <config_path>payment/adyen_cc/cse_library_token_test</config_path>
        </field>
        <field id="cse_library_token_live" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Library token of Live Adyen Web Service User</label>
            <tooltip>Copy this from the Live Adyen Customer Area => Settings => Users => System => [web service user]=> Library token.</tooltip>
            <config_path>payment/adyen_cc/cse_library_token_live</config_path>
        </field>

        <group id="adyen_cc_advanced_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="150">
            <label>Advanced Settings</label>
            <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
            <field id="enable_moto" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enable MOTO</label>
                <tooltip><![CDATA[Important you have to activate MOTO for your account contact magento@adyen.com.]]></tooltip>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                <config_path>payment/adyen_cc/enable_moto</config_path>
            </field>
            <field id="enable_installments" translate="label" type="select" sortOrder="219" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enable Installments</label>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                <tooltip>Enable installments for each credit card type.</tooltip>
                <config_path>payment/adyen_cc/enable_installments</config_path>
            </field>
            <field id="installments" translate="label" sortOrder="220" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Installments</label>
                <depends><field id="enable_installments">1</field></depends>
                <tooltip>Configure your installment for each credit card type: Insert the minimum amount required to make the configured installment available in the amount range column.
                    Example: if the amount range is configured to 100 and the number of installments to 4x, the shopper will see the 4x option only if the payment total is higher or equal than 100.</tooltip>
                <frontend_model>Adyen\Payment\Block\Adminhtml\System\Config\Field\Installments</frontend_model>
                <backend_model>Adyen\Payment\Model\Config\Backend\Installments</backend_model>
                <config_path>payment/adyen_cc/installments</config_path>
            </field>
        </group>

        <group id="adyen_cc_country_specific" translate="label" showInDefault="1" showInWebsite="1" sortOrder="200">
            <label>Country Specific Settings</label>
            <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
            <field id="allowspecific" translate="label" type="allowspecific" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Payment from Applicable Countries</label>
                <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
                <config_path>payment/adyen_cc/allowspecific</config_path>
            </field>
            <field id="specificcountry" translate="label" type="multiselect" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Payment from Specific Countries</label>
                <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                <can_be_empty>1</can_be_empty>
                <config_path>payment/adyen_cc/specificcountry</config_path>
            </field>
        </group>
    </group>
</include>