From d3e0817eef49ae85b75420da50f482e5c40cf5a0 Mon Sep 17 00:00:00 2001 From: Vasily Belolapotkov Date: Mon, 20 Apr 2020 05:02:08 +0300 Subject: [PATCH] Add webhooks logging in debug mode --- includes/admin/class-wc-rest-payments-webhook-controller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/admin/class-wc-rest-payments-webhook-controller.php b/includes/admin/class-wc-rest-payments-webhook-controller.php index 9d79ea43b9b..be41b3a2d31 100644 --- a/includes/admin/class-wc-rest-payments-webhook-controller.php +++ b/includes/admin/class-wc-rest-payments-webhook-controller.php @@ -88,6 +88,9 @@ public function handle_webhook( $request ) { $event_data = $this->read_property( $body, 'data' ); $event_object = $this->read_property( $event_data, 'object' ); + Logger::debug( 'Webhook recieved: ' . $event_type ); + Logger::debug( 'Webhook body: ' . var_export( $body, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + switch ( $event_type ) { case 'charge.refund.updated': $this->process_webhook_refund_updated( $event_object );