@if($setupModalVisible)
@if(count($this->gateways) > 1) @foreach($this->gateways as $gateway) @endforeach @elseif(count($this->gateways) === 0)

{{ __('account.no_payment_gateways_available') }}

@endif
{{ __('account.setup_payment_method') }}
@if ($this->setup)
{{ $this->setup }}
@endif
@endif

{{ __('account.saved_payment_methods') }}

{{ __('account.saved_payment_methods_description') }}

@if(count($this->gateways) > 0) {{ __('account.add_payment_method') }} @endif
@php $groupedAgreements = $billingAgreements->groupBy('gateway.name'); @endphp @if($groupedAgreements->count() > 0) @foreach($groupedAgreements as $gatewayName => $agreements)
@if($agreements->first()?->gateway?->meta?->icon) {{ $gatewayName }} @else @endif

{{ $gatewayName }}

{{ $agreements->count() }}
@foreach($agreements as $agreement)
@switch(strtolower($agreement->type)) @case('visa')@break @case('mastercard')@break @case('amex')@break @case('american express')@break @case('discover')@break @case('paypal')@break @case('sepa_debit')@break @case('ideal')@break @case('bancontact')@break @case('sofort')@break @case('us_bank_account') @case('bacs_debit') @case('au_becs_debit')@break @default @endswitch
{{ $agreement->name }}
@if($agreement->expiry)
{{ __('account.expires', ['date' => \Carbon\Carbon::parse($agreement->expiry)->format('m/Y')]) }}
@endif @if($agreement->services()->count() > 0)
{{ __('account.services_linked', ['count' => $agreement->services()->count()]) }}
@endif
@endforeach @endforeach @else

{{ __('account.no_saved_payment_methods') }}

@endif

{{ __('account.recent_transactions') }}

@foreach ($transactions as $transaction)
{{ $transaction->transaction_id ? 'Transaction: ' . $transaction->transaction_id : 'Transaction ID N/A' }} {{ $transaction->formattedAmount }} using {{ $transaction->gateway ? $transaction->gateway->name : 'N/A' }}
@if($transaction->status === \App\Enums\InvoiceTransactionStatus::Succeeded) {{ __('invoices.transaction_statuses.succeeded') }} @elseif($transaction->status === \App\Enums\InvoiceTransactionStatus::Processing) {{ __('invoices.transaction_statuses.processing') }} @elseif($transaction->status === \App\Enums\InvoiceTransactionStatus::Failed) {{ __('invoices.transaction_statuses.failed') }} @endif {{ $transaction->created_at->format('d M Y H:i') }}
@endforeach {{ $transactions->links() }}