The payment provider gateway copied from sample doesn't show in frontend

by Edwin   Last Updated January 19, 2018 11:09 AM

So I have installed the sample gateway and everything works.

Now I've copied the whole project under a new namespace. So, from Magento/SamplePaymentGateway (Magento_SamplePaymentGateway) to IPayment/MyPayment (IPayment_MyPayment) and everywhere where the name or namespace come I've changed that. And in the /etc/di.xml all that startet with SamplePaymentGateway now starts with MyPayment (just to be clear)

Then I've changed all the sample_gateway to my_payment in all files. And the same thing I've done to the js file sample_gateway.js => my_payment.js in the frontend/web/js/view/payment.

Example from view/frontend/layout/checkout_index_index.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="billing-step" xsi:type="array">
                                            <item name="component" xsi:type="string">uiComponent</item>
                                            <item name="children" xsi:type="array">
                                                <item name="payment" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="renders" xsi:type="array">
                                                            <!-- merge payment method renders here -->
                                                            <item name="children" xsi:type="array">
                                                                <item name="my_payment" xsi:type="array">
                                                                    <item name="component" xsi:type="string">IPayment_MyPayment/js/view/payment/my_payment</item>
                                                                    <item name="methods" xsi:type="array">
                                                                        <item name="my_payment" xsi:type="array">
                                                                            <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

The only thing that I've changed is the /etc/adminhtml/system.xml where I've added a group to hold my group payment:

<group id="my_payment_section" sortOrder="30" showInDefault="0" showInWebsite="0" showInStore="0">
            <group id="my_payment" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>MyPayment</label>
                <comment><![CDATA[Some text.]]></comment>
                <fieldset_css>complex my-payment-section</fieldset_css>
                <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
                <attribute type="activity_path">payment/mypayment/active</attribute>
                <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>
                ...

Then I've sucessfuly installed my payment module (from the Web Setup Wizard).

In the admin-backend everything is fine, I can see my configuration, enable it and disable, choose countrie etc. (The configuration is left the same as for the sample_gateway)

The only problme that I've have is that in the frontend I don't see my payment method checkout

After this I also ran: setup:di:compile && setup:static-content:deploy && cache:clean without any success.

Any ideas what can it be?



Related Questions


How to get payment method selected magento 2

Updated November 17, 2017 09:09 AM

Magento 2 disabling payment module bug

Updated December 19, 2017 12:09 PM