@extends('central.super.layout') @section('title', __('super.payments.show_title')) @section('content')
{{-- Main info --}}

{{ __('super.payments.payment_info') }}

{{ ucfirst($payment->status) }}
{{-- Amount highlight --}}
{{ __('super.common.amount') }}
{{ $payment->currency }} {{ $currencySymbol }}{{ number_format($payment->amount, 2) }}
@if($payment->tax > 0)
+ {{ $currencySymbol }}{{ number_format($payment->tax, 2) }} {{ __('super.payments.tax') }} = {{ $currencySymbol }}{{ number_format($payment->total, 2) }} {{ __('super.payments.total') }}
@endif
{{ $payment->invoice_number }}
{{ ucfirst($payment->billing_cycle) }}
{{-- Details grid --}}
{{ __('super.payments.gateway') }}
{{ $payment->gateway_label }}
@if($payment->gateway === 'manual' && isset($payment->metadata['offline_method']))
{{ ucfirst(str_replace('_', ' ', $payment->metadata['offline_method'])) }}
@endif
{{ __('super.payments.billing_cycle') }}
{{ ucfirst($payment->billing_cycle) }}
@if($payment->gateway_payment_id || $payment->transaction_id)
@if($payment->gateway_payment_id)
{{ __('super.payments.gateway_payment_id') }}
{{ $payment->gateway_payment_id }}
@endif @if($payment->transaction_id)
{{ __('super.payments.transaction_id_label') }}
{{ $payment->transaction_id }}
@endif
@endif {{-- Timestamps --}}
@if($payment->paid_at)
{{ __('super.payments.paid_at') }}
{{ $payment->paid_at->format('M d, Y') }}
{{ $payment->paid_at->format('h:i A') }}
@endif
{{ __('super.payments.created') }}
{{ $payment->created_at->format('M d, Y') }}
{{ $payment->created_at->format('h:i A') }}
{{ __('super.payments.updated') }}
{{ $payment->updated_at->format('M d, Y') }}
{{ $payment->updated_at->format('h:i A') }}
@if($payment->notes)
{{ __('super.common.notes') }}
{{ $payment->notes }}
@endif
{{-- Proof of Payment --}} @php $proofPath = $payment->payment_proof_path ?: (in_array($payment->gateway, ['manual', 'offline']) && !empty($payment->metadata['payment_proof']) ? $payment->metadata['payment_proof'] : null); @endphp @if($proofPath)

{{ __('super.payments.proof_of_payment') }}

@if(in_array($payment->gateway, ['offline', 'manual']) && $payment->status === 'pending') Awaiting Verification @endif
@php $ext = strtolower(pathinfo($proofPath, PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg', 'jpeg', 'png', 'webp']); @endphp @if($isImage) Payment Proof @else {{ __('super.payments.view_proof_pdf') }} @endif @if(in_array($payment->gateway, ['offline', 'manual']) && $payment->status === 'pending')
@csrf
@csrf
@endif
@endif
{{-- Sidebar --}}
{{-- Tenant info --}}

{{ __('super.payments.tenant') }}

@if($payment->tenant) @php $tenantDomain = $payment->tenant->domains->isNotEmpty() ? $payment->tenant->domains->first()->domain : null; $tenantDisplayName = $payment->tenant->company_name ?? ($tenantDomain ?? $payment->tenant_id); $color = ['purple','blue','teal','green','amber'][crc32($tenantDisplayName) % 5]; @endphp
{{ strtoupper(mb_substr($tenantDisplayName, 0, 2)) }}

{{ $tenantDisplayName }}

@if($tenantDomain)

{{ $tenantDomain }}

@endif @if($payment->tenant->admin_email)

{{ $payment->tenant->admin_email }}

@endif
{{ __('super.payments.view_tenant') }} @else

{{ __('super.payments.tenant_not_found') }}

@endif
{{-- Subscription info --}} @if($payment->subscription)

{{ __('super.subscriptions.subscription') }}

@php $subBadgeClass = match($payment->subscription->status) { 'active' => 'yes', 'trial' => 'info', 'pending' => 'pending', 'cancelled' => 'no', 'suspended' => 'pending', 'expired' => 'no', default => 'secondary', }; @endphp {{ ucfirst($payment->subscription->status) }}
@if($payment->subscription->plan)

{{ $payment->subscription->plan->name }}

@endif

{{ ucfirst($payment->subscription->billing_cycle) }} billing

@if($payment->subscription->ends_at)

Ends {{ $payment->subscription->ends_at->format('M d, Y') }}

@endif {{ __('super.common.view') }} {{ __('super.subscriptions.subscription') }}
@endif {{-- Plan info --}}

{{ __('super.payments.plan') }}

@if($payment->plan)

{{ $payment->plan->name }}

{{ $currencySymbol }}{{ number_format($payment->plan->price, 2) }}/{{ __('super.plans.mo') }} ยท {{ $currencySymbol }}{{ number_format($payment->plan->yearly_price, 2) }}/{{ __('super.plans.yr') }}

@else

{{ __('super.payments.no_plan_linked') }}

@endif
{{-- Actions --}}

{{ __('super.common.actions') }}

@if($payment->status === 'pending')
@csrf
@endif @if($payment->status === 'pending')
@csrf
@endif @if($payment->status === 'paid')
@csrf
@endif {{ __('super.payments.download_invoice_pdf') }}
@push('scripts') @endpush @endsection