@extends('layouts.app') @section('title', 'Pay Fees with M-Pesa') @section('content')

Pay fees with M-Pesa

Account Number = Student ID. An STK push is sent to the phone number you provide.
@if(auth()->check())
Dashboard
@endif

Find learner

The account number is the numeric student ID shown on the learner record.
@if($student) @php $invoice = \App\Models\Invoice::where('student_id', $student->id)->where('term', $term)->where('year', $year)->first(); @endphp

Payment details

Confirm the learner and enter the amount to charge.
{{ $student->full_name }}
Account Number (Student ID): {{ $student->id }} · Admission: {{ $student->admission_no }} · {{ $student->class_label }}
@if($invoice)
Term invoice: {{ money($invoice->total) }} · Paid {{ money($invoice->paid) }} · Balance {{ money($invoice->balance) }}
@endif
@csrf
Must be a Safaricom number.

@if($demo) Demo mode is active. No phone is debited. The payment appears in Finance → Incoming where it can be confirmed and receipted. @else Approve the prompt on your phone. The receipt and invoice update automatically once M-Pesa confirms the payment. @endif

@elseif($studentId)
No learner found with student ID {{ $studentId }}.
@endif

How to pay

Details shown on the student record.
Account Number
Student ID
Paybill / shortcode
{{ $config['shortcode'] ?: 'Not configured' }}
Transaction description
Fees T{{ $term }} {{ $year }}
For Paybill payments, enter the student ID as the account number. Payments are matched and receipted automatically.
@endsection