From 0a892a5f5b4067f92a445027bc370bae14201f62 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Wed, 6 Mar 2024 12:12:45 +0100 Subject: [PATCH] Return success response if event type is `BILLING_AGREEMENTS.AGREEMENT.CREATED` --- modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php b/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php index 6b61d9c1a..cf2d03989 100644 --- a/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php +++ b/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php @@ -248,9 +248,14 @@ class IncomingWebhookEndpoint { } } + $event_type = $request['event_type'] ?: ''; + if ( in_array( $event_type, array( 'BILLING_AGREEMENTS.AGREEMENT.CREATED' ), true ) ) { + return $this->success_response(); + } + $message = sprintf( 'Could not find handler for request type %s', - $request['event_type'] ?: '' + $event_type ); return $this->failure_response( $message ); }