WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

PaymentGatewaysController::extend_response() public WC 1.0

Add necessary fields to REST API response.

{} Это метод класса: PaymentGatewaysController{}

Хуков нет.

Возвращает

WP_REST_Response.

Использование

$result = PaymentGatewaysController::extend_response( $response, $gateway, $request );
$response(WP_REST_Response) (обязательный)
Response data.
$gateway(WC_Payment_Gateway) (обязательный)
Payment gateway object.
$request(WP_REST_Request) (обязательный)
Request object.

Код PaymentGatewaysController::extend_response() WC 5.5.2

<?php
public static function extend_response( $response, $gateway, $request ) {
	$data = $response->get_data();

	$data['needs_setup']          = $gateway->needs_setup();
	$data['post_install_scripts'] = self::get_post_install_scripts( $gateway );
	$data['settings_url']         = admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) );

	if ( method_exists( $gateway, 'get_connection_url' ) ) {
		$return_url             = wc_admin_url( '&task=payments&connection-return=' . strtolower( $gateway->id ) );
		$data['connection_url'] = $gateway->get_connection_url( $return_url );
	}

	if ( method_exists( $gateway, 'get_setup_help_text' ) ) {
		$data['setup_help_text'] = $gateway->get_setup_help_text();
	}

	if ( method_exists( $gateway, 'get_required_settings_keys' ) ) {
		$data['required_settings_keys'] = $gateway->get_required_settings_keys();
	}

	$response->set_data( $data );

	return $response;
}