Skip to content

Commit

Permalink
Fix how the method description is set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RadoslavGeorgiev committed Dec 12, 2024
1 parent 7daa4ac commit 23444f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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 */
__(
Expand Down

0 comments on commit 23444f8

Please sign in to comment.