From a92ba7133f89843592badcb31d677b9551052376 Mon Sep 17 00:00:00 2001 From: Matthew Wire <mjw@mjwconsult.co.uk> Date: Mon, 13 Jul 2020 15:11:44 +0100 Subject: [PATCH] If we don't have a recurring contribution for subscription ID don't throw exception - it's probably a subscription that was recorded outside of CiviCRM so we ignore and return 200 OK to keep webhook happy --- CRM/Core/Payment/StripeIPN.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment/StripeIPN.php b/CRM/Core/Payment/StripeIPN.php index c488c33f..0495706d 100644 --- a/CRM/Core/Payment/StripeIPN.php +++ b/CRM/Core/Payment/StripeIPN.php @@ -447,7 +447,11 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN { $this->contribution_recur_id = $contributionRecur['id']; } catch (Exception $e) { - $this->exception('Cannot find recurring contribution for subscription ID: ' . $this->subscription_id . '. ' . $e->getMessage()); + if ((bool)\Civi::settings()->get('stripe_ipndebug')) { + $message = $this->_paymentProcessor->getPaymentProcessorLabel() . ': ' . CRM_Stripe_Api::getParam('id', $this->_inputParameters) . ': Cannot find recurring contribution for subscription ID: ' . $this->subscription_id; + Civi::log()->debug($message); + } + return FALSE; } } -- GitLab