WC_Gateway_Paypal_Webhook_Handler{}WC 1.0

Deprecated since 10.5.0 Deprecated in favor of Automattic\WooCommerce\Gateways\PayPal\WebhookHandler. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

Handles webhook events.

No Hooks.

Usage

$WC_Gateway_Paypal_Webhook_Handler = new WC_Gateway_Paypal_Webhook_Handler();
// use class methods

Methods

  1. public __construct()
  2. public process_webhook( WP_REST_Request $request )

Changelog

Deprecated since 10.5.0 Deprecated in favor of Automattic\WooCommerce\Gateways\PayPal\WebhookHandler

WC_Gateway_Paypal_Webhook_Handler{} code WC 10.7.0

class WC_Gateway_Paypal_Webhook_Handler {

	/**
	 * The delegated webhook handler instance.
	 *
	 * @var PayPalWebhookHandler
	 */
	private PayPalWebhookHandler $webhook_handler;

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->webhook_handler = new PayPalWebhookHandler();
	}

	/**
	 * Process the webhook event.
	 *
	 * @deprecated 10.5.0 Use Automattic\WooCommerce\Gateways\PayPal\WebhookHandler::process_webhook() instead. This method will be removed in 11.0.0.
	 *
	 * @param WP_REST_Request $request The request object.
	 *
	 * @return void
	 *
	 * @deprecated 10.5.0 Deprecated in favor of Automattic\WooCommerce\Gateways\PayPal\WebhookHandler::process_webhook
	 */
	public function process_webhook( WP_REST_Request $request ) {
		wc_deprecated_function(
			__METHOD__,
			'10.5.0',
			PayPalWebhookHandler::class . '::process_webhook()'
		);

		$this->webhook_handler->process_webhook( $request );
	}
}