<?xml version="1.0"?>
<!--
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Payment module (https://www.adyen.com/)
 *
 * Copyright (c) 2020 Adyen N.V. (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_security" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
        <label><![CDATA[Advanced: Security]]></label>
        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
        <comment>
            <![CDATA[
                <p>
                Enabling these features is strongly recommended to improve the security of your integration.
                </p>
            ]]>
        </comment>
        <field id="notifications_hmac_check" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Check notification's HMAC signature</label>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <config_path>payment/adyen_abstract/notifications_hmac_check</config_path>
            <comment>
                <![CDATA[
                If enabled notifications will be accepted only when the HMAC
                signature is verified. To learn more about these settings refer to
                <a target="_blank" href="https://docs.adyen.com/plugins/magento-2/set-up-the-plugin-in-magento">Adyen documentation</a>.
                ]]>
            </comment>
        </field>
        <field id="notifications_ip_check" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Check notification's IP address</label>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <config_path>payment/adyen_abstract/notifications_ip_check</config_path>
            <comment>
                <![CDATA[
                If enabled notifications will be accepted only when the IP address matches Adyen's servers. To learn more about these settings refer to
                <a target="_blank" href="https://docs.adyen.com/plugins/magento-2/set-up-the-plugin-in-magento">Adyen documentation</a>.
                ]]>
            </comment>
        </field>
        <field id="notification_hmac_key_test" translate="label" type="obscure" sortOrder="30" showInDefault="1"
               showInWebsite="1" showInStore="1">
            <label>HMAC key test</label>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/adyen_abstract/notification_hmac_key_test</config_path>
            <tooltip>
                <![CDATA[
                Set HMAC key at first on Adyen so new notifications are sent with the key. To learn more about these settings refer to
                <a target="_blank" href="https://docs.adyen.com/development-resources/webhooks/verify-hmac-signatures">Adyen documentation</a>.
                ]]>
            </tooltip>
        </field>
        <field id="notification_hmac_key_live" translate="label" type="obscure" sortOrder="40" showInDefault="1"
               showInWebsite="1" showInStore="1">
            <label>HMAC key live</label>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/adyen_abstract/notification_hmac_key_live</config_path>
            <tooltip>
                <![CDATA[
                Set HMAC key at first on Adyen so new notifications are sent with the key. To learn more about these settings refer to
                <a target="_blank" href="https://docs.adyen.com/development-resources/webhooks/verify-hmac-signatures">Adyen documentation</a>.
                ]]>
            </tooltip>
        </field>
    </group>
</include>
