@extends('layouts.admin') @section('title', 'Transaction Details') @section('admin-content')

Transaction #{{ $transaction->id }}

@if($transaction->status === 'pending_approval') @endif Back
{{-- Transaction Info --}}
Payment Details
{{ ucfirst(str_replace('_', ' ', $transaction->status)) }}

{{ $transaction->created_at->format('F d, Y h:i A') }}

₹{{ number_format($transaction->total_amount, 2) }}

{{ str_replace('_', ' ', $transaction->payment_method ?? 'N/A') }} ({{ ucfirst($transaction->payment_gateway) }})

{{ $transaction->payment_id ?? 'N/A' }}

@if($transaction->order_id)

{{ $transaction->order_id }}

@endif @if($transaction->failure_reason)
Failure Reason: {{ $transaction->failure_reason }}
@endif
{{-- Breakdown --}}
Payment Breakdown
Base Amount ₹{{ number_format($transaction->amount, 2) }}
Platform Commission + ₹{{ number_format($transaction->platform_commission, 2) }}
GST ({{ $transaction->gst_percentage ?? 18 }}%) + ₹{{ number_format($transaction->gst_amount, 2) }}
Total Paid ₹{{ number_format($transaction->total_amount, 2) }}
{{-- User Info --}}
Payer Information
{{ substr($transaction->user->name ?? 'U', 0, 1) }}
{{ $transaction->user->name ?? 'Unknown User' }}
{{ $transaction->user->email ?? '' }}
@if($transaction->seller)

Seller Profile:

{{ $transaction->seller->company_name }} @endif
{{-- Item Details --}}
Item Details
@if($transaction->transaction_type === 'promotion') Promotion
{{ $transaction->productPromotion->package->name ?? $transaction->metadata['package_name'] ?? 'Unknown Package' }}

Products: {{ $transaction->metadata['product_count'] ?? 0 }}
Duration: {{ $transaction->metadata['duration_days'] ?? 0 }} Days

@elseif($transaction->transaction_type === 'subscription') Subscription
{{ $transaction->subscription?->plan->name ?? $transaction->metadata['plan_name'] ?? 'Unknown Plan' }}

Duration: {{ $transaction->metadata['duration_days'] ?? 30 }} Days
Valid Until: @if($transaction->subscription && $transaction->subscription->end_date) {{ $transaction->subscription->end_date->format('M d, Y') }} @else Pending Activation @endif

@else {{ ucfirst($transaction->transaction_type) }} @endif
@endsection