From 646aa0fbb0c1270e5bd943facad68058a011701c Mon Sep 17 00:00:00 2001 From: gugaalves Date: Mon, 1 Sep 2025 11:45:32 -0300 Subject: [PATCH] Fix PHP typed properties to match parent classes --- classes/REST/Order_Endpoint.php | 2 +- classes/class-gateway.php | 8 +++---- classes/class-merchant.php | 42 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/classes/REST/Order_Endpoint.php b/classes/REST/Order_Endpoint.php index f67aeaa..0d82aa7 100644 --- a/classes/REST/Order_Endpoint.php +++ b/classes/REST/Order_Endpoint.php @@ -38,7 +38,7 @@ class Order_Endpoint extends Abstract_REST_Endpoint { * * @var string */ - protected $path = '/commerce/paystack/order'; + protected string $path = '/commerce/paystack/order'; /** * Register the actual endpoint on WP Rest API. diff --git a/classes/class-gateway.php b/classes/class-gateway.php index 7db3ba5..4052c78 100644 --- a/classes/class-gateway.php +++ b/classes/class-gateway.php @@ -17,22 +17,22 @@ class Gateway extends Abstract_Gateway { /** * @inheritDoc */ - protected static $key = 'paystack'; + protected static string $key = 'paystack'; /** * @inheritDoc */ - protected static $settings = Settings::class; + protected static string $settings = Settings::class; /** * @inheritDoc */ - protected static $merchant = Merchant::class; + protected static string $merchant = Merchant::class; /** * @inheritDoc */ - protected static $supported_currencies = array( 'NGN', 'GHS', 'USD', 'KES', 'ZAR', 'XOF', 'EGP' ); + protected static array $supported_currencies = array( 'NGN', 'GHS', 'USD', 'KES', 'ZAR', 'XOF', 'EGP' ); /** * @inheritDoc diff --git a/classes/class-merchant.php b/classes/class-merchant.php index f9476e8..f88336e 100644 --- a/classes/class-merchant.php +++ b/classes/class-merchant.php @@ -328,4 +328,46 @@ public function get_locale() { */ return apply_filters( 'tec_tickets_commerce_gateway_paystack_merchant_locale', $locale ); } + + /** + * Gets the client secret for merchant. + * + * @since 5.24.0 + * + * @return ?string + */ + public function get_client_secret(): ?string { + // Paystack doesn't use client secrets in the same way as other payment gateways + return null; + } + + /** + * Gets the disconnect action for merchant. + * + * @since 5.11.0.5 + * + * @return string + */ + public function get_disconnect_action(): string { + return 'tec_tickets_commerce_paystack_disconnect'; + } + + /** + * Gets the disconnect url for merchant. + * + * @since 5.11.0.5 + * + * @return string + */ + public function get_disconnect_url(): string { + return wp_nonce_url( + add_query_arg( + [ + 'action' => $this->get_disconnect_action(), + ], + admin_url( 'admin-ajax.php' ) + ), + $this->get_disconnect_action() + ); + } } \ No newline at end of file