Hi Paystack team.
Guga here, from the Events Calendar/Event Tickets Technical support team.
We have also received some tickets sharing that a fatal error is happening when activating “Paystatck for The Events Calendar” plugin.
Here’s the error message our customers shared (and I was able to reproduce it):
Fatal error: Type of paystack\tec\classes\Gateway::$key must be string (as in class TEC\Tickets\Commerce\Gateways\Contracts\Abstract_Gateway) in /wp-content/plugins/paystack-for-events-calendar/classes/class-gateway.php on line 16.
I can see that the child class Gateway in the Paystack plugin, it’s defined as protect static $key = 'paystack';
The parent class is using PHP 7.4+ typed properties with the string type declaration, but the child class isn’t including this type declaration. This is causing the fatal error because the child class must maintain the same type declaration as the parent class.
You may need to modify the class-gateway.php file in the Paystack plugin to add the type declaration for the $key property: protected static string $key = 'paystack';
You’ll also need to make similar changes to the other properties that have type declarations in the parent class, on lines 25, 30 and 35.
This error occurs because the Paystack plugin was likely developed for an older version of the Event Tickets plugin or PHP, before typed properties were introduced. Note that some other files may need to be reviewed too 🙂
Hope that helps you to fix the issue.
Best regards, have a great week!
-
This reply was modified 8 months, 3 weeks ago by
Guga Alves.
By the way, I took some time to send a Pull request and help fixing the issue: https://github.com/PaystackOSS/plugin-the-events-calendar/pull/17
-
This reply was modified 8 months, 3 weeks ago by
Guga Alves.