Update: 2026-05-09 17:21:01
This commit is contained in:
@@ -230,6 +230,11 @@ final class QuotaMiddleware
|
||||
$companiesLimit = (int)$sub['max_companies'];
|
||||
$usersLimit = (int)($sub['max_users'] ?? 999);
|
||||
|
||||
// Check for pending payment request
|
||||
$stmt = $db->prepare("SELECT id, plan_id, internal_reference FROM payment_requests WHERE tenant_id = ? AND status = 'pending' LIMIT 1");
|
||||
$stmt->execute([$tenantId]);
|
||||
$pendingPayment = $stmt->fetch();
|
||||
|
||||
return [
|
||||
'has_subscription' => true,
|
||||
'plan_id' => $sub['plan_id'] ?? 'free',
|
||||
@@ -239,6 +244,11 @@ final class QuotaMiddleware
|
||||
'status' => $sub['status'],
|
||||
'ai_features' => (bool)($sub['ai_features'] ?? false),
|
||||
'jofotara_enabled' => (bool)($sub['jofotara_enabled'] ?? false),
|
||||
'pending_payment' => $pendingPayment ? [
|
||||
'id' => $pendingPayment['id'],
|
||||
'plan_id' => $pendingPayment['plan_id'],
|
||||
'reference' => $pendingPayment['internal_reference']
|
||||
] : null,
|
||||
|
||||
'invoices' => [
|
||||
'used' => $invoicesUsed,
|
||||
|
||||
Reference in New Issue
Block a user