Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\PaymentGateways
Controller::get_payment_gateway
Get a gateway based on the current request object.
Method of the class: Controller{}
No Hooks.
Returns
WC_Payment_Gateway|null.
Usage
// private - for code of main (parent) class only $result = $this->get_payment_gateway( $id ): ?WC_Payment_Gateway;
- $id(string) (required)
- Gateway ID.
Controller::get_payment_gateway() Controller::get payment gateway code WC 10.4.3
private function get_payment_gateway( $id ): ?WC_Payment_Gateway {
$payment_gateways = WC()->payment_gateways->payment_gateways();
return $payment_gateways[ $id ] ?? null;
}