WordPress at a glance
function is not described

WC_REST_Payment_Gateways_V2_Controller::get_gateway() public WC 1.0

Get a gateway based on the current request object.

{} It's a method of the class: WC_REST_Payment_Gateways_V2_Controller{}

No Hooks.

Return

WP_REST_Response|null.

Usage

$WC_REST_Payment_Gateways_V2_Controller = new WC_REST_Payment_Gateways_V2_Controller();
$WC_REST_Payment_Gateways_V2_Controller->get_gateway( $request );
$request(WP_REST_Request) (required)
Request data.

Code of WC_REST_Payment_Gateways_V2_Controller::get_gateway() WC 5.0.0

<?php
public function get_gateway( $request ) {
	$gateway          = null;
	$payment_gateways = WC()->payment_gateways->payment_gateways();
	foreach ( $payment_gateways as $payment_gateway_id => $payment_gateway ) {
		if ( $request['id'] !== $payment_gateway_id ) {
			continue;
		}
		$payment_gateway->id = $payment_gateway_id;
		$gateway             = $payment_gateway;
	}
	return $gateway;
}