cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

SOLVED

Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

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__
);
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

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.

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

View solution in original post

4 REPLIES 4

Re: Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

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.

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

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! 

Re: Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

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.

Re: Enabling a custom payment method: Module 'PO_Opi' is not correctly registered.

@denvergazof390 

 

You're welcome Smiley Happy
Search "OpenPath_PaymentGateway" this keyword in your module and make sure you're not using this keyword as module name anywhere.

 

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy