Automattic\WooCommerce\Admin\API

PaymentGatewaySuggestions::get_suggestions()publicWC 1.0

Return suggested payment gateways.

Метод класса: PaymentGatewaySuggestions{}

No Hooks.

Return

\WP_Error|\WP_HTTP_Response|\WP_REST_Response.

Usage

$PaymentGatewaySuggestions = new PaymentGatewaySuggestions();
$PaymentGatewaySuggestions->get_suggestions( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Код PaymentGatewaySuggestions::get_suggestions() WC 7.1.0

public function get_suggestions( $request ) {

	$should_display = Suggestions::should_display();
	$force_default  = $request->get_param( 'force_default_suggestions' );

	if ( $should_display ) {
		return Suggestions::get_suggestions();
	} elseif ( false === $should_display && true === $force_default ) {
		return rest_ensure_response( Suggestions::get_suggestions( DefaultPaymentGateways::get_all() ) );
	}

	return rest_ensure_response( array() );
}