We have a module that was written by an external dev a year ago. I was asked to install it to Magento 2.3.5 and verify the functionality of the custom payment method. I've extracted it to /magento/app/code and set the proper owner and permissions.
I did the following commands in the CLI as instructed in the plugin's readme file:
$ php bin/magento setup:upgrade $ php bin/magento setup:static-content:deploy $ php bin/magento cache:flush
The issue is, the payment method does not appear in Stores -> Configuration -> Sales -> Payment Methods. I've tried enabling/disabling the plugin in the CLI, still no luck.
$ php bin/magento module:disable PO_Opi In Dir.php line 51: Module 'PO_Opi' is not correctly registered. $ php bin/magento module:enable No modules were changed. $ php bin/magento module:status PO_Opi Module is enabled
Re-checked Stores -> Configuration -> Sales -> Payment Methods... still no custom payment method.
Here's the contents of code/PO/Opi/registration.php
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'OpenPath_PaymentGateway', __DIR__ );
Solved! Go to Solution.
Hello @denvergazof390 ,
As per default behaviour of Magento modules, the module-name must be Vendor_Module, if your module-name is OpenPath_PaymentGateway then your directory Structure should be :
app/code/OpenPath/PaymentGateway
so changing the directory names should work.
and later you can disable it with
php bin/magento module:disable OpenPath_PaymentGateway
Note 1 : Check the namespace followed in module so change accordingly
Note 2: If you don't want to change folder name and still want to use like that way, then you've to create a composer.json in module folder and change PSR-4 feature inside autoload.
Hello @denvergazof390 ,
As per default behaviour of Magento modules, the module-name must be Vendor_Module, if your module-name is OpenPath_PaymentGateway then your directory Structure should be :
app/code/OpenPath/PaymentGateway
so changing the directory names should work.
and later you can disable it with
php bin/magento module:disable OpenPath_PaymentGateway
Note 1 : Check the namespace followed in module so change accordingly
Note 2: If you don't want to change folder name and still want to use like that way, then you've to create a composer.json in module folder and change PSR-4 feature inside autoload.
Hi @denvergazof390 ,
After you did the changes as mentioned by @gaurav_harsh1
Cross check system.xml file in the
app/code/OpenPath/PaymentGateway/etc/adminhtml
Folder path. In the file check for the tab in which developer added the configurations. For adding new entry in payment methods tab name should be sales.
Hope it helps you.
Problem Solved! Click Kudos & Accept as Solution!
I've changed the module name in registration.php to PO_Opi, and ran the DI compilation. It works now. Thanks for your help @gaurav_harsh1.
You're welcome
Search "OpenPath_PaymentGateway" this keyword in your module and make sure you're not using this keyword as module name anywhere.