From a4a19073cfc635dec2f8820afed1213add061b72 Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 10 Apr 2026 01:04:00 -0600 Subject: [PATCH] fix: remove return type declarations from Base_Gateway abstract methods External gateway plugins that extend Base_Gateway without matching return type declarations cause a PHP fatal error. Removing return types from the abstract base class restores compatibility with third-party gateways while keeping the concrete implementations (Stripe, PayPal) typed. --- inc/gateways/class-base-gateway.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/gateways/class-base-gateway.php b/inc/gateways/class-base-gateway.php index ca1bd659..e4c85194 100644 --- a/inc/gateways/class-base-gateway.php +++ b/inc/gateways/class-base-gateway.php @@ -165,7 +165,7 @@ public function __construct($order = null) { * @param \WP_Ultimo\Checkout\Cart $order The order. * @return void */ - public function set_order($order): void { + public function set_order($order) { if (null === $order) { return; @@ -608,7 +608,7 @@ public function verify_and_complete_payment(int $payment_id): array { * @param string $gateway_payment_id The gateway payment id. * @return string */ - public function get_payment_url_on_gateway($gateway_payment_id): string { + public function get_payment_url_on_gateway($gateway_payment_id) { unset($gateway_payment_id); return ''; } @@ -623,7 +623,7 @@ public function get_payment_url_on_gateway($gateway_payment_id): string { * @param string $gateway_subscription_id The gateway subscription id. * @return string */ - public function get_subscription_url_on_gateway($gateway_subscription_id): string { + public function get_subscription_url_on_gateway($gateway_subscription_id) { unset($gateway_subscription_id); return ''; } @@ -638,7 +638,7 @@ public function get_subscription_url_on_gateway($gateway_subscription_id): strin * @param string $gateway_customer_id The gateway customer id. * @return string */ - public function get_customer_url_on_gateway($gateway_customer_id): string { + public function get_customer_url_on_gateway($gateway_customer_id) { unset($gateway_customer_id); return ''; } @@ -853,7 +853,7 @@ public function get_webhook_listener_url() { * @param \WP_Ultimo\Models\Payment $payment The payment. * @return void */ - public function set_payment($payment): void { + public function set_payment($payment) { $this->payment = $payment; } @@ -865,7 +865,7 @@ public function set_payment($payment): void { * @param \WP_Ultimo\Models\Membership $membership The membership. * @return void */ - public function set_membership($membership): void { + public function set_membership($membership) { $this->membership = $membership; } @@ -877,7 +877,7 @@ public function set_membership($membership): void { * @param \WP_Ultimo\Models\Customer $customer The customer. * @return void */ - public function set_customer($customer): void { + public function set_customer($customer) { $this->customer = $customer; } @@ -891,7 +891,7 @@ public function set_customer($customer): void { * @param \WP_Ultimo\Models\Membership $membership The membership object. * @return void */ - public function trigger_payment_processed($payment, $membership = null): void { + public function trigger_payment_processed($payment, $membership = null) { if (null === $membership) { $membership = $payment->get_membership();