@extends('layouts.user_type.guest') @section('header_title', __('کیف پول')) @push('extra_css') @endpush @section('content') @php $currentPlan = $wallet->currentPlan; $planExpiresAt = $wallet->plan_expires_at ? \App\Helpers\xDate::jdate('j F Y', $wallet->plan_expires_at->timestamp) : __('بدون انقضا'); $oldPaymentMethod = old('payment_method'); $paymentMethods = $payment['methods'] ?? []; $paymentMethodKeys = array_column($paymentMethods, 'key'); $defaultPaymentMethod = in_array($oldPaymentMethod, $paymentMethodKeys, true) ? $oldPaymentMethod : ($paymentMethodKeys[0] ?? ''); $cardToCardActive = in_array('card_to_card', $paymentMethodKeys, true); $cardNumberRaw = trim((string) ($payment['card']['number'] ?? '')); $cardNumberDigits = preg_replace('/\D+/', '', $cardNumberRaw); $cardNumberDisplay = $cardNumberDigits !== '' ? trim(chunk_split($cardNumberDigits, 4, ' ')) : $cardNumberRaw; $cardShebaRaw = strtoupper(trim((string) ($payment['card']['sheba'] ?? ''))); $cardShebaCompact = preg_replace('/\s+/', '', $cardShebaRaw); $cardShebaDisplay = $cardShebaCompact !== '' ? trim(chunk_split($cardShebaCompact, 4, ' ')) : ''; @endphp
@include('user.user_menu') @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@foreach($errors->all() as $error)
{{ $error }}
@endforeach
@endif
{{ __('کیف پول کاربری') }}

{{ $wallet->balance_formatted }}

{{ __('موجودی کیف پول برای خرید پلن ها و سرویس های حساب کاربری استفاده می شود.') }}

{{ __('پلن فعلی') }} {{ $currentPlan?->name ?? __('بدون پلن فعال') }} {{ __('وضعیت') }}: {{ $wallet->plan_status_label }} @if($currentPlan)
{{ __('پایان اعتبار') }}: {{ $planExpiresAt }} @endif
{{ number_format($summary['paid_credit']) }} {{ __('تومان') }} {{ __('کل شارژهای تایید شده') }}
{{ number_format($summary['paid_debit']) }} {{ __('تومان') }} {{ __('هزینه خرید پلن ها') }}
{{ $summary['pending_count'] }} {{ __('تراکنش در انتظار') }}

{{ __('شارژ کیف پول') }}

{{ __('درخواست پرداخت') }}
@csrf
@if($paymentMethods)
@foreach($paymentMethods as $method) @endforeach
@else
{{ __('هیچ روش شارژی توسط مدیریت فعال نشده است.') }}
@endif @if($cardToCardActive) @endif
{{ __('پرداخت آنلاین پس از تایید درگاه به صورت خودکار کیف پول را شارژ می کند.') }} @if($cardToCardActive) {{ __('کارت به کارت پس از تایید رسید توسط مدیریت شارژ می شود.') }} @endif

{{ __('جزئیات پلن فعلی') }}

{{ $wallet->plan_status_label }}
@if($currentPlan)
{{ $currentPlan->price_formatted }} {{ __('قیمت پلن') }}
{{ $currentPlan->duration_label }} {{ __('مدت اعتبار') }}
{{ $planExpiresAt }} {{ __('پایان اعتبار') }}
{{ __('میزان استفاده از پلن در ماه جاری') }} {{ __('دیدن لایو') }}: {{ $planUsage['can_watch_lives'] ? __('دارد') : __('ندارد') }}
@foreach($planUsage['items'] as $usage) @php $limit = $usage['limit']; $used = $usage['used']; $isUnlimited = $limit === null; $percent = $isUnlimited ? 100 : ($limit > 0 ? min(100, round(($used / $limit) * 100)) : ($used > 0 ? 100 : 0)); $limitLabel = $isUnlimited ? __('نامحدود') : number_format($limit); $remainingLabel = $isUnlimited ? __('نامحدود') : number_format(max($limit - $used, 0)); @endphp
{{ $usage['title'] }} {{ number_format($used) }} / {{ $limitLabel }}
{{ __('استفاده شده') }}: {{ number_format($used) }} {{ __('باقی مانده') }}: {{ $remainingLabel }}
@endforeach
@if($currentPlan->features)
    @foreach($currentPlan->features as $feature)
  • {{ $feature }}
  • @endforeach
@endif @else
{{ __('هنوز هیچ پلنی برای حساب شما فعال نشده است.') }}
@endif

{{ __('پلن های قابل خرید') }}

{{ __('خرید از موجودی کیف پول انجام می شود.') }}
@forelse($plans as $plan) @php $isCurrent = $wallet->isPlanActive() && $wallet->current_plan_id === $plan->id; $canBuy = $wallet->balance >= $plan->price; @endphp

{{ $plan->name }}

{{ $plan->duration_label }}
@if($isCurrent) {{ __('فعال') }} @endif

{{ $plan->description ?: __('پلن قابل خرید برای حساب کاربری') }}

{{ $plan->price_formatted }}
  • {{ __('دیدن لایو') }}: {{ $plan->can_watch_lives ? __('دارد') : __('ندارد') }}
  • {{ __('ساخت لایو در ماه') }}: {{ $plan->monthly_live_create_limit_label }}
  • {{ __('لایو فروشی در ماه') }}: {{ $plan->monthly_paid_live_create_limit_label }}
  • @forelse($plan->features ?? [] as $feature)
  • {{ $feature }}
  • @empty
  • {{ __('دسترسی طبق تنظیمات پلن') }}
  • @endforelse
@csrf
@empty
{{ __('هنوز پلنی توسط مدیریت تعریف نشده است.') }}
@endforelse

{{ __('تاریخچه تراکنش ها') }}

{{ __(':count تراکنش', ['count' => $transactions->total()]) }}
@forelse($transactions as $transaction) @php $isDebit = in_array($transaction->type, [ \App\Models\WalletTransaction::TYPE_PLAN_PURCHASE, \App\Models\WalletTransaction::TYPE_LIVE_ENTRY, ], true); $statusClass = match($transaction->status) { \App\Models\WalletTransaction::STATUS_PAID => 'bg-success', \App\Models\WalletTransaction::STATUS_FAILED => 'bg-danger', \App\Models\WalletTransaction::STATUS_CANCELED => 'bg-secondary', default => 'bg-warning', }; @endphp @empty @endforelse
{{ __('تراکنش') }} {{ __('مبلغ') }} {{ __('پلن') }} {{ __('روش') }} {{ __('وضعیت') }} {{ __('تاریخ') }} {{ __('مانده') }}
{{ $transaction->title }} {{ $transaction->type_label }} - {{ $transaction->reference }} {{ $isDebit ? '-' : '+' }}{{ $transaction->amount_formatted }} {{ $transaction->plan?->name ?? '-' }} {{ $transaction->payment_method_label }} {{ $transaction->status_label }} {{ \App\Helpers\xDate::jdate('j F Y H:i', $transaction->created_at->timestamp) }} {{ number_format($transaction->balance_after) }} {{ __('تومان') }}
{{ __('هنوز تراکنشی برای کیف پول شما ثبت نشده است.') }}
@if($transactions->hasPages())
{{ __('قبلی') }} {{ __('صفحه :current از :last', ['current' => $transactions->currentPage(), 'last' => $transactions->lastPage()]) }} {{ __('بعدی') }}
@endif
@push('extra_js') @endpush @endsection