public function register_rest_routes()
{
// Register settings to the REST API.
$this->register_wp_admin_settings();
$controllers = array('WC_REST_Coupons_Controller', 'WC_REST_Customer_Downloads_Controller', 'WC_REST_Customers_Controller', 'WC_REST_Order_Notes_Controller', 'WC_REST_Order_Refunds_Controller', 'WC_REST_Orders_Controller', 'WC_REST_Product_Attribute_Terms_Controller', 'WC_REST_Product_Attributes_Controller', 'WC_REST_Product_Categories_Controller', 'WC_REST_Product_Reviews_Controller', 'WC_REST_Product_Shipping_Classes_Controller', 'WC_REST_Product_Tags_Controller', 'WC_REST_Products_Controller', 'WC_REST_Product_Variations_Controller', 'WC_REST_Report_Sales_Controller', 'WC_REST_Report_Top_Sellers_Controller', 'WC_REST_Reports_Controller', 'WC_REST_Settings_Controller', 'WC_REST_Settings_Options_Controller', 'WC_REST_Shipping_Zones_Controller', 'WC_REST_Shipping_Zone_Locations_Controller', 'WC_REST_Shipping_Zone_Methods_Controller', 'WC_REST_Tax_Classes_Controller', 'WC_REST_Taxes_Controller', 'WC_REST_Webhook_Deliveries_Controller', 'WC_REST_Webhooks_Controller', 'WC_REST_System_Status_Controller', 'WC_REST_System_Status_Tools_Controller', 'WC_REST_Shipping_Methods_Controller', 'WC_REST_Payment_Gateways_Controller');
foreach ($controllers as $controller) {
$this->{$controller} = new $controller();
$this->{$controller}->register_routes();
}
}