<?php $__env->startSection('style'); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

    <!-- ========User-Panel-Section Starte Here ========-->
    <div class="row">
        <div class="col-12">
            <h2 class="content-header"><?php echo e(__($page_title)); ?></h2>
        </div>
    </div>

    <section class="mt-4">
        <div class="container user-panel-container">
            <div class="row mb-60-80 justify-content-center">
                <div class="col-md-8">
                        <ul class="list-group text-center">

                            <li class="list-group-item">
                                <img
                                    src="<?php echo e($data->gateway_currency()->methodImage()); ?>"
                                    style="max-width:100px; max-height:100px; margin:0 auto;"/>
                            </li>

                            <p class="list-group-item">
                                <?php echo app('translator')->get('Amount'); ?>:
                                <strong><?php echo e(formatter_money($data->amount)); ?> </strong> <?php echo e($general->cur_text); ?>

                            </p>






















                            <?php if($data->gateway->crypto==1): ?>
                                <p class="list-group-item">
                                    <?php echo app('translator')->get('Conversion with'); ?>
                                    <b> <?php echo e($data->method_currency); ?></b> <?php echo app('translator')->get('and final value will Show on next step'); ?>
                                </p>
                            <?php endif; ?>
                        </ul>


                    <?php if($data->method_code == 547): ?>
                        <button id="pay" class="btn btn-custom2 btn-block"><?php echo app('translator')->get('PAY Now'); ?></button>
                    <?php else: ?>
                        <a href="<?php echo e(route('user.deposit.confirm')); ?>" class="btn btn-custom2 btn-block"><?php echo app('translator')->get('Pay Now'); ?></a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </section>
    <!-- ========User-Panel-Section Ends Here ========-->

    <div id="loading-background">
        <i data-loading-icon="tail-spin" class="w-8 h-8"></i>
    </div>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('load-js'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('script'); ?>
    <script src ="https://give.btcpayx.com/modal/btcpay.js"></script>
    <script>
        const invoiceCreation = {
            "price": "<?php echo e(formatter_money($data->final_amo)); ?>",
            "trx": "<?php echo e($track); ?>"
        };

        $('#pay').on('click',function() {
            $(this).html('Loading');
            $('#loading-background').css('display','flex');
            fetch("<?php echo e(route('user.BtcPayDeposit')); ?>",{
                responseType: 'json',
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    "X-CSRF-TOKEN": "<?php echo e(csrf_token()); ?>"
                },
                // body: invoiceCreation
                body: JSON.stringify(invoiceCreation)
            })
                .then(response => response.json())
                .then(response => {
                    // console.log(response.data.id);
                    let invoiceID = response.data;
                    window.btcpay.showInvoice(invoiceID);
                });
        });

        window.btcpay.onModalWillLeave(function () {
            $('#loading-background').css('display','none');
            $("#pay").html('Pay Now');
            let url = "<?php echo e(route('user.deposit.history')); ?>";
            window.location.href = url;

        });


    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make(activeTemplate() .'layouts.user', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ectinternational/goldenage.club/resources/views/templates/minimal/payment/preview.blade.php ENDPATH**/ ?>