@extends('backend.p2p.layout') @php $countryOptions = collect(getCountries()) ->filter(fn ($country) => ! empty($country['code'])) ->sortBy(fn ($country) => (string) ($country['name'] ?? '')) ->values(); @endphp @section('title', __('P2P Payment Methods')) @section('p2p_title') {{ __('Payment Methods') }} @endsection @section('p2p_icon', 'payment') @section('p2p_action') @can('p2p-method-manage') @lang('Add method') @endcan @endsection @php $methodsTotal = method_exists($methods, 'total') ? (int) $methods->total() : $methods->count(); $methodItems = collect($methods->items() ?? $methods); $activeMethods = $methodItems->where('status', true)->count(); $inactiveMethods = max(0, $methodsTotal - $activeMethods); $logoVariant = function ($name) { $n = strtolower((string) $name); if (str_contains($n, 'bank') || str_contains($n, 'wire') || str_contains($n, 'transfer')) { return 'pm-card__logo--info'; } if (str_contains($n, 'mobile') || str_contains($n, 'wallet') || str_contains($n, 'pay')) { return 'pm-card__logo--success'; } if (str_contains($n, 'card') || str_contains($n, 'visa') || str_contains($n, 'master')) { return ''; } if (str_contains($n, 'cash')) { return 'pm-card__logo--info'; } if (str_contains($n, 'crypto') || str_contains($n, 'usdt') || str_contains($n, 'btc')) { return 'pm-card__logo--warning'; } return 'pm-card__logo--neutral'; }; @endphp @section('p2p_content')
@lang('Configured rails')
@lang('Available payment rails')
{{ number_format($methodsTotal) }} {{ trans_choice('total|total', $methodsTotal) }} @if($activeMethods > 0) {{ number_format($activeMethods) }} @lang('active') @endif @if($inactiveMethods > 0) {{ number_format($inactiveMethods) }} @lang('inactive') @endif
@if($methodsTotal > 0)
@foreach($methods as $method) @php $methodPayload = [ 'id' => $method->id, 'name' => $method->name, 'logo_url' => $method->logo ? asset('storage/'.$method->logo) : null, 'country' => $method->country, 'instructions' => $method->instructions, 'status' => (int) $method->status, ]; $isActive = (bool) $method->status; $countryLabel = $method->country ? (getCountryDisplayLabel($method->country) ?? $method->country) : __('All countries'); @endphp
{{ title($method->name) }} {{ $countryLabel }}
{{ $isActive ? __('Active') : __('Inactive') }} @can('p2p-method-manage')
@endcan
@endforeach
@if($methods->hasPages()) @endif @else @endif
{{-- Create Payment Method --}} {{-- Manage Payment Method --}} @endsection @push('scripts') @include('backend.p2p.payment_methods.partials._scripts') @endpush