Jump to content
bramwolf

Need help installing Mollie module with composer vendor files

Recommended Posts

Hey Guys,

I've been trying to install the Mollie-Payment module for apeisa's PaymentModule, but apparently I cannot get it to work without Composer. 
I've have no real clue of what it is or does, everything written about it confused me a complete 100% and I don't know how to install it.

Could someone please give me some basic stept as to how to install this fucking thing onto my existing Processwire install? 😞 

Any help would be greatly appreciated!

 

Share this post


Link to post
Share on other sites

Actually it's this one: https://modules.processwire.com/modules/payment-mollie/
I think it has been adjusted from the original a bit to work with Padloper.
I tried installing it manually but Processwire gives me the Error that the module "PaymentModule" which
is needed by the module mentioned above can't be found, even though it is installed.

As for composer. I think I can download the installer file and run it with some commands from a shell connection,
however I don't even know where to put this without breaking the site. Site/modules seems the obvious place to put
it but that will result in Processwire always showing it in the modules to be installed page? Or maybe i'm completely wrong..

Share this post


Link to post
Share on other sites
54 minutes ago, bramwolf said:

Processwire gives me the Error that the module "PaymentModule" which
is needed by the module mentioned above can't be found, even though it is installed.

It might be a dumb question, but since the dependency check that gives the message is a core function reliably used by many modules, are you sure PaymentModule is really installed (i.e. showing up in "Modules" -> "Site" in the backend)?

Share this post


Link to post
Share on other sites

Yes 🙂 most definitely. I'm pretty used to all things processwire, but not at all to shell commands and composer thingies 🙂

however the error does mention that it can't find the module within the path of PaymentMollie, totally lost as to why this might be the case. 

Share this post


Link to post
Share on other sites

Sounds like your issue is in fact with the ProcessWire module. But if you need help integrating the Mollie SDK, I wrote a tutorial on setting up Composer with ProcessWire, this includes how to initialize a Composer project, require (i.e. install) third-party dependendencies and connect the autoloader. If you're having problems with the setup, let me know in the comments and I'll try to answer 🙂

2 hours ago, bramwolf said:

As for composer. I think I can download the installer file and run it with some commands from a shell connection,
however I don't even know where to put this without breaking the site. Site/modules seems the obvious place to put
it but that will result in Processwire always showing it in the modules to be installed page? Or maybe i'm completely wrong..

A good place to install the libraries is one directory above the webroot. since you don't want individual files of external libraries to be publicly accessible (since this opens up quite a lot of security issues). My tutorial includes an explanation of the directory structure I would recommend.

  • Like 1

Share this post


Link to post
Share on other sites

@MoritzLost thanks for your offer! 🙂 However, i'm not planning on reinstalling Processwire inside composer, and also I don't need composer for anything other than this module so I decided to bedug the adapted PaymentMollie module instead and use prepackaged files provided by the original Mollie package from github.

So to be clear, I'm trying to install this module ( Mollie compatible with Padloper )

https://github.com/Typografics/PaymentMollie-PW3

With the composer vendor files from this package ( The original Mollie api )
https://github.com/mollie/mollie-api-php


The error I get after upload the files and going to the "Install Module" page is this:
 

Fatal Error: Uncaught Error: Class 'ProcessWire\PaymentModule' not found in /customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie/PaymentMollie.module:7
Stack trace:
#0 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/core/Modules.php(1545): include_once()
#1 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/core/Modules.php(2842): ProcessWire\Modules->includeModuleFile('/customers/a/4/...', 'PaymentMollie')
#2 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/core/Modules.php(3023): ProcessWire\Modules->getModuleInfo('PaymentMollie', Array)
#3 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/modules/Process/ProcessModule/ProcessModule.module(380): ProcessWire\Modules->getModuleInfoVerbose('PaymentMollie')
#4 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/modules/Process/ProcessModule/ProcessModule.module(343): ProcessWire\ProcessModule->renderList()
#5 /customers/a/4/3/big-in-fabric.com/httpd.www/wire/core/Wire.php(380): ProcessWire\ProcessModule->___execute()
#6 /customers/a/4/3/big-in-fabric.com/ (line 7 of /customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie/PaymentMollie.module) 

This error message was shown because: you are logged in as a Superuser. Error has been logged.

I have the PaymentModule installed and am using version 3.0.123 of Processwire, the module requires version 3.0.90 at least.

This is the start of the PaymentMollie.module file:
 

<?php namespace ProcessWire;

// Here you can find more information about the Mollie php api https://github.com/mollie/mollie-api-php

require_once __DIR__ . "/vendor/autoload.php";

class PaymentMollie extends PaymentModule
{

    public static function getModuleInfo()
    {
        return array(
            'title' => 'PaymentMollie',
            'version' => '0.0.2',
            'summary' => 'Mollie Payment method',
            'singular' => false,
            'autoload' => false,
            'requires' => 'ProcessWire>=3.0.90, PaymentModule',
        );
    }


Anybody had any clues? 🙂 thanks again


 

Share this post


Link to post
Share on other sites

Any change if you use the version from the PW3 branch in the github repo for PaymentModule (which is basically the same with the namespace added)?

  • Like 2

Share this post


Link to post
Share on other sites

Maybe I'm being obvious,  but have you tried running the shell command "composer require" on the root the module (site/modules/PaymentMollie)?  Like this:

composer require mollie/mollie-api-php

EDIT: Fixed for correctness, thanks @MoritzLost

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, elabx said:

Maybe I'm being obvious,  but have you tried running the shell command "composer install" on the root of your processwire site? Like this:


composer install mollie/mollie-api-php

 

This won't work, you need to use the require command to add dependencies to your project. This will add the dependency to your composer.json and download it. The install command is used to read the composer.lock file and download all the dependencies listed in there, as well as update the autoloader. This is why install doesn't take a library as an argument.

@bramwolf Pretty sure that BitPoet is right. That error indicates that the class ProcessWire\PaymentModule doesn't exist. If you installed the PaymentModule through the backend or downloaded it from the module page, you would get the master branch, which doesn't have the correct namespace. So this version of the module would have the \PaymentModule class inside the root namespace, but not inside the Processwire namespace (which is what the PaymentMollie module tries to extend). Install the PW3 branch and you should be fine.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/1/2019 at 7:50 PM, MoritzLost said:

@bramwolf Pretty sure that BitPoet is right. That error indicates that the class ProcessWire\PaymentModule doesn't exist. If you installed the PaymentModule through the backend or downloaded it from the module page, you would get the master branch, which doesn't have the correct namespace. So this version of the module would have the \PaymentModule class inside the root namespace, but not inside the Processwire namespace (which is what the PaymentMollie module tries to extend). Install the PW3 branch and you should be fine.

Crazy!! 🙂  You fixed my problem ^_^ First, I just updated to already installed files of PaymentModule and PaymentInvoice to the PW3 versions, which crashed everything 🙂 Than uninstalled both modules, updated the files and reinstalled them. Afterwards, I installed the MollieModule and now it worked fine! 🙂

Thank you so much, now let's see if I can actually get it to work with the vendor files from composer 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Well, here we go again. I was testing to see if the Mollie module works and got this error on the checkout page:

 

Checkout

Warning: include(/customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie-PW3/vendor/composer/../../src/MollieApiClient.php): failed to open stream: No such file or directory in /customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie-PW3/vendor/composer/ClassLoader.php on line 444 Warning: include(): Failed opening '/customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie-PW3/vendor/composer/../../src/MollieApiClient.php' for inclusion (include_path='.:/usr/share/php') in /customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie-PW3/vendor/composer/ClassLoader.php on line 444

I checked to see but the files it is referring to, like:
/customers/a/4/3/big-in-fabric.com/httpd.www/site/modules/PaymentMollie-PW3/vendor/composer/ClassLoader.php

Is actually right there. Any ideas on how to fix that? 🙂 Thanks again guys.

Share this post


Link to post
Share on other sites

Hi @bramwolf, Could you solve the problem?

I also need to integrate a payment module in an existing Processwire installation. Can you share how you did it?

Share this post


Link to post
Share on other sites

Hi Krlos,

I did get it to work in the end! I used the onepagecheckout template found in padloper. I will send you a zip file with all modules en templates of my site needed for this integration you can just copy the Mollie module in it's entirety. Be sure to select it in PaymentModule. Yoiu can check my checkout scripts on how I invoked Mollie. You can copy what you need from my files and stitch your own version of the integration together 🙂 Hope this helps!

Grts,
Bram

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...