mehr übersetzungen, added pending purchase indicator. datenschutzfenster funktioniert.
This commit is contained in:
@@ -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(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user