<?xml version="1.0"?>
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
    <group id="credentials" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
        <label>Mercado Pago integration</label>
        <comment><![CDATA[<p>In order to sell or test a store, you must first enter your test and production credentials.</p><p>Using the account of the collaborator with access to Mercado Pago Seller Account, search the credentials according to the account: <a href='https://www.mercadopago.com.ar/settings/account/credentials' target='_blank'>Argentina</a>, <a href='https://www.mercadopago.com.br/settings/account/credentials' target='_blank'>Brazil</a>, <a href='https://www.mercadopago.cl/settings/account/credentials' target='_blank'>Chile</a>, <a href='https://www.mercadopago.com.co/settings/account/credentials' target='_blank'>Colombia</a>, <a href='https://www.mercadopago.com.mx/settings/account/credentials' target='_blank'>Mexico</a>, <a href='https://www.mercadopago.com.uy/settings/account/credentials' target='_blank'>Uruguay</a> and <a href='https://www.mercadopago.com.pe/settings/account/credentials' target='_blank'>Peru</a>.</p>]]></comment>
        <field id="environment" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0">
            <label>Checkout operation mode</label>
            <source_model>MercadoPago\AdbPayment\Model\Adminhtml\Source\Environment</source_model>
            <config_path>payment/mercadopago_adbpayment/environment</config_path>
            <comment>When operational mode is set as Sandbox, your sales will not be communicated to financial institutions.</comment>
            <validate>required-entry validate-select</validate>
        </field>
        <field id="client_id_production" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0">
            <label>Public Key - production</label>
            <config_path>payment/mercadopago_adbpayment/client_id_production</config_path>
            <validate>required-entry</validate>
            <depends>
                <field id="*/*/*/*/environment">production</field>
            </depends>
        </field>
        <field id="client_secret_production" translate="label" type="obscure" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0">
            <label>Access Token - production</label>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/mercadopago_adbpayment/client_secret_production</config_path>
            <validate>required-entry</validate>
            <depends>
                <field id="*/*/*/*/environment">production</field>
            </depends>
        </field>
        <field id="client_id_sandbox" translate="label" type="text" sortOrder="31" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0">
            <label>Public Key - Sandbox</label>
            <config_path>payment/mercadopago_adbpayment/client_id_sandbox</config_path>
            <validate>required-entry</validate>
            <depends>
                <field id="*/*/*/*/environment">sandbox</field>
            </depends>
        </field>
        <field id="client_secret_sandbox" translate="label" type="obscure" sortOrder="32" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="0">
            <label>Access Token - Sandbox</label>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/mercadopago_adbpayment/client_secret_sandbox</config_path>
            <validate>required-entry</validate>
            <depends>
                <field id="*/*/*/*/environment">sandbox</field>
            </depends>
        </field>
    </group>
</include>
