From 67edce06121e8cdadd7b754597b0e1ce771034eb Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 5 Sep 2023 10:46:36 +0200 Subject: [PATCH] update payment webhook --- routes/webhooks.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/webhooks.php b/routes/webhooks.php index 5d9257094..a724e8e70 100644 --- a/routes/webhooks.php +++ b/routes/webhooks.php @@ -262,7 +262,10 @@ break; case 'invoice.payment_failed': $customerId = data_get($data, 'customer'); - $subscription = Subscription::where('stripe_customer_id', $customerId)->firstOrFail(); + $subscription = Subscription::where('stripe_customer_id', $customerId)->first(); + if (!$subscription) { + return; + } SubscriptionInvoiceFailedJob::dispatch($subscription->team); break; case 'customer.subscription.updated':