@php $currency = siteUrlSettings('site_currency') ?: 'KES'; @endphp
@if (session()->has('error'))
{{ session('error') }}
@endif @if (!$customer)

Customer profile not found

Your connection is active but is not linked to a customer profile. Please contact support.

@elseif (!$billing)

Billing record not found

We couldn't locate your billing records. Please contact support.

@else @php $dueAmount = (float) ($billing->due_amount ?? 0); $monthlyRent = (float) ($billing->monthly_rent ?? 0); $statusActive = ($customer->status ?? '') === 'active'; @endphp
Connection {{ $statusActive ? 'Active' : 'Suspended' }}
Outstanding balance {{ $currency }} {{ number_format($dueAmount, 2) }}
Monthly plan {{ $currency }} {{ number_format($monthlyRent, 2) }}

Account details


Account number
{{ $customer->customer_unique_id ?? 'N/A' }}
Account status
{{ ucfirst($customer->status ?? 'unknown') }}
Live session
@php $sessionStyles = [ 'online' => ['cp-bg-emerald-500/10 cp-text-emerald-600 dark:cp-text-emerald-400', 'cp-bg-emerald-500', 'Online'], 'offline' => ['cp-bg-rose-500/10 cp-text-rose-600 dark:cp-text-rose-400', 'cp-bg-rose-500', 'Offline'], 'checking...' => ['cp-bg-gray-500/10 cp-text-gray-600 dark:cp-text-slate-400', 'cp-bg-gray-400', 'Checking'], ]; [$badge, $dot, $label] = $sessionStyles[$connectionStatus] ?? ['cp-bg-amber-500/10 cp-text-amber-600 dark:cp-text-amber-400', 'cp-bg-amber-500', 'Unknown']; @endphp {{ $label }}
Username
{{ $customer->pppUser?->username ?? 'N/A' }}
Full name
{{ $customer->customer_name ?? 'N/A' }}
Registered mobile
{{ $customer->mobile ?? 'N/A' }}
Current package
{{ $customer->pppUser?->profile ?? 'N/A' }}
Email
{{ $customer->email ?: '—' }}
Expires on
{{ $billing->auto_disable_date ? \Carbon\Carbon::parse($billing->auto_disable_date)->format('d M Y') : 'N/A' }}

Pay with M-Pesa

M-Pesa

@if (!$this->isGatewayEnabled())
M-Pesa unavailable Online payments are currently offline. Please contact support.
@elseif ($stkStatus === 'pending') {{-- Waiting on the customer's PIN / Safaricom --}}

Waiting for confirmation

{{ $statusMessage ?: 'Check your phone and enter your M-Pesa PIN to approve the payment.' }}

Sent to {{ $phone }} · {{ $currency }} {{ number_format((float) $amount, 2) }}

@elseif ($stkStatus === 'success')

Payment received

{{ $statusMessage }}

Your connection has been updated.

@elseif (in_array($stkStatus, ['failed', 'cancelled']))

{{ $stkStatus === 'cancelled' ? 'Payment cancelled' : 'Payment not completed' }}

{{ $statusMessage }}

@if ($transactionId) @endif
@else
{{ $currency }}
@error('amount') {{ $message }} @enderror
@if ($dueAmount > 0) @endif @if ($monthlyRent > 0) @endif
@error('phone') {{ $message }} @enderror

A payment prompt will be sent to this number.

@endif
@endif