From 3c9d118926202fa81ac1d3c6cbb8aa930dafc3f7 Mon Sep 17 00:00:00 2001 From: Tim Kelty Date: Fri, 9 Aug 2024 14:44:53 -0400 Subject: [PATCH] Don't throw if subscription is not found --- src/base/SubscriptionGateway.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/SubscriptionGateway.php b/src/base/SubscriptionGateway.php index de6de3d..c8a3cc2 100644 --- a/src/base/SubscriptionGateway.php +++ b/src/base/SubscriptionGateway.php @@ -921,7 +921,9 @@ protected function handleInvoiceSucceededEvent(array $data): void if (!$subscription) { - throw new SubscriptionException('Subscription with the reference “' . $subscriptionReference . '” not found when processing webhook ' . $data['id']); + // replace throw with log + Craft::warning('Subscription with the reference “' . $subscriptionReference . '” not found when processing webhook ' . $data['id'], 'stripe'); + return; } $invoice = $this->saveSubscriptionInvoice($stripeInvoice, $subscription);