<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
  <system>
    <section id="payment">
      <group id="satispay" translate="label comment" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
        <label>Satispay</label>
        <comment>Satispay is mobile payment platform, independent from debit and credit card networks, usable by anybody with a bank account, acceptable by any merchants using any kind of devices and POS.</comment>
        <fieldset_css>complex satispay-section</fieldset_css>
        <frontend_model>Satispay\Satispay\Block\Adminhtml\System\Config\Fieldset</frontend_model>
        <attribute type="displayIn">recommended_solutions</attribute>

        <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Enabled</label>
          <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
        </field>
        <field id="title" translate="label" type="text" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Title</label>
        </field>

        <field id="sandbox_key_id" translate="label" type="hidden" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Sandbox Key ID</label>
          <frontend_model>Satispay\Satispay\Block\Adminhtml\System\Config\Hidden</frontend_model>
          <depends>
            <field id="sandbox">1</field>
          </depends>
        </field>
        <field id="key_id" translate="label" type="hidden" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Key ID</label>
          <frontend_model>Satispay\Satispay\Block\Adminhtml\System\Config\Hidden</frontend_model>
          <depends>
            <field id="sandbox">0</field>
          </depends>
        </field>

        <field id="sandbox" translate="label" type="select" sortOrder="14" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Sandbox</label>
          <comment>
            <![CDATA[Set this to "Yes" to test payments - Please note: A <a href="https://satispay-sandbox.paperform.co/" target="_blank">Sandbox</a> account is required for this option]]>
          </comment>
          <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
        </field>

        <field id="activation_code" translate="button_label attribute" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="0">
          <attribute type="button_label">Configure with an Activation Code</attribute>
          <attribute type="sandbox">0</attribute>
          <frontend_model>Satispay\Satispay\Block\Adminhtml\System\Config\ActivationCode</frontend_model>
          <depends>
            <field id="active">1</field>
            <field id="sandbox">0</field>
          </depends>
        </field>
        <field id="sandbox_activation_code" translate="button_label attribute" sortOrder="17" showInDefault="1" showInWebsite="1" showInStore="0">
          <attribute type="button_label">Configure with a Sandbox Activation Code</attribute>
          <attribute type="sandbox">1</attribute>
          <frontend_model>Satispay\Satispay\Block\Adminhtml\System\Config\ActivationCode</frontend_model>
          <depends>
            <field id="active">1</field>
            <field id="sandbox">1</field>
          </depends>
        </field>

        <field id="finalize_unhandled_transactions" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Cron to finalize unhandled payments</label>
          <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
          <depends>
            <field id="active">1</field>
          </depends>
        </field>
        <field id="finalize_max_hours" translate="label" type="text" sortOrder="55" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Finalize all orders updated since</label>
          <comment>Choose a number of hours, default is four minimum is one</comment>
          <validate>validate-digits validate-digits-range digits-range-1-65535</validate>
          <depends>
            <field id="active">1</field>
          </depends>
        </field>

        <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Sort Order</label>
          <frontend_class>validate-number</frontend_class>
        </field>
      </group>
    </section>
  </system>
</config>
