<?php $__env->startSection('title', 'One Khusa Payment'); ?>
<?php $__env->startSection('content'); ?>
    <?php
        $payload = $payment->gateway_payload ?? [];
        $tan = data_get($payload, 'tan')
            ?? data_get($payload, 'timedAccountNumber')
            ?? data_get($payload, 'paymentRequestTan')
            ?? data_get($payload, 'data.tan');
        $expiresAt = data_get($payload, 'expiresAt')
            ?? data_get($payload, 'expiryDateTime')
            ?? data_get($payload, 'data.expiresAt');
        $invoice = $payment->allocations->first()?->invoice;
    ?>

    <?php if (isset($component)) { $__componentOriginal00a2e3c817942d1565d2933416f28c6a = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal00a2e3c817942d1565d2933416f28c6a = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.page-head','data' => ['title' => 'One Khusa Payment','subtitle' => ''.e($payment->payment_number).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('page-head'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'One Khusa Payment','subtitle' => ''.e($payment->payment_number).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal00a2e3c817942d1565d2933416f28c6a)): ?>
<?php $attributes = $__attributesOriginal00a2e3c817942d1565d2933416f28c6a; ?>
<?php unset($__attributesOriginal00a2e3c817942d1565d2933416f28c6a); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal00a2e3c817942d1565d2933416f28c6a)): ?>
<?php $component = $__componentOriginal00a2e3c817942d1565d2933416f28c6a; ?>
<?php unset($__componentOriginal00a2e3c817942d1565d2933416f28c6a); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginal36665f0dc0e45320e21db1e20a989acf = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal36665f0dc0e45320e21db1e20a989acf = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.panel','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('panel'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
        <dl style="display:grid; grid-template-columns: 160px 1fr; gap:8px 16px; margin-bottom:20px;">
            <dt>Student</dt><dd><?php echo e($invoice?->student?->full_name); ?></dd>
            <dt>Invoice</dt><dd><?php echo e($invoice?->invoice_number); ?></dd>
            <dt>Amount</dt><dd><strong><?php echo e(number_format($payment->amount, 2)); ?> <?php echo e(config('payments.default_currency')); ?></strong></dd>
            <dt>Reference</dt><dd><?php echo e($payment->gateway_reference); ?></dd>
        </dl>

        <?php if($tan): ?>
            <div style="background:var(--surface2); border-radius:12px; padding:20px; margin-bottom:20px;">
                <p style="margin:0 0 8px; color:var(--text2);">Pay using this timed account number (TAN) within 15 minutes:</p>
                <p style="font-size:28px; font-weight:700; letter-spacing:2px; margin:0;"><?php echo e($tan); ?></p>
                <?php if($expiresAt): ?>
                    <p style="margin:12px 0 0; color:var(--text2); font-size:14px;">Expires: <?php echo e($expiresAt); ?></p>
                <?php endif; ?>
            </div>
        <?php else: ?>
            <p style="color:var(--text2);">Your payment request was created. Complete payment in the One Khusa app using reference <strong><?php echo e($payment->gateway_reference); ?></strong>.</p>
        <?php endif; ?>

        <p style="color:var(--text2); margin-bottom:20px;">Once One Khusa confirms payment, finance will reconcile it against your invoice. You may leave this page after paying.</p>

        <a href="<?php echo e(route('parent.fees.index', ['student_id' => $invoice?->student_id])); ?>" class="btn btn-primary">Back to Fee Statement</a>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal36665f0dc0e45320e21db1e20a989acf)): ?>
<?php $attributes = $__attributesOriginal36665f0dc0e45320e21db1e20a989acf; ?>
<?php unset($__attributesOriginal36665f0dc0e45320e21db1e20a989acf); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal36665f0dc0e45320e21db1e20a989acf)): ?>
<?php $component = $__componentOriginal36665f0dc0e45320e21db1e20a989acf; ?>
<?php unset($__componentOriginal36665f0dc0e45320e21db1e20a989acf); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.parent', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\southend\resources\views/parent/fees/one-khusa.blade.php ENDPATH**/ ?>