Automattic\WooCommerce\Admin\API
PaymentGatewaySuggestions::register_routes
Register routes.
Method of the class: PaymentGatewaySuggestions{}
No Hooks.
Returns
null. Nothing (null).
Usage
$PaymentGatewaySuggestions = new PaymentGatewaySuggestions(); $PaymentGatewaySuggestions->register_routes();
PaymentGatewaySuggestions::register_routes() PaymentGatewaySuggestions::register routes code WC 10.6.2
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array( $this, 'get_suggestions' ),
'permission_callback' => array( $this, 'user_can_manage_woocommerce' ),
'args' => array(
'force_default_suggestions' => array(
'type' => 'boolean',
'description' => __( 'Return the default payment suggestions when woocommerce_show_marketplace_suggestions and woocommerce_setting_payments_recommendations_hidden options are set to no', 'woocommerce' ),
),
),
),
'schema' => array( $this, 'get_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/dismiss',
array(
array(
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array( $this, 'dismiss_payment_gateway_suggestion' ),
'permission_callback' => array( $this, 'get_permission_check' ),
),
'schema' => array( $this, 'get_item_schema' ),
)
);
}