From 6bbfe20544724cca0dc124c1ab893cae2f74bc2c Mon Sep 17 00:00:00 2001
From: Matthew Wire <mjw@mjwconsult.co.uk>
Date: Fri, 10 Sep 2021 11:30:44 +0100
Subject: [PATCH] Add hook webhookEventNotMatched

---
 CRM/Core/Payment/StripeIPN.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CRM/Core/Payment/StripeIPN.php b/CRM/Core/Payment/StripeIPN.php
index 38e88e48..ea3a1aee 100644
--- a/CRM/Core/Payment/StripeIPN.php
+++ b/CRM/Core/Payment/StripeIPN.php
@@ -540,6 +540,7 @@ class CRM_Core_Payment_StripeIPN {
         // Subscription is cancelled
         if (!$this->getSubscriptionDetails()) {
           // Subscription was not found in CiviCRM
+          CRM_Mjwshared_Hook::webhookEventNotMatched('stripe', $this, 'subscription_not_found');
           return TRUE;
         }
         // Cancel the recurring contribution
@@ -696,6 +697,7 @@ class CRM_Core_Payment_StripeIPN {
         $message = $this->_paymentProcessor->getPaymentProcessorLabel() . 'No matching contributions for event ' . $this->getEventID();
         Civi::log()->debug($message);
       }
+      CRM_Mjwshared_Hook::webhookEventNotMatched('stripe', $this, 'contribution_not_found');
       return FALSE;
     }
 
@@ -730,6 +732,7 @@ class CRM_Core_Payment_StripeIPN {
         $message = $this->_paymentProcessor->getPaymentProcessorLabel() . 'Stripe Customer not found in CiviCRM for event ' . $this->getEventID();
         Civi::log()->debug($message);
       }
+      CRM_Mjwshared_Hook::webhookEventNotMatched('stripe', $this, 'customer_not_found');
       return FALSE;
     }
     return TRUE;
-- 
GitLab