WC_REST_Paypal_Webhooks_Controller::register_routespublicWC 1.0

Register the routes for the PayPal webhook handler.

Method of the class: WC_REST_Paypal_Webhooks_Controller{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_REST_Paypal_Webhooks_Controller = new WC_REST_Paypal_Webhooks_Controller();
$WC_REST_Paypal_Webhooks_Controller->register_routes();

WC_REST_Paypal_Webhooks_Controller::register_routes() code WC 10.3.6

public function register_routes() {
	// POST /v3/paypal-webhooks.
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			'methods'             => WP_REST_Server::CREATABLE,
			'callback'            => array( $this, 'process_webhook' ),
			'permission_callback' => array( $this, 'validate_webhook' ),
		)
	);
}