@extends('app.my-account.admin.orders.single')

@section('details')

<div class="my-4">
    <h4><b>Financial Transactions</b></h4>
    <div class="table-responsive">
        <table class="table table-sm table-hover table-striped table-bordered mb-0">
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Order</th>
                    <th>Payment Method</th>
                    <th>Amount</th>
                    <th>Charge or Refund</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>
                @foreach($transactions as $transaction)
                <tr>
                    <td>{{$transaction->created_at}}</td>
                    <td><a href="{{ route('admin.orders.view.dashboard', $transaction->storeOrder) }}">{{ $transaction->storeOrder->iid }}</a></td>
                    <td><a href="{{ route('admin.payment-methods.view.dashboard', $transaction->paymentMethod) }}">{{ $transaction->paymentMethod->card_type }} ending in {{ $transaction->paymentMethod->cardLast4() }}</a></td>
                    <td>{{$transaction->amount}}</td>
                    <td>{{$transaction->charge_or_refund}}</td>
                    <td>{{$transaction->description}}</td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>

@endsection