@extends('layouts.admin') @section('title', setting('school_name', 'ShulePoint') . ' | Record Payment') @section('page-title', 'Record Payment') @section('content')

Payment details

* required
@csrf
{{-- Step 1: find the learner (live AJAX search) --}}
@if($preselectedLearner ?? null) {{ $preselectedLearner->full_name }} · {{ $preselectedLearner->admission_no }}@if($preselectedLearner->schoolClass) · {{ $preselectedLearner->schoolClass->name }}@endif @if($preselectedLearner->guardian_phone)@endif @endif
@error('invoice_id'){{ $message }}@enderror
{{-- Step 2: pick one of the learner's invoices --}}
@if(($preselectedInvoices ?? collect())->count()) @foreach($preselectedInvoices as $i) @endforeach @endif
@error('amount'){{ $message }}@enderror
@error('method'){{ $message }}@enderror
@error('reference'){{ $message }}@enderror
@error('notes'){{ $message }}@enderror
@if($mpesaReady ?? false)

M-Pesa STK Push

Uses the invoice selected in the payment form.
@elseif((auth()->user()->role ?? '') === 'admin')

Enable M-Pesa STK push by adding Daraja credentials.

@php $mp = \App\Models\PaymentMethod::where('code', 'mpesa')->first(); @endphp @if($mp)Configure M-Pesa@endif
@endif @if($tumaReady ?? false) @php $coopMethod = \App\Models\PaymentMethod::where('code', 'coop')->first(); @endphp

@if($coopMethod?->logo) Co-op @else @endif Co-op STK Push

Uses the invoice selected in the payment form. The invoice updates automatically once paid.
@elseif((auth()->user()->role ?? '') === 'admin')

Enable Co-op STK push by adding Tuma credentials.

@php $cp = \App\Models\PaymentMethod::where('code', 'coop')->first(); @endphp @if($cp)Configure Co-op Bank@endif
@endif

Tip

Always capture the M-Pesa code or cheque number as the reference so each payment can be traced.

@push('scripts') @endpush @endsection