<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header"><h1><i class="far fa-credit-card"></i> Paiement Uniskip</h1></div>

                <div class="card-body">
                   <div class="panel panel-primary">
						<?php if(session()->has('warning')): ?>
                            <div class="alert alert-warning }}"> 
                            <?php echo session('warning'); ?>

                            </div>
                        <?php endif; ?>
                        <div class="card">
                        	<div class="card-header">Uniskip</div>
                    		<div class="card-body">
	                    		<form method="POST" action="<?php echo e(route('paiement.uniskip')); ?>">
	                    		<?php echo e(csrf_field()); ?>

	                    		
	                    		mnt : <?php echo e($montant); ?><br>
	                    		trans : <?php echo e($transaction_id); ?><br>
	                    		</br>
	                    		</form>
	                    		
	                    		<iframe width="100%" height="800px" src="<?php echo e($cblink['url']); ?>" border="0" style="border:none"></iframe>
                    			<div id="messageTrans" style="opacity:0">... 
			                    </div>
                    		</div>
                    		
                    	</div>
                    </div>
		        </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('morejs'); ?>
 <script>

function ask(canBack=false){
	var jqxhr = $.ajax( {
		type : "GET",
		url : "<?php echo e(route('usVerif')); ?>",
		cache : false,
		dataType : "json" } )
			.done(function(reponse) {
				console.log('!');
				if (reponse['payment'] =='ok'){
					console.log("OK!!!!");
					clearInterval(myVar);
					$('#messageTrans').html('<div class="alert alertToolsBar alert-success">'+
											'Paiement effectué...Votre facture est accessible dans votre espace client. '+
											'<a href="' + reponse['location'] + '" class="btn btn-primary">Continuer</a>'+
											'</div>');
					$("#messageTrans").animate({
			 			top:'-40px',
			 			opacity:'1'
			 			});
				}
	    });
}

var myVar = setInterval(myTimer, 5000);
var temps=0;
function myTimer() {
	temps++;
	console.log(temps);
	ask();
	if (temps>100) {
		clearInterval(myVar);
	}
}
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\leprisme_travaux\resources\views/payment/paiementUniskip.blade.php ENDPATH**/ ?>