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

@section('details')

<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>
        <th></th>
      </tr>
    </thead>
    <tbody>
      @foreach($paymentMethod->financialTransactions as $transaction)
      <tr>
        <td>{{$transaction->created_at}}</td>
        <td><a href="{{ route('admin.orders.view.dashboard', $transaction->storeOrder) }}">{{ $transaction->storeOrder->id }}</a></td>
        <td><a href="{{ route('admin.payment-methods.view.dashboard', $transaction->paymentMethod) }}">{{ $transaction->paymentMethod->card_type }} ending in {{ $transaction->paymentMethod->card_last_four }}</a></td>
        <td>{{$transaction->amount}}</td>
        <td>{{$transaction->charge_or_refund}}</td>
        <td>{{$transaction->description}}</td>
        <td>
        @include('app.my-account.admin.orders.forms.create-refund', ['order' => $transaction->storeOrder, 'transaction' => $transaction])
        </td>
      </tr>
      @endforeach
    </tbody>
  </table>
</div>

@endsection