@php
$subscription = $subscriptionPaymentData['subscription'] ?? null;
$latestPayment = $subscriptionPaymentData['latest_payment'] ?? null;
$pendingPayment = $subscriptionPaymentData['pending_payment'] ?? null;
$daysRemaining = $subscription ? $subscription->days_remaining : null;
$paymentActionLabel = 'Pay Early with PesaPal';
$paymentHint = 'You are still safe. You can pay early to avoid service interruptions.';
$paymentToneClass = 'alert-info';
if ($daysRemaining !== null) {
if ($daysRemaining < 0) {
$paymentActionLabel = 'Pay Outstanding with PesaPal';
$paymentHint = 'Your subscription is overdue. Pay now to restore/keep service access.';
$paymentToneClass = 'alert-danger';
} elseif ($daysRemaining <= 7) {
$paymentActionLabel = 'Renew Now with PesaPal';
$paymentHint = 'Your subscription is close to expiry. Renew now to avoid downtime.';
$paymentToneClass = 'alert-warning';
}
}
@endphp
{{ $paymentHint }}
@if(!$subscription)
No active subscription record found for this hotel.
@else
Current Subscription
Plan: {{ ucfirst((string) $subscription->plan_name) }}
Amount: UGX {{ number_format((float) $subscription->plan_price, 0) }}
Status: {{ ucfirst((string) $subscription->status) }}
Expiry: {{ $subscription->end_date ? \Carbon\Carbon::parse($subscription->end_date)->format('d M Y') : 'N/A' }}
Days Remaining:
@if($daysRemaining !== null)
{{ $daysRemaining }}
@else
N/A
@endif
Latest Payment
@if($latestPayment)
Reference: {{ $latestPayment->payment_number }}
Amount: UGX {{ number_format((float) $latestPayment->amount, 0) }}
Status: {{ ucfirst((string) $latestPayment->status) }}
Date: {{ \Carbon\Carbon::parse($latestPayment->payment_date)->format('d M Y') }}
@else
No previous payment found.
@endif
@if($pendingPayment)
Pending payment exists: {{ $pendingPayment->payment_number }}
@endif
@endif