

<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="container-header">
        <h1><?php echo e($title); ?></h1>
    </div>

    <?php
        $statusBadgeClass = $payment->status === 'success'
            ? 'active'
            : ($payment->status === 'failed' ? 'inactive' : 'pending');
        $statusLabel = $payment->status === 'success'
            ? 'Approved'
            : ($payment->status === 'failed' ? 'Rejected' : 'Pending');
    ?>

    <div class="card deposit-details-card">
        <div class="list-group mb-25">
            <div class="list-group-item">
                <span>Transaction id</span>
                <span><?php echo e($payment->reference); ?></span>
            </div>
            <div class="list-group-item">
                <span>User</span>
                <span><?php echo e($payment->user?->fname); ?> <?php echo e($payment->user?->lname); ?></span>
            </div>
            <div class="list-group-item">
                <span>Payment date</span>
                <span><?php echo e($payment->created_at?->format('d F Y, h:i A')); ?></span>
            </div>
            <div class="list-group-item">
                <span>Payment gateway</span>
                <span><?php echo e(ucfirst($payment->method)); ?></span>
            </div>
            <div class="list-group-item">
                <span>Amount</span>
                <span><?php echo e(number_format($payment->amount, 2)); ?> <?php echo e($payment->currency); ?></span>
            </div>
            <div class="list-group-item">
                <span>Channel</span>
                <span><?php echo e($payment->channel ?? 'N/A'); ?></span>
            </div>
            <div class="list-group-item">
                <span>Status</span>
                <span class="badge <?php echo e($statusBadgeClass); ?>">
                    <?php echo e($statusLabel); ?>

                </span>
            </div>
        </div>

        <?php if($payment->method === 'bank'): ?>
            <?php $params = (object) ($payment->gateway?->gateway_parameters ?? []); ?>

            <div class="list-group mb-25">
                <div class="list-group-item">
                    <span>Account name</span>
                    <span><?php echo e($params->name ?? 'N/A'); ?></span>
                </div>
                <div class="list-group-item">
                    <span>Account number</span>
                    <span><?php echo e($params->account_number ?? 'N/A'); ?></span>
                </div>
                <div class="list-group-item">
                    <span>Bank / Branch</span>
                    <span><?php echo e($params->branch_name ?? 'N/A'); ?></span>
                </div>
            </div>

            <div class="list-group mb-25">
                <h3>User Payment Proof</h3>
                <?php if($payment->proof_path): ?>
                    <div class="list-group-item has-image">
                        <span>Payment proof</span>
                        <a href="<?php echo e(asset($payment->proof_path)); ?>" target="_blank">
                            <img src="<?php echo e(asset($payment->proof_path)); ?>" alt="Payment proof">
                        </a>
                    </div>
                <?php else: ?>
                    <div class="list-group-item">
                        <span class="text-muted">No payment proof submitted</span>
                    </div>
                <?php endif; ?>
            </div>

            <?php if($payment->status === 'pending'): ?>
                <div class="deposit-actions">
                    <form action="<?php echo e(route('backend.payments.approve-bank', $payment)); ?>" method="post" style="display: inline-block;" onsubmit="return confirm('Approve this bank payment?');">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="btn btn-primary">Approve & Credit</button>
                    </form>
                    <form action="<?php echo e(route('backend.payments.reject-bank', $payment)); ?>" method="post" style="display: inline-block;" onsubmit="return confirm('Reject this bank payment?');">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="btn btn-danger">Reject</button>
                    </form>
                </div>
            <?php endif; ?>
        <?php endif; ?>

        <?php if($payment->gateway_response): ?>
            <div class="list-group mb-25">
                <h3>Gateway Response (raw)</h3>
                <div class="list-group-item">
                    <pre style="white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 0;">
<?php echo e($payment->gateway_response); ?>

                    </pre>
                </div>
            </div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('backend.layout.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\HP\Desktop\nbverify\mine\resources\views/backend/payments/show.blade.php ENDPATH**/ ?>