@extends('layouts.app') @section('title', 'Billing') @section('content')

Billing

@if(!$isTenantAdmin)

Restricted

Only workspace admins can manage billing.

@else

Current plan

Workspace: {{ $tenant?->name ?? '—' }}

Plan: {{ ucfirst($tenant?->plan ?? config('plans.default_plan', 'default')) }}

@if($activeSub)

Active subscription expires {{ $activeSub->expires_at?->format('M j, Y') ?? '—' }}.

@else

No active subscription record yet.

@endif

Download payment history (CSV)

@if($razorpayKeyId === '')

Razorpay not configured

Set RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET in .env (backend only) to enable payments.

@endif @if($payments->isNotEmpty())

Recent payments

@foreach($payments as $p) @endforeach
Plan Amount Status Date
{{ ucfirst($p->plan_name) }} ₹{{ number_format($p->amount / 100, 2) }} {{ $p->currency }} {{ $p->status }} {{ $p->created_at->format('M j, Y H:i') }}
@endif

Upgrade plan (Razorpay)

Payments are processed by Razorpay. After successful payment, your workspace plan updates immediately.

@php $currentPlan = $tenant?->plan ?? config('plans.default_plan', 'default'); @endphp @forelse($plans as $planKey => $p)

{{ ucfirst($planKey) }}

@if(((int)($p['amount_paise'] ?? 0)) === 0) Free @else ₹{{ number_format(((int)($p['amount_paise'] ?? 0)) / 100, 2) }} / {{ (int)($p['duration_days'] ?? 30) }} days @endif

@if($currentPlan === $planKey)

Current plan

@elseif(((int)($p['amount_paise'] ?? 0)) === 0)

Free plan

@else @endif
@empty
No pricing configured.
@endforelse
@endif @endsection