update payment webhook

This commit is contained in:
Andras Bacsai 2023-09-05 10:46:36 +02:00
parent e8a41d7e6e
commit 67edce0612

View File

@ -262,7 +262,10 @@
break; break;
case 'invoice.payment_failed': case 'invoice.payment_failed':
$customerId = data_get($data, 'customer'); $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); SubscriptionInvoiceFailedJob::dispatch($subscription->team);
break; break;
case 'customer.subscription.updated': case 'customer.subscription.updated':