<?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="amazon_payment" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Amazon Pay</label>
                <field id="simplepath" type="text" translate="label comment" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <frontend_model>Amazon\Core\Block\Adminhtml\System\Config\Form\SimplepathConfig</frontend_model>
                </field>
                <group id="credentials" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Credentials</label>
                    <field id="merchant_id" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Merchant Id</label>
                        <config_path>payment/amazon_payment/merchant_id</config_path>
                    </field>
                    <field id="access_key" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Access Key Id</label>
                        <config_path>payment/amazon_payment/access_key</config_path>
                    </field>
                    <field id="secret_key" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Secret Access Key</label>
                        <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                        <config_path>payment/amazon_payment/secret_key</config_path>
                    </field>
                    <field id="client_id" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Client Id</label>
                        <config_path>payment/amazon_payment/client_id</config_path>
                    </field>
                    <field id="client_secret" translate="label comment" type="obscure" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Client Secret</label>
                        <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                        <config_path>payment/amazon_payment/client_secret</config_path>
                        <comment><![CDATA[<input type="checkbox" name="amazon_test_creds" id="amazon_test_creds" value="1"><label for="amazon_test_creds">]]><![CDATA[Test Credentials]]><![CDATA[</label>]]></comment>
                    </field>
                    <field id="credentials_json" translate="label" type="textarea" sortOrder="55" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Credentials JSON</label>
                        <config_path>payment/amazon_payment/credentials_json</config_path>
                        <comment><![CDATA[Warning! Individual credential fields will be populated/overwritten, if credentials JSON is supplied!]]></comment>
                    </field>
                    <field id="payment_region" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Payment Region</label>
                        <source_model>Amazon\Core\Model\Config\Source\PaymentRegion</source_model>
                        <config_path>payment/amazon_payment/payment_region</config_path>
                    </field>
                    <field id="sandbox" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
                        <label>Sandbox</label>
                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                        <config_path>payment/amazon_payment/sandbox</config_path>
                    </field>
                    <field id="js_origin" translate="label" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Allowed Javascript Origins</label>
                        <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\JsOrigin</frontend_model>
                    </field>
                    <field id="redirect_url" translate="label" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Allowed Return URLs</label>
                        <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\RedirectUrl</frontend_model>
                    </field>
                    <field id="ipn_url" translate="label" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>IPN URL</label>
                        <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\IpnUrl</frontend_model>
                    </field>
                </group>
                <group id="options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Options</label>
                    <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Enable Amazon Pay</label>
                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                        <config_path>payment/amazon_payment/active</config_path>
                    </field>
                    <field id="lwa_enabled" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Enable Login with Amazon</label>
                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                        <config_path>payment/amazon_payment/lwa_enabled</config_path>
                    </field>
                    <field id="payment_action" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Payment Action</label>
                        <source_model>Amazon\Core\Model\Config\Source\PaymentAction</source_model>
                        <config_path>payment/amazon_payment/payment_action</config_path>
                    </field>
                    <field id="authorization_mode" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Authorization Mode</label>
                        <source_model>Amazon\Core\Model\Config\Source\AuthorizationMode</source_model>
                        <config_path>payment/amazon_payment/authorization_mode</config_path>
                    </field>
                    <field id="update_mechanism" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
                        <label>Update Mechanism</label>
                        <source_model>Amazon\Core\Model\Config\Source\UpdateMechanism</source_model>
                        <config_path>payment/amazon_payment/update_mechanism</config_path>
                    </field>
                </group>
                <group id="advanced" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Advanced</label>
                    <field id="version" type="text" translate="label comment" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
                        <frontend_model>Amazon\Core\Block\Adminhtml\System\Config\Form\Version</frontend_model>
                    </field>
                    <group id="frontend" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Frontend</label>
                        <field id="display_language" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                            <label>Button Display Language</label>
                            <config_path>payment/amazon_payment/button_display_language</config_path>
                            <comment><![CDATA[Controls button and widget language. The default is your shop's locale. Available options can be found <a href="https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER">here</a>. Applies only to UK and DE Amazon Merchant Accounts.]]></comment>
                        </field>
                        <field id="button_color" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Button Color</label>
                            <source_model>Amazon\Core\Model\Config\Source\Button\Color</source_model>
                            <config_path>payment/amazon_payment/button_color</config_path>
                        </field>
                        <field id="button_size" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Button Size</label>
                            <source_model>Amazon\Core\Model\Config\Source\Button\Size</source_model>
                            <config_path>payment/amazon_payment/button_size</config_path>
                        </field>
                        <field id="pwa_pp_button_is_visible" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
                            <label>Amazon Pay button on Product Page</label>
                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                            <config_path>payment/amazon_payment/pwa_pp_button_is_visible</config_path>
                        </field>
                        <field id="minicart_button_is_visible" translate="label comment" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
                            <label>Amazon Pay button in minicart</label>
                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                            <config_path>payment/amazon_payment/minicart_button_is_visible</config_path>
                        </field>
                    </group>
                    <group id="sales_options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Sales Options</label>
                        <field id="storename" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="1">
                            <label>Store Name</label>
                            <config_path>payment/amazon_payment/storename</config_path>
                        </field>
                    </group>
                    <group id="extra_options" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Developer Options</label>
                        <field id="logging" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                            <label>Logging</label>
                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                            <config_path>payment/amazon_payment/logging</config_path>
                        </field>
                        <field id="allowed_ips" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Allowed IPs</label>
                            <comment><![CDATA[Comma separated. The "Login with Amazon" and "Amazon Pay" buttons will <em>only</em> be rendered for clients having the above IPs.
                            If the field is empty, the buttons will be visible to all clients.]]></comment>
                            <config_path>payment/amazon_payment/allowed_ips</config_path>
                            <backend_model>Magento\Developer\Model\Config\Backend\AllowedIps</backend_model>
                        </field>
                    </group>
                </group>
            </group>
        </section>
    </system>
</config>
