@php $categories = [ 'popular' => ['label' => __('Popular'), 'icon' => 'M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z'], 'regional' => ['label' => __('Regional'), 'icon' => 'M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9'], 'crypto' => ['label' => __('Crypto'), 'icon' => 'M13 10V3L4 14h7v7l9-11h-7z'], 'other' => ['label' => __('Other'), 'icon' => 'M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2'], ]; $grouped = $gateways->groupBy(fn($g) => $g->category ?? 'other'); @endphp
{{-- Flash --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header + Search --}}

{{ __('Gateway Directory') }}

{{ $gateways->count() }} {{ __('gateways available.') }} {{ $gateways->where('is_active', true)->count() }} {{ __('active.') }}

{{-- Category Tabs --}}
@foreach($categories as $catKey => $cat) @php $catCount = ($grouped[$catKey] ?? collect())->count(); @endphp @endforeach
{{-- Gateway List per Category --}} @foreach($categories as $catKey => $cat)
@foreach($grouped[$catKey] ?? [] as $gateway)
{{-- Header --}}
@csrf
{{-- Expanded Config Form --}}
@csrf

{{ __('Environment') }}

@if(!empty($gateway->supported_currencies))

{{ __('Supported Currencies') }}

@foreach($gateway->supported_currencies as $cur) {{ $cur }} @endforeach
@endif @if(count($gateway->credentialFields ?? []) > 0)

{{ __('Credentials') }}

@foreach($gateway->credentialFields as $field)
@if(($field['type'] ?? 'text') === 'password')
@if(!empty($gateway->decryptedCredentials[$field['key']]))

{{ __('Saved (hidden). Leave blank to keep current value.') }}

@endif @else @endif @if(!empty($field['hint']))

{{ $field['hint'] }}

@endif
@endforeach
@else
{{ __('No driver found for') }} {{ $gateway->slug }}. Create App\Services\Payment\Drivers\{{ \Illuminate\Support\Str::studly($gateway->slug) }}Driver
@endif
@endforeach @if(($grouped[$catKey] ?? collect())->isEmpty())

No {{ strtolower($cat['label']) }} gateways found.

@endif
@endforeach