@extends('layouts.app') @section('title', __('Transaction #:id', ['id' => $transaction->id])) @section('content') @php $statusColors = [ 'pending' => 'bg-amber-100 text-amber-800', 'processing' => 'bg-blue-100 text-blue-800', 'succeeded' => 'bg-emerald-100 text-emerald-800', 'failed' => 'bg-rose-100 text-rose-800', 'canceled' => 'bg-slate-100 text-slate-700', 'refunded' => 'bg-violet-100 text-violet-800', ]; @endphp

{{ __('Transaction') }} #{{ $transaction->id }} {{ __($transaction->status) }}

{{ $transaction->created_at->format('Y-m-d H:i') }}

{{ __('Back') }}

{{ __('Summary') }}

{{ __('Tenant') }}
{{ $transaction->tenant?->name ?? '—' }}
{{ __('Plan') }}
{{ $transaction->plan?->displayName() ?? '—' }}
{{ __('Cycle') }}
{{ $transaction->cycle ? __($transaction->cycle) : '—' }}
{{ __('Purpose') }}
{{ __($transaction->purpose) }}
{{ __('Gateway') }}
{{ $transaction->gateway }}
{{ __('Amount') }}
{{ number_format((float) $transaction->amount, 2) }} {{ $transaction->currency }}
{{ __('Gateway ID') }}
{{ $transaction->gateway_id ?? '—' }}
{{ __('Session ID') }}
{{ $transaction->gateway_session_id ?? '—' }}
{{ __('Paid at') }}
{{ $transaction->paid_at?->format('Y-m-d H:i') ?? '—' }}
{{ __('Initiated by') }}
{{ $transaction->user?->name ?? '—' }}
@if($transaction->error_message)
{{ __('Last error') }}
{{ $transaction->error_message }}
@endif

{{ __('Subscription') }}

@if($transaction->subscription)
{{ $transaction->subscription->plan?->displayName() }} ({{ __($transaction->subscription->cycle) }})
{{ __('State') }}: {{ __($transaction->subscription->state) }}
{{ __('Open subscription') }} @else

{{ __('No subscription linked yet.') }}

@endif
@if(! empty($transaction->metadata))

{{ __('Metadata') }}

{{ json_encode($transaction->metadata, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }}
@endif @endsection