@include('components.alert')
@php
$invoice = $course['invoice'] ?? [];
$transaction = $course['transaction'] ?? [];
$pricing = $course['pricing'] ?? [];
$amountDue = (float) data_get($invoice, 'amount_due', data_get($pricing, 'amount_due', 0));
$isPaid = ($invoice['payment_status'] ?? null) === 'paid' || $amountDue <= 0;
$isDepositInvoice = in_array(($invoice['payment_status'] ?? null), ['deposite', 'paid_deposite'], true);
$hasPendingOnlinePayment = ($transaction['payment_type'] ?? null) === 'online'
&& in_array(($transaction['status'] ?? null), ['pending', 'created'], true)
&& filled($transaction['payment_url'] ?? null);
@endphp
Course Booking
{{ $course['course_name'] ?? 'Course payment' }}
Complete the course payment to unlock the included free placement test for this enrollment.
{{ $student->full_name }}
@if($course['package_name'])
{{ $course['package_name'] }}
@endif
Placement test included
Amount due
{{ number_format($amountDue, 2) }} {{ $pricing['currency'] ?? $invoice['currency'] ?? '' }}
{{ $isPaid ? 'Payment completed' : ($isDepositInvoice ? 'Deposit paid, remaining balance due' : 'No extra placement-test fee') }}
Booking Details
Course, teacher, schedule, and invoice information.
{{ $isPaid ? 'Paid' : ($isDepositInvoice ? 'Deposit invoice' : 'Payment pending') }}
Course type
{{ ucfirst($course['course_type'] ?? 'Course') }}
Level
@if(!empty($course['covered_levels']))
{{ implode(', ', $course['covered_levels']) }}
@else
{{ $course['level_name'] ?? '-' }}
@endif
Teacher
{{ $course['teacher_name'] ?? '-' }} {{ $course['teacher_type_label'] ?? 'Native-like' }}
Schedule
{{ $course['start_date'] ?? '-' }} to {{ $course['end_date'] ?? '-' }}
Next session
{{ $course['next_session_at'] ?? 'No upcoming session' }}
Invoice
{{ $invoice['invoice_number'] ?? '-' }}
@if($isDepositInvoice)
Remaining {{ number_format($amountDue, 2) }} {{ $pricing['currency'] ?? $invoice['currency'] ?? '' }}
@endif
{{ $isPaid ? 'Placement Test' : ($isDepositInvoice ? 'Pay Remaining Balance' : 'Pay Course') }}
{{ $isPaid ? 'Your course payment is complete.' : ($isDepositInvoice ? 'This invoice is partially paid. Complete the remaining balance on the same invoice.' : 'Choose a payment method to finish enrollment.') }}
@if($isPaid && data_get($course, 'placement_test.show_pending_action') && $placementRedirectUrl)
Pending Placement Test
@elseif($isPaid && data_get($course, 'placement_test.waiting_report'))
Waiting report
@elseif($isPaid)
No action needed
@else
@if($hasPendingOnlinePayment)
Continue Online Payment
or change method
@endif
@endif
@endsection