<?php $__env->startSection('title', __('Payment checkout').' — '.config('app.name', 'Honey B')); ?>

<?php $__env->startPush('head'); ?>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
    .payment-page { max-width: 720px; margin: 0 auto; padding: 2rem 0; }
    .gateway-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
    .gateway-card:hover { border-color: #0d6efd !important; }
    .gateway-card.active { border-color: #0d6efd !important; box-shadow: 0 0 0 0.15rem rgba(13,110,253,.25); }
    #payment-loader { display: none; }
    #payment-loader.show { display: flex; }
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<main class="container payment-page">
    <p><a href="<?php echo e(route('shop.index')); ?>">← <?php echo e(__('Shop')); ?></a></p>

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>
    <?php if(session('error')): ?>
        <div class="alert alert-danger"><?php echo e(session('error')); ?></div>
    <?php endif; ?>

    <h1 class="h3 mb-4"><?php echo e(__('Test payment')); ?></h1>
    <p class="text-muted"><?php echo e(__('Select a gateway, enter an amount, then pay. Configure keys in Admin → Payment settings.')); ?></p>

    <div class="card shadow-sm mb-4">
        <div class="card-body">
            <div class="mb-3">
                <label class="form-label"><?php echo e(__('Amount (USD)')); ?></label>
                <input type="number" step="0.01" min="0.5" class="form-control" id="pay-amount" value="10.00">
            </div>
            <div class="mb-3">
                <label class="form-label"><?php echo e(__('Gateway')); ?></label>
                <div class="row g-2">
                    <div class="col-md-4">
                        <div class="border rounded p-3 text-center gateway-card active" data-gateway="stripe" role="button" tabindex="0">
                            <strong>Stripe</strong>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="border rounded p-3 text-center gateway-card" data-gateway="paypal" role="button" tabindex="0">
                            <strong>PayPal</strong>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="border rounded p-3 text-center gateway-card" data-gateway="square" role="button" tabindex="0">
                            <strong>Square</strong>
                        </div>
                    </div>
                </div>
            </div>
            <div id="stripe-panel" class="border rounded p-3 bg-light mb-3">
                <p class="small text-muted mb-2"><?php echo e(__('Stripe uses Elements on this page. Ensure publishable key is set in admin.')); ?></p>
                <div id="payment-element" class="mb-2"></div>
            </div>
            <div id="square-panel" class="d-none border rounded p-3 bg-light mb-3">
                <p class="small text-muted"><?php echo e(__('Square requires Web Payments SDK tokenization in production. For demo, use a test source_id from Square docs if configured.')); ?></p>
                <input type="text" class="form-control mb-2" id="square-source" placeholder="sandbox source_id (cnon:...)">
            </div>
            <div id="payment-alert" class="alert d-none" role="alert"></div>
            <div class="d-flex align-items-center gap-3">
                <button type="button" class="btn btn-primary btn-lg" id="btn-pay"><?php echo e(__('Pay now')); ?></button>
                <div id="payment-loader" class="align-items-center gap-2 text-muted">
                    <div class="spinner-border spinner-border-sm" role="status"></div>
                    <span><?php echo e(__('Processing…')); ?></span>
                </div>
            </div>
        </div>
    </div>
</main>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
    window.paymentSessionUrl = <?php echo json_encode(route('payments.session'), 15, 512) ?>;
    window.csrfToken = <?php echo json_encode(csrf_token(), 15, 512) ?>;
</script>
<script src="<?php echo e(asset('js/payments.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.site', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\projects\honey b\backend\resources\views\payments\checkout.blade.php ENDPATH**/ ?>