Mollie API V2 use for D7 version

Created on 6 November 2024, 5 months ago

Mollie has required to use the V2 version of their API from 1st of january 2025. There's still one Drupal 7 Commerce site that hasn't been migrated to D10 due to the big amount of custom code in in several modules.
Is there anyone using a patch to upgrade the D7 version of this module to use the Mollie API v2?
Any help on this would be great...

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands vincent rommelaars

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @vincent rommelaars
  • 🇧🇪Belgium bramvandenbulcke

    We are in the same boat! Similar request here.

    Maybe noting: we used mollie_payment in our setup but switched to commerce_mollie because there were problems with some payments (visitors abandoning the payment) in combination with the Entity Registration module.

    Switching from mollie_payment to commerce_mollie solved our problem but we also switched from api v2 to api v1!

  • 🇳🇱Netherlands vincent rommelaars

    For this particular use, and for the time being I did a rewrite of the 'commerce_mollie' module to use the Mollie API v2 for use with Drupal 7 Commerce.
    Because I don't know how to write a patch properly, I share the compressed module folder 'commerce_mollie' so anyone who needs it can unzip it in their modules folder as usual.
    The module now uses the Mollie API v2 library which is added in 'mollie-api-php'.
    Unpack this one in your libraries folder and you should be good to go.

    Please use it at your own risk and test it before, since I didn't had time to test it thorough.

  • 🇳🇱Netherlands Nicasso

    Hi @vincent,

    Which exact version of the mollie-api-php is this?

  • 🇳🇱Netherlands vincent rommelaars

    Hi @nicasso,
    Good Question.
    I took the library files from another D7 site with the "mollie_payment" module working which was using the very same library.
    I took a quick look and as you can see in the library files it's version 2.10.0 of the mollie-api-php library.
    So, I didn't update them to the latest version.

    As you can see the latest update should be 2.74.1 and you can update this by running the composer command:
    $ composer require mollie/mollie-api-php:^2.0

    So please give it a try. I assume this should also work.
    But you know what they say about assumtions...

    "Assumption is the mother of all f*ckups" ;)

  • 🇧🇪Belgium vincent@fontaine.online

    Hi @vincent,

    Thanks for the work ! I tested the zip files on our D7 site and it works !
    Though, it was not straightforward : there is a dependency on xautoload missing in the module.
    It took me some time to realize that.
    I attach the zip file with the dependency included

  • 🇳🇱Netherlands vincent rommelaars

    Nice work @vincent_fontaine.
    Didn't checked for that.
    Thanks for the update.

  • 🇧🇪Belgium bramvandenbulcke

    Thanks!

    We are using the version of #6 in production and everything is going well.

  • First commit to issue fork.
  • Merge request !10Issue #3485829: Switch to Mollie API v2 → (Open) created by trafo
  • 🇸🇰Slovakia trafo

    Thanks for all the work!

    I've created issue fork and branch with code changes from #6. Did a bit of clean-up and updated installation steps in readme.

  • Status changed to Needs review 3 months ago
  • 🇳🇱Netherlands ndf Amsterdam

    Module maintainer here.

    Just set the priority to critical.

    Thanks for the patches and the work done!

    With the patches the Mollie-api must be installed with Composer. Composer is not available for many Drupal 7 projects.
    I am not sure if we can install the Mollie-api standalone without Composer. If that is possible, it would be better IMO and we can ship the v2 api with the module code.

    Additionally is there anything else that needs to be reconfigured when moving to v2? For example new api-keys.

    FYI A client sent us this Mollie mail today:

    
    Mollie API V1 zal worden uitgeschakeld
    
    De V1-versie van de Mollie API bereikte zijn einde van de levensduur in juli 2023 en zal volledig worden uitgeschakeld op 31 december 2024.
    
    Alle klanten die nog de Mollie API V1 gebruiken, moeten upgraden naar onze huidige V2-versie. Het wordt sterk aanbevolen om zo snel mogelijk te upgraden om eventuele impact te voorkomen.
    
    Zie onderstaande FAQ voor meer informatie.
    
    Hoe weet ik of ik nog de Mollie API V1 gebruik?
    
     
    
    Elke betaling die via de Mollie API V1 is gedaan, zal een melding hebben in het Mollie Dashboard op de betaling-pagina.
    
     
    
    Hoe upgrade ik naar de Mollie API V2?
    
     
    
    Maakt u gebruik van een platform (zoals een webshop systeem) of een integratie/plugin? Neem dan contact op met de aanbieder. Zij kunnen u helpen om te upgraden naar Mollie API V2.
    
    Als u een directe integratie met de Mollie API heeft, kunt u uw code updaten om de V2 API te gebruiken. Meer informatie over de technische veranderingen tussen V1 en V2 is beschikbaar in onze technische documentatie.
    
  • 🇳🇱Netherlands ndf Amsterdam

    Another question; doesn anyone know there drop-in replacements from other providers? For example PayPal.

    • ndf committed 248c87ce on 7.x-2.x
      Issue #3485829 by vincent_fontaine, vincent rommelaars, nicasso,...
  • 🇳🇱Netherlands ndf Amsterdam

    Thank you all.
    Just merged #10 + #3 in a new release branch 7.x-2.x and a tagged release 7.x-2.0
    Additionally deleted the deprecated V1 API that was shipped with the module.

    Important & Critical Change

    • Added “Libraries” and “X Autoload” as required dependencies
      Previously, these modules were listed in the README as requirements for the Mollie API, but were not strictly enforced. In this release, we have updated the module’s .info file to mark Libraries and X Autoload as hard dependencies. This ensures proper loading of the Mollie API library and avoids errors or missing class autoloading.

    Please ensure you have both Libraries and X Autoload installed and enabled before upgrading to or installing this version.

    https://www.drupal.org/project/commerce_mollie/releases/7.x-2.0

  • 🇳🇱Netherlands ndf Amsterdam
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024