mollie / mollie-oxid

Mollie Payments for OXID eSales
7 stars 5 forks source link

The method Mollie\Payment\Core\Events::onActivate is not callable. #15

Closed s1de21 closed 1 year ago

s1de21 commented 1 year ago

I installed the module via composer as the doku said.

i can save settings in my oxid 6.4.3 env.

But when i try to activate it i get this message:

"The method Mollie\Payment\Core\Events::onActivate is not callable."

s1de21 commented 1 year ago

Why is the Composer Install Folder

"/mollie/molliepayment/"

but the psr4 autoload that fetches from the composer.json is at:

    'Mollie\\Payment\\' => array($vendorDir . '/mollie/mollie-oxid'),
    'Mollie\\Api\\' => array($vendorDir . '/mollie/mollie-oxid/lib/mollie-api-php/src'),

This breaks the autoload

FatchipRobert commented 1 year ago

I just took a fresh oxid 6.4.3 installation and installed the module via composer as described in the installation guide.

composer require mollie/mollie-oxid

After that I went to the shop backend and was able to enable the module without a problem. Mollie\Payment\Core\Events::onActivate was called perfectly fine, adding all payment methods to the database.

I installed this module a lot of times and never had problems with the autoloading or the onActivate Event.

For the best results always use the composer version that is bundled to the oxid shop you are currently using like this: vendor/composer/composer/bin/composer require mollie/mollie-oxid

The module folders of oxid can be a bit confusing.

Composer installs the module here: vendor/mollie/mollie-oxid/

and then Oxid copies the module files to this folder too: source/modules/mollie/molliepayment/

These 2 folders having different names is perfectly normal. It's the same as with the core modules, like the Paypal module being found in these folders: vendor/oxid-esales/paypal-module source/modules/oe/oepaypal