<?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_required_settings" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
        <label><![CDATA[Required Settings]]></label>
        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
        <field id="merchant_account" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Merchant Account</label>
            <config_path>payment/adyen_abstract/merchant_account</config_path>
            <tooltip><![CDATA[The merchant account identifier you want to process the (transaction) request with. Find this at the top of the screen in the Adyen Customer Area, where you will see [YourCompanyAccount] > [YourMerchantAccount] . Please note that the merchant account is different from the company account; a company account can have one or more merchant accounts.]]></tooltip>
            <comment><![CDATA[<a target="_blank" href="https://docs.adyen.com/developers/plugins/magento-2/set-up-the-plugin-in-magento#step3configuretheplugininmagento">Click here for explanation.</a>]]></comment>
        </field>
        <field id="demo_mode" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Test/Production Mode</label>
            <source_model>Adyen\Payment\Model\Config\Source\DemoMode</source_model>
            <config_path>payment/adyen_abstract/demo_mode</config_path>
            <tooltip><![CDATA[ In the test mode you must use test cards. See section Documentation & Support for the link to the test cards]]></tooltip>
        </field>
        <field id="notification_username" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Notification User Name</label>
            <config_path>payment/adyen_abstract/notification_username</config_path>
            <tooltip>Set a user name of your choice here and copy it over to Adyen Customer Area => Settings => Server Communication => Standard Notification => User Name.</tooltip>
        </field>
        <field id="notification_password" translate="label" type="obscure" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Notification Password</label>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/adyen_abstract/notification_password</config_path>
            <tooltip>Set a password of your choice and copy it over to Adyen Customer Area => Settings => Server Communication => Standard Notification => Password.</tooltip>
        </field>
        <field id="api_key_test" translate="label" type="obscure" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>API key for Test</label>
            <tooltip>If you don't know your Api-Key, log in to your Test Customer Area. Navigate to Settings > Users > System, and click on your webservice user, normally this will be ws@Company.YourCompanyAccount. Under Checkout token is your API Key.</tooltip>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/adyen_abstract/api_key_test</config_path>
            <comment model="Adyen\Payment\Model\Comment\ApiKeyEnding" />
        </field>
        <field id="api_key_live" translate="label" type="obscure" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>API key for Live</label>
            <tooltip>If you don't know your Api-Key, log in to your Live Customer Area. Navigate to Settings > Users > System, and click on your webservice user, normally this will be ws@Company.YourCompanyAccount. Under Checkout token is your API Key.</tooltip>
            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
            <config_path>payment/adyen_abstract/api_key_live</config_path>
            <comment model="Adyen\Payment\Model\Comment\ApiKeyEnding" />
        </field>
        <field id="live_endpoint_url_prefix" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Live endpoint prefix</label>
            <tooltip><![CDATA[e.g. if your live endpoint is: <br/> <i>https://1234a567bcd89ef0-MagentoCompany-checkout-live.adyenpayments.com</i> <br/> please type:  <strong>1234a567bcd89ef0-MagentoCompany</strong> in this field.]]></tooltip>
            <comment><![CDATA[Provide the unique live url prefix: <strong>[random]-[company name]</strong> from the "API URLs and Response" menu in the Adyen Customer Area. For more information, please check <a href="https://docs.adyen.com/developers/development-resources/live-endpoints#checkoutendpoints">  our documentation</a>.]]></comment>
            <config_path>payment/adyen_abstract/live_endpoint_url_prefix</config_path>
        </field>

        <field id="capture_mode" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Capture Delay</label>
            <tooltip>Immediate is the default. Set to manual if you want to perform the capture of funds manually later (only affects credit cards and a few alternative payment methods). You need to change this setting as well in Adyen Customer Area => Settings => Merchant Settings => Capture Delay. If you have selected a capture delay of a couple of days in Adyen keep it here on immediate</tooltip>
            <source_model>Adyen\Payment\Model\Config\Source\CaptureMode</source_model>
            <config_path>payment/adyen_abstract/capture_mode</config_path>
        </field>
        <field id="order_status" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Order status: order creation</label>
            <tooltip>Status given to newly created orders before payment result confirmation via server notifications from Adyen.</tooltip>
            <source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
            <config_path>payment/adyen_abstract/order_status</config_path>
        </field>
        <field id="payment_pre_authorized" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Order status: payment authorisation</label>
            <tooltip>Status given to orders after authorisation confirmed by an AUTHORISATION notification from Adyen. Note: an authorisation status via the result URL does not yet trigger this status.</tooltip>
            <source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model>
            <config_path>payment/adyen_abstract/payment_pre_authorized</config_path>
        </field>
        <field id="payment_authorized" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Order status: payment confirmed</label>
            <tooltip>Status given to orders after capture result is confirmed by an AUTHORISATION notification (if capture mode = immediate) or a CAPTURE notification (if capture mode = manual capture) from Adyen.</tooltip>
            <source_model>Magento\Sales\Model\Config\Source\Order\Status\Processing</source_model>
            <config_path>payment/adyen_abstract/payment_authorized</config_path>
        </field>
        <field id="payment_cancelled" translate="label" type="select" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Order status: order cancellation</label>
            <tooltip>Status given to orders after order cancellation is confirmed by a CANCEL_OR_REFUND notification from Adyen. If orders are already invoiced, they cannot be cancelled, but will be refunded instead.</tooltip>
            <source_model>Adyen\Payment\Model\Config\Source\Cancelled</source_model>
            <config_path>payment/adyen_abstract/payment_cancelled</config_path>
        </field>
        <field id="debug" translate="label" type="select" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Enable debug logging</label>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <config_path>payment/adyen_abstract/debug</config_path>
        </field>
    </group>
</include>
