WC_REST_Paypal_Buttons_Controller::register_routes
Register the routes for the PayPal buttons functionality handler.
Method of the class: WC_REST_Paypal_Buttons_Controller{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_REST_Paypal_Buttons_Controller = new WC_REST_Paypal_Buttons_Controller(); $WC_REST_Paypal_Buttons_Controller->register_routes();
WC_REST_Paypal_Buttons_Controller::register_routes() WC REST Paypal Buttons Controller::register routes code WC 10.3.6
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/create-order',
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( $this, 'create_order' ),
'permission_callback' => array( $this, 'validate_create_order_request' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/cancel-payment',
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( $this, 'cancel_payment' ),
'permission_callback' => array( $this, 'validate_cancel_payment_request' ),
)
);
}