Support

Home Forums Event Espresso Premium Not available to activate Payfast after Upgrade to EE 5.0.19p

Not available to activate Payfast after Upgrade to EE 5.0.19p

Posted: April 29, 2024 at 8:54 am


OcAfrica

April 29, 2024 at 8:54 am

My clients site keeps getting a critical error when I activate payfast extention.

PayFast payment gateway

Version 1.1.1 | By PayFast | Visit plugin site
This plugin failed to load properly and is paused during recovery mode.

An error of type E_COMPILE_ERROR was caused in line 57 of the file /home/ocafricaorg/domains/ocafrica.org/public_html/wp-content/plugins/Payfast/payment_methods/Payfast/EE_PMT_Payfast.pm.php. Error message: Declaration of EE_PMT_Payfast::finalize_payment_for($transaction) must be compatible with EE_PMT_Base::finalize_payment_for(EE_Transaction $transaction): ?EE_Payment


Tony

  • Support Staff

April 29, 2024 at 9:16 am

Hi there,

The above isn’t from a recent update to Event Espresso, we changed the signature for EE_PMT_Base::finalize_payment_for a while ago (Jan 2023 the change was committed to our code base).

The PayFast payment method needs to be updated to match the current payment method function signatures to fix this.


OcAfrica

April 29, 2024 at 9:38 am

How does your response solve my critical error on my website.

IS THAT YOUR IDEA OF SUPPORT?


OcAfrica

April 29, 2024 at 10:06 am

Payfast payment gateway

Version 1.1.8 | By Payfast | Visit plugin site
This plugin failed to load properly and is paused during recovery mode.

An error of type E_COMPILE_ERROR was caused in line 70 of the file /home/ocafricaorg/domains/ocafrica.org/public_html/wp-content/plugins/Payfast/payment_methods/Payfast/EE_PMT_Payfast.pm.php. Error message: Declaration of EE_PMT_Payfast::finalize_payment_for($transaction) must be compatible with EE_PMT_Base::finalize_payment_for(EE_Transaction $transaction): ?EE_Payment


Tony

  • Support Staff

April 29, 2024 at 3:10 pm

How does your response solve my critical error on my website.

IS THAT YOUR IDEA OF SUPPORT?

The error isn’t from EE itself, its from the PayFast add-on and that add-on needs to be updated.

We provide support for Event Espresso and any add-ons we (EventEspresso.com) create, we didn’t create or write any part of the PayFast add-on so we can’t provide support for it, the author of that add-on needs to fix this.

So in short, you are using a 3rd party payment method which we did not create and we don’t provide support for so I’m not sure what other response I can give you here.

Any fix I can give you would be overridden by any updates PayFast make, if they don’t fix the code in their add-on then any changes you make to fix their code running on your site will be wiped out on their next update and you end up in the same situation all over again.


Tony

  • Support Staff

April 29, 2024 at 4:03 pm

I realised that without some additional context, my replies likely come across differently than intended here.

So to explain a little, PayFast created the above payment method themselves and we didn’t have anything at all to do with the development of that add-on. We don’t provide support for other people’s code as we don’t have any control over it, so if we didn’t write it and release it ourselves, it’s not code we support.

The issue above is from PayFast not updating the add-on to keep up with EE’s core payment method functions, one of the methods the PayFast add-on overrides has changed and needs to match so PHP then throws an error because those method signatures don’t match.

PayFast themselves show they support Event Espresso 4.9 with no mention of 5+

https://support.payfast.help/portal/en/kb/articles/how-do-i-integrate-payfast-with-event-espresso-20-9-2022#Installation_requirements

The error you are getting means that the PayFast add-on needs to be updated to work with EE5, any fixes I give you may well work, but will be wiped out when/if PayFast release an update themselves. They may (or may not) include the fix for this in their update, but if not, your back to square one again. So they need to update their payment method to prevent this error.

The error you’ve posted shows that:

/wp-content/plugins/Payfast/payment_methods/Payfast/EE_PMT_Payfast.pm.php

Line 70 needs to change from this:

public function finalize_payment_for($transaction)

To this:

public function finalize_payment_for(EE_Transaction $transaction): ?EE_Payment

Which should fix that specific error, but there may be more and again, this is not something we provide support for, it needs to be properly fixed in the add-on itself.

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso