Fix PHP typed properties to match parent classes #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Gateway Class:
stringtype declaration to$keypropertystringtype declaration to$settingspropertystringtype declaration to$merchantpropertyarraytype declaration to$supported_currenciespropertyOrder_Endpoint Class:
stringtype declaration to$pathpropertyMerchant Class:
Merchant_Interface:get_client_secret(): Returns null as Paystack doesn't use client secrets in the same way as other payment gatewaysget_disconnect_action(): Returns the action name for disconnecting the merchantget_disconnect_url(): Returns the URL for disconnecting the merchantFixes
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.