mehr übersetzungen, added pending purchase indicator. datenschutzfenster funktioniert.

This commit is contained in:
Codex Agent
2025-10-03 15:31:54 +02:00
parent 60f8de9162
commit c87cfb2c10
17 changed files with 410 additions and 52 deletions

View File

@@ -87,6 +87,17 @@ class StripeWebhookController extends Controller
return;
}
// Activate user if pending purchase
$user = \App\Models\User::where('id', $tenant->user_id ?? $userId)->first();
if ($user && $user->pending_purchase) {
$user->update([
'email_verified_at' => now(),
'role' => 'tenant_admin',
'pending_purchase' => false,
]);
Log::info('User activated after purchase: ' . $user->id);
}
// Create PackagePurchase for one-off payment
\App\Models\PackagePurchase::create([
'tenant_id' => $tenantId,
@@ -209,6 +220,18 @@ class StripeWebhookController extends Controller
return;
}
// Activate user if pending purchase
$tenant = \App\Models\Tenant::find($tenantId);
$user = $tenant ? $tenant->user : null;
if ($user && $user->pending_purchase) {
$user->update([
'email_verified_at' => now(),
'role' => 'tenant_admin',
'pending_purchase' => false,
]);
Log::info('User activated after subscription purchase: ' . $user->id);
}
// Activate TenantPackage for initial subscription
\App\Models\TenantPackage::updateOrCreate(
[