An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: remove cloud stripe notifications
Andras Bacsai73692a0c73a1
diff --git a/app/Http/Controllers/Webhook/Stripe.php b/app/Http/Controllers/Webhook/Stripe.phpindex e404a8ebcc..230525c0ea 100644--- a/app/Http/Controllers/Webhook/Stripe.php+++ b/app/Http/Controllers/Webhook/Stripe.php@@ -72,14 +72,14 @@ class Stripe extends Controller}$subscription = Subscription::where('team_id', $teamId)->first();if ($subscription) {- send_internal_notification('Old subscription activated for team: '.$teamId);+ // send_internal_notification('Old subscription activated for team: '.$teamId);$subscription->update(['stripe_subscription_id' => $subscriptionId,'stripe_customer_id' => $customerId,'stripe_invoice_paid' => true,]);} else {- send_internal_notification('New subscription for team: '.$teamId);+ // send_internal_notification('New subscription for team: '.$teamId);Subscription::create(['team_id' => $teamId,'stripe_subscription_id' => $subscriptionId,@@ -92,7 +92,7 @@ class Stripe extends Controller$customerId = data_get($data, 'customer');$planId = data_get($data, 'lines.data.0.plan.id');if (Str::contains($excludedPlans, $planId)) {- send_internal_notification('Subscription excluded.');+ // send_internal_notification('Subscription excluded.');break;}$subscription = Subscription::where('stripe_customer_id', $customerId)->first();@@ -108,33 +108,33 @@ class Stripe extends Controller$customerId = data_get($data, 'customer');$subscription = Subscription::where('stripe_customer_id', $customerId)->first();if (! $subscription) {- send_internal_notification('invoice.payment_failed failed but no subscription found in Coolify for customer: '.$customerId);+ // send_internal_notification('invoice.payment_failed failed but no subscription found in Coolify for customer: '.$customerId);return response('No subscription found in Coolify.');}$team = data_get($subscription, 'team');if (! $team) {- send_internal_notification('invoice.payment_failed failed but no team found in Coolify for customer: '.$customerId);+ // send_internal_notification('invoice.payment_failed failed but no team found in Coolify for customer: '.$customerId);return response('No team found in Coolify.');}if (! $subscription->stripe_invoice_paid) {SubscriptionInvoiceFailedJob::dispatch($team);- send_internal_notification('Invoice payment failed: '.$customerId);+ // send_internal_notification('Invoice payment failed: '.$customerId);} else {- send_internal_notification('Invoice payment failed but already paid: '.$customerId);+ // send_internal_notification('Invoice payment failed but already paid: '.$customerId);}break;case 'payment_intent.payment_failed':$customerId = data_get($data, 'customer');$subscription = Subscription::where('stripe_customer_id', $customerId)->first();if (! $subscription) {- send_internal_notification('payment_intent.payment_failed, no subscription found in Coolify for customer: '.$customerId);+ // send_internal_notification('payment_intent.payment_failed, no subscription found in Coolify for customer: '.$customerId);return response('No subscription found in Coolify.');}if ($subscription->stripe_invoice_paid) {- send_internal_notification('payment_intent.payment_failed but invoice is active for customer: '.$customerId);+ // send_internal_notification('payment_intent.payment_failed but invoice is active for customer: '.$customerId);return;}@@ -146,7 +146,7 @@ class Stripe extends Controller$subscriptionId = data_get($data, 'items.data.0.subscription');$planId = data_get($data, 'items.data.0.plan.id');if (Str::contains($excludedPlans, $planId)) {- send_internal_notification('Subscription excluded.');+ // send_internal_notification('Subscription excluded.');break;}$subscription = Subscription::where('stripe_customer_id', $customerId)->first();@@ -156,11 +156,11 @@ class Stripe extends Controller}if (! $subscription) {if ($status === 'incomplete_expired') {- send_internal_notification('Subscription incomplete expired for customer: '.$customerId);+ // send_internal_notification('Subscription incomplete expired for customer: '.$customerId);return response('Subscription incomplete expired', 200);}- send_internal_notification('No subscription found for: '.$customerId);+ // send_internal_notification('No subscription found for: '.$customerId);return response('No subscription found', 400);}@@ -194,7 +194,7 @@ class Stripe extends Controller$subscription->update(['stripe_invoice_paid' => false,]);- send_internal_notification('Subscription paused or incomplete for customer: '.$customerId);+ // send_internal_notification('Subscription paused or incomplete for customer: '.$customerId);}// Trial ended but subscribed, reactive servers@@ -208,13 +208,13 @@ class Stripe extends Controllerif ($comment) {$reason .= ' with comment: \''.$comment."'";}- send_internal_notification($reason);+ // send_internal_notification($reason);}if ($alreadyCancelAtPeriodEnd !== $cancelAtPeriodEnd) {if ($cancelAtPeriodEnd) {// send_internal_notification('Subscription cancelled at period end for team: ' . $subscription->team->id);} else {- send_internal_notification('customer.subscription.updated for customer: '.$customerId);+ // send_internal_notification('customer.subscription.updated for customer: '.$customerId);}}break;@@ -233,7 +233,7 @@ class Stripe extends Controller'stripe_invoice_paid' => false,'stripe_trial_already_ended' => true,]);- send_internal_notification('customer.subscription.deleted for customer: '.$customerId);+ // send_internal_notification('customer.subscription.deleted for customer: '.$customerId);break;case 'customer.subscription.trial_will_end':// Not used for now@@ -258,7 +258,7 @@ class Stripe extends Controller'stripe_invoice_paid' => false,]);SubscriptionTrialEndedJob::dispatch($team);- send_internal_notification('Subscription paused for customer: '.$customerId);+ // send_internal_notification('Subscription paused for customer: '.$customerId);break;default:// Unhandled event type