WooCommerce Code Reference

WC_Helper_Orders_API
in package

WC_Helper_Orders_API

Pings WooCommerce.com to create an order and pull in the necessary data to start the installation process.

Table of Contents

create_order()  : WP_REST_Response
Core function to create an order on WooCommerce.com. Pings the API and catches the exceptions if any.
get_permission()  : bool
The Extensions page can only be accessed by users with the manage_woocommerce capability. So the API mimics that behavior.
load()  : void
Loads the class, runs on init
register_rest_routes()  : mixed
Registers the REST routes for the Marketplace Orders API.

Methods

create_order()

Core function to create an order on WooCommerce.com. Pings the API and catches the exceptions if any.

public static create_order(WP_REST_Request $request) : WP_REST_Response
Parameters
$request : WP_REST_Request

Request object.

Return values
WP_REST_Response

get_permission()

The Extensions page can only be accessed by users with the manage_woocommerce capability. So the API mimics that behavior.

public static get_permission() : bool
Return values
bool

register_rest_routes()

Registers the REST routes for the Marketplace Orders API.

public static register_rest_routes() : mixed

These endpoints are used by the Marketplace Subscriptions React UI.

Return values
mixed