From 23444f836027793a8046096e6fc61956b1cdb6f1 Mon Sep 17 00:00:00 2001 From: Radoslav Georgiev Date: Thu, 12 Dec 2024 23:27:16 +0200 Subject: [PATCH] Fix how the method description is set The core payment gateway class only uses the `method_description` property within `get_method_description()`, a method that we are already overloading. This makes the `$this->method_description = $this->get_method_description()` call redundant, especially in the constructor. --- includes/class-wc-payment-gateway-wcpay.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/includes/class-wc-payment-gateway-wcpay.php b/includes/class-wc-payment-gateway-wcpay.php index 4e231e588bf..c5a614a1390 100644 --- a/includes/class-wc-payment-gateway-wcpay.php +++ b/includes/class-wc-payment-gateway-wcpay.php @@ -309,11 +309,10 @@ public function __construct( $this->fraud_service = $fraud_service; $this->duplicate_payment_methods_detection_service = $duplicate_payment_methods_detection_service; - $this->id = static::GATEWAY_ID; - $this->icon = $this->get_theme_icon(); - $this->has_fields = true; - $this->method_title = 'WooPayments'; - $this->method_description = $this->get_method_description(); + $this->id = static::GATEWAY_ID; + $this->icon = $this->get_theme_icon(); + $this->has_fields = true; + $this->method_title = 'WooPayments'; $this->title = $payment_method->get_title(); $this->description = ''; @@ -4476,8 +4475,6 @@ public function get_theme_icon() { * @return string */ public function get_method_description() { - return 'Some description'; - $description = sprintf( /* translators: %1$s: WooPayments */ __(