PHP Class WC_REST_Payment_Gateways_Controller

Inheritance: extends WC_REST_Controller
Show file Open project: woocommerce/woocommerce

Protected Properties

Property Type Description
$namespace string Endpoint namespace.
$rest_base string Route base.

Public Methods

Method Description
get_collection_params ( ) : array Get any query params needed.
get_gateway ( WP_REST_Request $request ) : WP_REST_Response | null Get a gateway based on the current request object.
get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error Get a single payment gateway.
get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean Check if a given request has access to read a payment gateway.
get_item_schema ( ) : array Get the payment gateway schema, conforming to JSON Schema.
get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response Get payment gateways.
get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean Check whether a given request has permission to view payment gateways.
get_settings ( $gateway ) Return settings associated with this payment gateway.
prepare_item_for_response ( WC_Payment_Gateway $gateway, WP_REST_Request $request ) : WP_REST_Response Prepare a payment gateway for response.
register_routes ( ) Register the route for /payment_gateways and /payment_gateways/
update_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error Update A Single Shipping Zone Method.
update_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean Check whether a given request has permission to edit payment gateways.

Protected Methods

Method Description
prepare_links ( WC_Payment_Gateway $gateway, WP_REST_Request $request ) : array Prepare links for the request.

Method Details

get_collection_params() public method

Get any query params needed.
public get_collection_params ( ) : array
return array

get_gateway() public method

Get a gateway based on the current request object.
public get_gateway ( WP_REST_Request $request ) : WP_REST_Response | null
$request WP_REST_Request
return WP_REST_Response | null

get_item() public method

Get a single payment gateway.
public get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error
$request WP_REST_Request
return WP_REST_Response | WP_Error

get_item_permissions_check() public method

Check if a given request has access to read a payment gateway.
public get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean
$request WP_REST_Request Full details about the request.
return WP_Error | boolean

get_item_schema() public method

Get the payment gateway schema, conforming to JSON Schema.
public get_item_schema ( ) : array
return array

get_items() public method

Get payment gateways.
public get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response
$request WP_REST_Request Full details about the request.
return WP_Error | WP_REST_Response

get_items_permissions_check() public method

Check whether a given request has permission to view payment gateways.
public get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean
$request WP_REST_Request Full details about the request.
return WP_Error | boolean

get_settings() public method

Return settings associated with this payment gateway.
public get_settings ( $gateway )

prepare_item_for_response() public method

Prepare a payment gateway for response.
public prepare_item_for_response ( WC_Payment_Gateway $gateway, WP_REST_Request $request ) : WP_REST_Response
$gateway WC_Payment_Gateway Payment gateway object.
$request WP_REST_Request Request object.
return WP_REST_Response $response Response data.

register_routes() public method

Register the route for /payment_gateways and /payment_gateways/
public register_routes ( )

update_item() public method

Update A Single Shipping Zone Method.
public update_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error
$request WP_REST_Request
return WP_REST_Response | WP_Error

update_items_permissions_check() public method

Check whether a given request has permission to edit payment gateways.
public update_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean
$request WP_REST_Request Full details about the request.
return WP_Error | boolean

Property Details

$namespace protected property

Endpoint namespace.
protected string $namespace
return string

$rest_base protected property

Route base.
protected string $rest_base
return string