JFIF$        dd7 

Viewing File: /home/vanquishholdings/public_html/src/resources/views/payment/preview.blade.php

@extends('layouts.user')
@section('content')
    <div class="main-content" data-simplebar>
        <div class="i-card-sm">
            <div class="row">
                <div class="user-form">
                    <h5 class="card-header text-center">{{ __('Payment Details') }}</h5>

                    <!-- Timer Display -->
                    <div class="card-body mb-4 mt-2">
                        <div id="payment-timer" style="text-align: center; margin-bottom: 20px;">
                            <h4>{{ __('Time Remaining:') }} <span id="timer">30:00</span></h4>
                        </div>

                        @php echo $gateway->details ?? '' @endphp
                        
                        <center>
                            <img src="https://www.bitcoinqrcodemaker.com/api/?style={{ $gateway->name }}&address={{ $gateway->wallet }}" alt="QR Code" style="max-width: 200px; margin-bottom: 10px;">
                        </center>

                        <div class="crypto-wallet-container" style="max-width: 500px; margin: 0 auto; text-align: center;">
                            <div class="input-group">
                                <input
                                    type="text"
                                    id="cryptoWalletAddress"
                                    class="form-control"
                                    value="{{ $gateway->wallet ?? 'No Wallet Address Available' }}"
                                    readonly
                                />
                                <button
                                    class="btn btn-primary"
                                    id="copyWalletButton"
                                    onclick="copyWalletAddress()"
                                >
                                    Copy
                                </button>
                            </div>
                            <small id="copyStatus" style="display: none; color: green; margin-top: 5px;">Copied to clipboard!</small>
                        </div>
                    </div>

                    @if($gateway->type == \App\Enums\Payment\GatewayType::AUTOMATIC->value && $gateway->code == \App\Enums\Payment\GatewayCode::BLOCK_CHAIN->value)
                        <div class="card-body card-body-deposit text-center">
                            <h4 class="my-2"> @lang('PLEASE SEND EXACTLY') <span class="text-success"> {{ $payment->btc_amount }}</span> @lang('BTC')</h4>
                            <h5 class="mb-2">@lang('TO') <span class="text-success"> {{ $payment->btc_wallet ?? '' }}</span></h5>
                            <img src="{{ cryptoQRCode($payment->btc_wallet ?? '') }}" alt="@lang('Image')">
                            <h4 class="text-white bold my-4">@lang('SCAN TO SEND')</h4>
                        </div>
                    @endif

                    @if($gateway->type == \App\Enums\Payment\GatewayType::MANUAL->value)
                        <div class="col-lg-12 mb-4">
                            <ul class="list-group">
                               
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    {{ __('Deposit Amount') }}
                                    <span>{{ getCurrencySymbol() }}{{shortAmount($payment->amount)}}</span>
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    {{ __('Charge') }}
                                    <span>{{ getCurrencySymbol() }}{{shortAmount($payment->charge)}}</span>
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    {{ __('Final Amount') }}
                                    <span>{{ getCurrencySymbol() }}{{shortAmount($payment->final_amount)}}</span>
                                </li>
                            </ul>
                        </div>

                        <form method="POST" action="{{ route('user.payment.traditional') }}" enctype="multipart/form-data" id="payment-form">
                            @csrf
                            @method('PUT')
                            <input type="hidden" name="payment_intent" value="{{ $payment->trx }}">
                            <input type="hidden" name="gateway_code" value="{{ $gateway->code }}">
                            <div class="row">
                                @foreach($gateway->parameter as $key => $parameter)
                                    @php
                                        $parameter = is_array($parameter) ? $parameter : [];
                                    @endphp
                                    <div class="col-lg-12">
                                        <div class="form-inner">
                                            <label for="{{ getArrayValue($parameter,'field_label') }}">{{ __(getArrayValue($parameter,'field_label')) }}</label>
                                            @if(getArrayValue($parameter,'field_type') == 'file')
                                                <input type="file" id="{{ getArrayValue($parameter,'field_label') }}" name="{{ getArrayValue($parameter,'field_name') }}" required>
                                            @elseif(getArrayValue($parameter,'field_type') == 'text')
                                                <input type="text" id="{{ getArrayValue($parameter,'field_label') }}" name="{{ getArrayValue($parameter,'field_name') }}" placeholder="{{ __("Enter ". getArrayValue($parameter,'field_label')) }}" required>
                                            @elseif(getArrayValue($parameter,'field_type') == 'textarea')
                                                <textarea id="{{ getArrayValue($parameter,'field_label') }}" name="{{ getArrayValue($parameter,'field_name') }}" placeholder="{{ __("Enter ". getArrayValue($parameter,'field_label')) }}" required></textarea>
                                            @endif
                                        </div>
                                    </div>
                                @endforeach
                            </div>
                            <div class="col-12">
                                <button type="submit" class="i-btn btn--primary btn--lg" id="submit-button">{{ __('Save') }}</button>
                            </div>
                        </form>
                    @endif
                </div>
            </div>
        </div>
    </div>

    <!-- JavaScript for Timer and Other Functionalities -->
    <script>
        // Function to copy wallet address
        function copyWalletAddress() {
            const walletAddress = document.getElementById('cryptoWalletAddress');
            walletAddress.select();
            walletAddress.setSelectionRange(0, 99999); // For mobile devices

            navigator.clipboard.writeText(walletAddress.value)
                .then(() => {
                    const status = document.getElementById('copyStatus');
                    status.style.display = 'block';
                    setTimeout(() => {
                        status.style.display = 'none';
                    }, 2000);
                })
                .catch(err => {
                    console.error('Failed to copy:', err);
                });
        }

        // Timer Functionality
        (function() {
            const TIMER_KEY = 'payment_timer_end';
            const TIMER_DURATION = 30 * 60 * 1000; // 30 minutes in milliseconds
            const timerElement = document.getElementById('timer');
            const paymentForm = document.getElementById('payment-form');
            const paymentTimerContainer = document.getElementById('payment-timer');

            // Initialize Timer Only on Deposit Attempt
            function initializeTimer() {
                let endTime = localStorage.getItem(TIMER_KEY);
                if (!endTime) {
                    return null;
                }
                return parseInt(endTime, 10);
            }

            // Start New Timer
            function startNewTimer() {
                const newEndTime = Date.now() + TIMER_DURATION;
                localStorage.setItem(TIMER_KEY, newEndTime);
                return newEndTime;
            }

            // Update Timer Display
            function updateTimer(endTime) {
                const now = Date.now();
                const distance = endTime - now;

                if (distance <= 0) {
                    timerElement.textContent = "00:00";
                    handleTimerExpiry();
                    return;
                }

                const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
                const seconds = Math.floor((distance % (1000 * 60)) / 1000);

                timerElement.textContent = `${pad(minutes)}:${pad(seconds)}`;
            }

            // Handle Timer Expiry
            function handleTimerExpiry() {
                paymentTimerContainer.innerHTML = `<h4 style="color: red;">{{ __('Payment session has expired.') }}</h4>`;

                if (paymentForm) {
                    const inputs = paymentForm.querySelectorAll('input, textarea, button');
                    inputs.forEach(input => {
                        input.disabled = true;
                    });
                }

                // Clear timer from storage
                clearTimer();

                // Redirect to deposits page after 3 seconds
                setTimeout(() => {
                    window.location.href = "/users/payment/deposits";
                }, 3000);
            }

            // Pad numbers with leading zero
            function pad(number) {
                return number < 10 ? '0' + number : number;
            }

            // Start the Timer
            function startTimer(endTime) {
                updateTimer(endTime); // Initial call
                const timerInterval = setInterval(() => {
                    const now = Date.now();
                    const distance = endTime - now;

                    if (distance <= 0) {
                        clearInterval(timerInterval);
                        handleTimerExpiry();
                    } else {
                        updateTimer(endTime);
                    }
                }, 1000);
            }

            // Clear Timer
            function clearTimer() {
                localStorage.removeItem(TIMER_KEY);
            }

            // On Payment Form Submit, clear the timer
            if (paymentForm) {
                paymentForm.addEventListener('submit', function() {
                    clearTimer();
                });
            }

            // Initialize and start the timer if already set
            const endTime = initializeTimer();
            if (endTime) {
                startTimer(endTime);
            } else {
                // Start a new timer when user attempts a new deposit
                const newEndTime = startNewTimer();
                startTimer(newEndTime);
            }
        })();
    </script>
@endsection
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8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