Skip to content

Conversation

@gugaalves
Copy link

This pull request addresses compatibility issues with newer versions of the Event Tickets plugin (5.6.0+) that use PHP 7.4+ typed properties. Without these changes, the plugin produces fatal errors when activated alongside recent versions of Event Tickets (as shared at https://wordpress.org/support/topic/paystack-plugin-not-compatible-with-event-ticket/).

Changes Made

  1. Gateway Class:

    • Added string type declaration to $key property
    • Added string type declaration to $settings property
    • Added string type declaration to $merchant property
    • Added array type declaration to $supported_currencies property
  2. Order_Endpoint Class:

    • Added string type declaration to $path property
  3. Merchant Class:

    • Implemented missing interface methods required by Merchant_Interface:
      • get_client_secret(): Returns null as Paystack doesn't use client secrets in the same way as other payment gateways
      • get_disconnect_action(): Returns the action name for disconnecting the merchant
      • get_disconnect_url(): Returns the URL for disconnecting the merchant

Fixes

These changes resolve the following fatal errors:

  • Fatal error: Type of paystack\tec\classes\Gateway::$key must be string (as in class TEC\Tickets\Commerce\Gateways\Contracts\Abstract_Gateway)
  • Fatal error: Type of paystack\tec\classes\REST\Order_Endpoint::$path must be string (as in class TEC\Tickets\Commerce\Gateways\Contracts\Abstract_REST_Endpoint)
  • Fatal error: Class paystack\tec\classes\Merchant contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (TEC\Tickets\Commerce\Gateways\Contracts\Merchant_Interface::get_client_secret)

Testing

These changes have been tested with Event Tickets plugin version 5.6.0+ and PHP 7.4+. The plugin now activates successfully and functions as expected.

Background

The Event Tickets plugin has been updated to use PHP 7.4+ typed properties, but the Paystack for Events Calendar plugin hasn't been updated to match these changes. This PR ensures compatibility between the two plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants