Using PHP 8.1 with JoomDonation products

  • Hilmar Schneider
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 4 months ago #154940 by Hilmar Schneider
Using PHP 8.1 with JoomDonation products was created by Hilmar Schneider
My site is currently using PHP 7.4.33 which is now out of support. Joomla (3.10.11) has been nagging to to switch to PHP 8. My hosting provider offers 8.0 and 8.1. Has Membership Pro (and EDocMan and Event Booking) been tested with PHP 8? Any issues? I can't test it; all I can do is switch the entire site and see what happens.

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #154946 by Mr. Dam
Replied by Mr. Dam on topic Using PHP 8.1 with JoomDonation products
Hi Hilmar,
Our extensions are all compatible with PHP 8.x. You can change PHP versions on your server and test our extensions.
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Hilmar Schneider
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 4 months ago #154992 by Hilmar Schneider
Replied by Hilmar Schneider on topic Using PHP 8.1 with JoomDonation products
Thanks. I did try php 8.0 but there are issues unrelated to Membership Pro. For starters module mysqli needs to be replaced with nd_mysqli. After that change everything seemed to work.

Secondly, module clos_ssa is missing and I get an debug error on every page but it's all working. That's an issue with cPanel and my hosting provider.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 4 months ago #155002 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Using PHP 8.1 with JoomDonation products
OK, happy to know that the issues are not related to our products and you figured out. Just for information, our products works with both PHP 8.0 and PHP 8.1, so if you upgrade to PHP 8.1 in the future, there would be no problem, too

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Hilmar Schneider
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 4 months ago #155317 by Hilmar Schneider
Replied by Hilmar Schneider on topic Using PHP 8.1 with JoomDonation products
I did run into a problem with the payment plugin. I'm using Moneris. When a subscriber attempts to pay they get the error:

Call to a member function getResponseCode() on null

Looking at the file moneris_helper.php, all the classes use an old, now obsolete, constructor with the same name as the class instead of __construct().

For example, class mpgHttpPost{}
has the constructor

function mpgHttpHost(...)

and is missing __construct().

The file os_moneris.php does use __construct().

Should I simply replace the constructor function names with __construct()?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 4 months ago #155319 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Using PHP 8.1 with JoomDonation products
Hello Hilmar

What extension you are having this problem with Moneris payment plugin? If it is Membership Pro or Events Booking, I would suggest you to access to My Downloads menu item on our website, download latest package of the payment plugin from there and update it to your site and the issue will be fixed. I fixed that issue sometime ago, maybe I forgot to update the package to server.

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Hilmar Schneider
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 4 months ago #155343 by Hilmar Schneider
Replied by Hilmar Schneider on topic Using PHP 8.1 with JoomDonation products
I downloaded the Moneris plugin (3.0.2) for Membership Pro and noticed that there are changes to using Moneris. Previously in moneris_helper.php the $Globals had a MONERIS_HOST that I could uncomment to select production ( www3.moneris.com ) or test (esqa.moneris.com).

Now there is a MONERIS_HOST and MONERIS_TEST_HOST along with functions setTestMode()

It's not clear to me how I would use the Moneris test system. There's no plugin parameters in os_moneris to say "use test system".

In the past I simply edited moneris_helper.php to select the test system. Is there any documentation on how to correctly use setTestMode()?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 4 months ago #155346 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Using PHP 8.1 with JoomDonation products
Hello Hilmar

I guess you can edit the code in file os_moneris.php payment plugin, add this line of code after line 69:
Code:
$mpgRequest->setTestMode(true);

Haven't tried that before, but it should work

Tuan

Please Log in or Create an account to join the conversation.

  • Hilmar Schneider
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 4 months ago - 1 year 4 months ago #155369 by Hilmar Schneider
Replied by Hilmar Schneider on topic Using PHP 8.1 with JoomDonation products
It does work.

Another change I've made in os_moneris.php is the cust_id value:
Code:
'cust_id' => substr($row->first_name . ' ' . $row->last_name . ' - Membership',0,50),

On the Moneris merchant site the transaction report includes the cust_id. I use it like a description so I don't need to view the transaction detail to see who is paying.

The cust_id field is limited to 50 characters so I use substr() to limit the size.

I made a similar change in Event Booking os_moneris.php:
Code:
'cust_id' => substr($row->first_name . ' ' . $row->last_name . ' - ' . $data['event_title'],0,50),
Last edit: 1 year 4 months ago by Hilmar Schneider.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 4 months ago #155370 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Using PHP 8.1 with JoomDonation products
OK. Thanks Hilmar for sharing the code.

Please Log in or Create an account to join the conversation.