@extends('layouts.main') @section('title', 'Transaction Details - Prolytics Connect') @section('content')

Transaction Details

Transaction Information

#{{ $transaction->id }}

{{ $transaction->company->name }}

{{ $transaction->company->email }}

{{ $transaction->subscriptionPlan->title ?? 'N/A' }}
@if($transaction->type === 'subscription') New Subscription @elseif($transaction->type === 'upgrade') Upgrade @elseif($transaction->type === 'cancellation') Cancellation @elseif($transaction->type === 'renewal') Renewal @else {{ ucfirst($transaction->type) }} @endif

@if($transaction->status === 'succeeded') Succeeded @elseif($transaction->status === 'failed') Failed @elseif($transaction->status === 'pending') Pending @else {{ ucfirst($transaction->status) }} @endif

${{ number_format($transaction->amount, 2) }} {{ strtoupper($transaction->currency) }}

{{ $transaction->paid_at ? $transaction->paid_at->format('M j, Y \a\t g:i A') : $transaction->created_at->format('M j, Y \a\t g:i A') }}

@if($transaction->reason) {{ str_replace('_', ' ', ucwords($transaction->reason, '_')) }} @else - @endif

{{ $transaction->description ?? '-' }}

Stripe References

@if($transaction->stripe_payment_intent_id)

{{ $transaction->stripe_payment_intent_id }}

@endif @if($transaction->stripe_subscription_id)

{{ $transaction->stripe_subscription_id }}

@endif
@if($transaction->stripe_invoice_id)

{{ $transaction->stripe_invoice_id }}

@endif @if($transaction->company->stripe_customer_id)

{{ $transaction->company->stripe_customer_id }}

@endif
@if($relatedTransactions->count() > 0)

Related Transactions ({{ $transaction->company->name }})

@foreach($relatedTransactions as $relatedTransaction) @endforeach
ID Type Plan Amount Status Date
#{{ $relatedTransaction->id }} @if($relatedTransaction->type === 'subscription') New @elseif($relatedTransaction->type === 'upgrade') Upgrade @elseif($relatedTransaction->type === 'cancellation') Cancel @else {{ ucfirst($relatedTransaction->type) }} @endif {{ $relatedTransaction->subscriptionPlan->title ?? 'N/A' }} ${{ number_format($relatedTransaction->amount, 2) }} @if($relatedTransaction->status === 'succeeded') @else @endif {{ $relatedTransaction->paid_at ? $relatedTransaction->paid_at->format('M j, Y') : $relatedTransaction->created_at->format('M j, Y') }}
@endif

Actions

Back to Transactions @if($transaction->stripe_payment_intent_id) View Payment in Stripe @endif @if($transaction->stripe_subscription_id) View Subscription in Stripe @endif @if($transaction->company->stripe_customer_id) View Customer in Stripe @endif
Transaction Summary
Time Since Transaction: {{ $transaction->created_at->diffForHumans() }}
Payment Method: {{ $transaction->payment_method ?? 'Card' }}
@if($transaction->reason)
Transaction Reason: {{ str_replace('_', ' ', ucwords($transaction->reason, '_')) }}
@endif
@php $companyStats = [ 'total_transactions' => \App\Models\Transaction::where('company_id', $transaction->company_id)->count(), 'total_spent' => \App\Models\Transaction::where('company_id', $transaction->company_id)->where('status', 'succeeded')->sum('amount'), 'first_transaction' => \App\Models\Transaction::where('company_id', $transaction->company_id)->oldest()->first() ]; @endphp
Company Overview
Total Transactions: {{ $companyStats['total_transactions'] }}
Total Spent: ${{ number_format($companyStats['total_spent'], 2) }}
@if($companyStats['first_transaction'])
Customer Since: {{ $companyStats['first_transaction']->created_at->format('M Y') }}
@endif
@if(isset($stripeData['error']))

Stripe Error

{{ $stripeData['error'] }}

@endif
@endsection