Skip to content

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.

feat(billing): Add Stripe past due subscription status tracking

Andras Bacsai07cbec7ddc7f
diff --git a/app/Models/Team.php b/app/Models/Team.php
index 467cf45bc4..6796b22ad7 100644
--- a/app/Models/Team.php
+++ b/app/Models/Team.php
@@ -93,6 +93,15 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
return $servers >= $serverLimit;
}
+ public function subscriptionPastOverDue()
+ {
+ if (isCloud()) {
+ return $this->subscription?->stripe_past_due;
+ }
+
+ return false;
+ }
+
public function serverOverflow()
{
if ($this->serverLimit() < $this->servers->count()) {
@@ -185,6 +194,7 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
'stripe_cancel_at_period_end' => false,
'stripe_invoice_paid' => false,
'stripe_trial_already_ended' => false,
+ 'stripe_past_due' => false,
]);
foreach ($this->servers as $server) {
$server->settings()->update([
diff --git a/database/migrations/2025_03_01_112617_add_stripe_past_due.php b/database/migrations/2025_03_01_112617_add_stripe_past_due.php
new file mode 100644
index 0000000000..6edb4f698b
--- /dev/null
+++ b/database/migrations/2025_03_01_112617_add_stripe_past_due.php
@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::table('subscriptions', function (Blueprint $table) {
+ $table->boolean('stripe_past_due')->default(false);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('subscriptions', function (Blueprint $table) {
+ $table->dropColumn('stripe_past_due');
+ });
+ }
+};