@extends('layouts.user')
@section('title', __('user.transaction_history_title'))
@section('content')
{{ __('user.quick_filter') }}
{{ __('user.recent_transactions') }}
@forelse($payments as $payment)
{{ __('user.payment_method') }}
@if($payment->type === 'card')
{{ __('user.card_recharge_method') }}
@elseif($payment->type === 'banking')
{{ __('user.bank_transfer_method') }}
@elseif($payment->type === 'privilege')
@php
$paymentData = json_decode($payment->payment_data, true);
@endphp
{{ $paymentData['package_name'] ?? 'Đặc quyền' }}
@if(isset($paymentData['character_name']))
Nhân vật: {{ $paymentData['character_name'] }}
@endif
@elseif($payment->type === 'momo')
{{ __('user.momo_wallet') }}
@else
{{ ucfirst($payment->type) }}
@endif
{{ __('user.transaction_status') }}
@if($payment->status === 'completed')
{{ __('user.status_completed') }}
@elseif($payment->status === 'pending')
{{ __('user.status_pending') }}
@elseif($payment->status === 'processing')
{{ __('user.status_pending') }}
@else
{{ __('user.status_failed') }}
@endif
{{ __('user.amount_label') }}
{{ number_format($payment->amount_vnd) }} {{ __('user.vnd_currency') }}
{{ __('user.time_label') }}
@if($payment->created_at)
@if(is_string($payment->created_at))
{{ \Carbon\Carbon::parse($payment->created_at)->format('d/m/Y H:i') }}
@else
{{ $payment->created_at->format('d/m/Y H:i') }}
@endif
@else
N/A
@endif
@if($payment->payment_data)
@php
$paymentData = is_string($payment->payment_data) ? json_decode($payment->payment_data, true) : $payment->payment_data;
@endphp
@if($paymentData && is_array($paymentData))
@if(isset($paymentData['telco']))
Nhà mạng
{{ $paymentData['telco'] }}
@endif
@if(isset($paymentData['serial']))
Serial
{{ substr($paymentData['serial'], 0, 6) }}***
@endif
@endif
@endif
@empty
{{ __('user.no_transactions_title') }}
{{ __('user.transaction_history_empty') }}
@endforelse