WC_Payment_Gateway::get_method_title PHP Method

get_method_title() public method

Return the title for admin screens.
public get_method_title ( ) : string
return string
    public function get_method_title()
    {
        return apply_filters('woocommerce_gateway_method_title', $this->method_title, $this);
    }

Usage Example

 /**
  * Prepare a payment gateway for response.
  *
  * @param  WC_Payment_Gateway $gateway    Payment gateway object.
  * @param  WP_REST_Request    $request    Request object.
  * @return WP_REST_Response   $response   Response data.
  */
 public function prepare_item_for_response($gateway, $request)
 {
     $order = (array) get_option('woocommerce_gateway_order');
     $item = array('id' => $gateway->id, 'title' => $gateway->title, 'description' => $gateway->description, 'order' => isset($order[$gateway->id]) ? $order[$gateway->id] : '', 'enabled' => 'yes' === $gateway->enabled, 'method_title' => $gateway->get_method_title(), 'method_description' => $gateway->get_method_description(), 'settings' => $this->get_settings($gateway));
     $context = !empty($request['context']) ? $request['context'] : 'view';
     $data = $this->add_additional_fields_to_object($item, $request);
     $data = $this->filter_response_by_context($data, $context);
     $response = rest_ensure_response($data);
     $response->add_links($this->prepare_links($gateway, $request));
     /**
      * Filter payment gateway objects returned from the REST API.
      *
      * @param WP_REST_Response   $response The response object.
      * @param WC_Payment_Gateway $gateway  Payment gateway object.
      * @param WP_REST_Request    $request  Request object.
      */
     return apply_filters('woocommerce_rest_prepare_payment_gateway', $response, $gateway, $request);
 }