@extends('admin.layouts.app') @section('title', 'M-PESA') @section('content') @php use Modules\Gateways\Mpesa\Services\Money; @endphp @include('mpesa::admin._nav', ['title' => __('mpesa::mpesa.nav.dashboard')])
@include('mpesa::admin._badge', ['value' => $healthWorst, 'group' => 'health_status']) {{ __('mpesa::mpesa.nav.health') }}
@foreach([ [__('mpesa::mpesa.dash.gross'), Money::format($stats['gross']), __('mpesa::mpesa.dash.gross_hint', ['count' => $stats['count']])], [__('mpesa::mpesa.dash.reversed'), Money::format($stats['reversed']), __('mpesa::mpesa.dash.reversed_hint', ['count' => $stats['reversals_done']])], [__('mpesa::mpesa.dash.net'), Money::format($stats['net']), __('mpesa::mpesa.dash.net_hint')], [__('mpesa::mpesa.dash.unallocated'), Money::format($stats['unallocated_amount']), __('mpesa::mpesa.dash.unallocated_hint', ['count' => $stats['unallocated'] + $stats['review']])], ] as [$label, $value, $hint])
{{ $label }}
{{ $value }}
{{ $hint }}
@endforeach
{{ __('mpesa::mpesa.dash.counts') }}
@foreach(['succeeded', 'pending', 'failed', 'cancelled', 'expired', 'unknown'] as $s) @endforeach
{{ __('mpesa::mpesa.dash.confirmed') }}{{ $stats['count'] }}
{{ __('mpesa::mpesa.dash.allocated') }}{{ $stats['allocated'] }}
{{ __('mpesa::mpesa.dash.review') }}{{ $stats['review'] }}
{{ __('mpesa::mpesa.dash.unverified') }}{{ $stats['unverified'] }}
{{ __('mpesa::mpesa.dash.rejected') }}{{ $stats['rejected'] }}
{{ __('mpesa::mpesa.dash.stk', ['status' => __('mpesa::mpesa.request_status.'.$s)]) }}{{ $stats['stk'][$s] ?? 0 }}
{{ __('mpesa::mpesa.dash.reversals_open') }}{{ $stats['reversals_open'] }}
{{ __('mpesa::mpesa.dash.discrepancies') }}{{ $stats['discrepancies'] }}
{{ __('mpesa::mpesa.dash.callback_failures') }}{{ $stats['callback_failures'] }}
{{ __('mpesa::mpesa.dash.api_errors') }}{{ $stats['api_failed'] }} / {{ $stats['api_total'] }}@if($stats['api_total']) ({{ round($stats['api_failed'] * 100 / $stats['api_total']) }}%)@endif
{{ __('mpesa::mpesa.dash.needs_attention') }}
@forelse($needsReview as $tx) @empty @endforelse @foreach($pendingReversals as $r) @endforeach
{{ $tx->receipt }} {{ Money::format(Money::minor($tx->amount)) }} @include('mpesa::admin._badge', ['value' => $tx->allocation_status, 'group' => 'allocation'])
{{ __('mpesa::mpesa.dash.nothing') }}
{{ $r->transaction?->receipt }} {{ __('mpesa::mpesa.dash.reversal') }} {{ Money::format(Money::minor($r->amount)) }} @include('mpesa::admin._badge', ['value' => $r->status, 'group' => 'reversal'])
{{ __('mpesa::mpesa.dash.recent_api_failures') }}
@forelse($recentFailures as $log) @empty @endforelse
{{ $log->created_at?->format('Y-m-d H:i') }} {{ \Illuminate\Support\Str::limit($log->action, 60) }}
{{ __('mpesa::mpesa.dash.nothing') }}
@endsection