2
    <?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="worldpaydirect" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Custom Payment</label>
                    <field id="active" translate="label comment" sortOrder="1" type="select" showInDefault="1" showInWebsite="1" showInStore="0">
                        <label>Enable</label>
                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    </field>
                </group>
        </section>
    </system>
</config> 

Admin: https://prnt.sc/mgtna4

In above screenshot custom Payment is not appear in stores>configuration>sales>payment methods

10
  • check with clear cache Feb 5 '19 at 9:34
  • i was tried it already nothing happens Feb 5 '19 at 9:36
  • @divyasekar Please check your 'var/log/system.xml' and 'exception.log' file and there is any error or warning log related to this Feb 5 '19 at 9:44
  • @divyasekar you can try my code Feb 5 '19 at 9:51
  • 1
    Means remove space OR file path is right etc. LIKE from ' <space> <?xml version="1.0"?>' TO '<?xml version="1.0"?>' check system.xml file Feb 5 '19 at 10:21
2

Please remove space before the xml TAG. check below code.

<?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="worldpaydirect" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Custom Payment</label>
                        <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                            <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                        </field>
                    </group>
            </section>
        </system>
    </config>

Then run this command

php bin/magento cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.