<?php $__env->startSection('title', 'Pembayaran Midtrans'); ?>

<?php $__env->startSection('content'); ?>
    <h3>Memproses pembayaran... Mohon tunggu</h3>

    <script src="https://app.sandbox.midtrans.com/snap/snap.js"
        data-client-key="<?php echo e(config('services.midtrans.client_key')); ?>"></script>

    <script>
        document.addEventListener("DOMContentLoaded", function() {
            snap.pay('<?php echo e($snapToken); ?>', {
                onSuccess: function(result) {
                    window.location.href = '/payment/success/' + result.order_id;
                },
                onPending: function(result) {
                    window.location.href = '/payment/pending?order_id=' + result.order_id;
                },
                onError: function(result) {
                    window.location.href = '/payment/error?order_id=' + result.order_id;
                },
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('components.layouts.base', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH E:\!PROJECT\dfood-website\resources\views/livewire/midtrans-payment.blade.php ENDPATH**/ ?>