@extends('layouts.app') @section('title', 'UPI Accounts') @section('subtitle', 'Payments go directly to these accounts. We never hold your money.') @section('actions') Add UPI account @endsection @section('content') @if ($accounts->isEmpty())
Add UPI account
@else @php $activeCount = $accounts->where('is_active', true)->count(); $totalLeft = $accounts->where('is_active', true)->sum(fn ($a) => $a->remainingToday() ?? INF); @endphp
@csrf
Account rotation

How new orders pick a UPI account when the API doesn't send payment_account_id. Accounts that reached their daily limit are skipped automatically.

{{ $activeCount }} active {{ Str::plural('account', $activeCount) }} · capacity left today: {{ is_infinite($totalLeft) ? 'Unlimited' : '₹'.number_format($totalLeft, 2) }}

@foreach (\App\Models\User::ROTATION_MODES as $mode => $label) @endforeach
@foreach ($accounts as $account) @php $auto = $account->provider !== 'manual'; $icon = ['paytm_business' => 'bolt', 'phonepe_pg' => 'shield', 'paytm_pg' => 'shield'][$account->provider] ?? 'qr'; @endphp
@if ($account->is_default) Default @endif {{ $account->is_active ? 'Active' : 'Disabled' }}
{{ $account->label }} ID {{ $account->id }}
@if ($account->upi_id) {{ $account->upi_id }} @else {{ $account->providerLabel() }} $account->environment() === 'production', 'bg-amber-50 text-amber-700' => $account->environment() === 'sandbox'])>{{ $account->environment() === 'production' ? 'Live' : 'Sandbox' }} @endif
Payee name
{{ $account->payee_name }}
Verification
{{ $account->isHosted() ? 'Official PG' : ($auto ? 'Automatic' : 'Manual (UTR)') }}
@if ($account->provider === 'phonepe_pg')
Client ID
{{ Str::mask($account->credential('client_id') ?? '', '•', 4, -4) }}
@elseif ($account->credential('mid'))
Paytm MID
{{ Str::mask($account->credential('mid') ?? '', '•', 4, -4) }}
@endif
Orders
{{ number_format($account->orders_count) }}
@php $used = $account->usedToday(); $limit = $account->daily_limit === null ? null : (float) $account->daily_limit; $pct = $limit ? min(100, $used / $limit * 100) : 0; $bar = $pct >= 100 ? 'bg-red-500' : ($pct >= 80 ? 'bg-amber-500' : 'bg-emerald-500'); @endphp
Used today ₹{{ number_format($used, 2) }} / {{ $limit === null ? 'No limit' : '₹'.number_format($limit) }}
@if ($limit !== null)
@if ($pct >= 100)
Limit reached — skipped until tomorrow
@endif @endif
@csrf
₹
@unless ($account->is_default)
@csrf
@endunless
@csrf
@if ($account->orders_count === 0)
@csrf @method('DELETE')
@endif
@endforeach
@endif @endsection