<?php $__env->startSection('head'); ?>
<?php echo $__env->make('layouts.partials.headersection',['title'=>'Make Payment'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<?php
$stripe=false;
?>
<div class="container py-5">
	
	<div class="row">
		<div class="col-lg-7 mx-auto">
			<div class="card">
				<div class="card-header">
					<div class="card-body">
						<ul role="tablist" class="nav bg-light nav-pills rounded nav-fill mb-3">
							<?php $__currentLoopData = $getways; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<li class="nav-item"> <a data-toggle="pill" href="#<?php echo e($row->slug); ?>" class="nav-link <?php if($key == 0): ?> active <?php endif; ?>"> <img height="50" src="<?php echo e(asset($row->preview->content)); ?>"></a> </li>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>							
						</ul>

						<!-- Credit card form content -->
						<div class="tab-content">
							<?php
							if(url('/') == env('APP_URL')){
								$url=url('/merchant/make-charge/');
							}
							else{
								$url=url('/seller/make-charge/');
							}
							
							?>
							<!-- credit card info-->
							<?php $__currentLoopData = $getways; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<div id="<?php echo e($row->slug); ?>" class="tab-pane fade <?php if($key==0): ?> show active  <?php endif; ?> pt-3">
								<?php if($row->slug == 'stripe'): ?>
								<?php
								$stripe=true;
								?>
								<script src="https://js.stripe.com/v3/"></script>
								<form action="<?php echo e(url($url.'/'.$info->id)); ?>" method="post" id="payment-form">
									<?php echo csrf_field(); ?>
									<?php
									 $credentials=json_decode($row->credentials->content ?? '');
									?>
									<input type="hidden" name="mode" value="<?php echo e($row->id); ?>">
									<input type="hidden" id="publishable_key" value="<?php echo e($credentials->publishable_key); ?>">
									<div class="form-group">

										
										<label for="card-element">
											Credit or debit card
										</label>
										<div id="card-element">
											<!-- A Stripe Element will be inserted here. -->
										</div>

										<!-- Used to display form errors. -->
										<div id="card-errors" role="alert"></div>

									<?php if($info->price > 0): ?>
									<button type="submit" class="subscribe btn btn-primary btn-block shadow-sm mt-2"> Make Payment With <?php echo e($row->name); ?> (<?php echo e($price); ?>) </button>
									<?php else: ?>
										<a href="<?php echo e(url(env('APP_URL').'/contact')); ?>" target="_blank"  class="subscribe btn btn-primary btn-block shadow-sm text-white"><?php echo e(__('Please Contact With Us')); ?></a>
									<?php endif; ?>
									</div>
								</form>
								<?php else: ?>
								<form role="form" method="post" action="<?php echo e(url($url.'/'.$info->id)); ?>">
									<?php echo csrf_field(); ?>
									<input type="hidden" name="mode" value="<?php echo e($row->id); ?>">
									<div class="form-group">
										<label >
											<h6><?php echo e(__('Name')); ?></h6>
										</label> 
										<input type="text" name="name" readonly="" value="<?php echo e(Auth::user()->name); ?>" class="form-control "> 
									</div>
									<div class="form-group">
										<label >
											<h6><?php echo e(__('Email')); ?></h6>
										</label> 
										<input type="text" name="email" readonly="" value="<?php echo e(Auth::user()->email); ?>" class="form-control "> 
									</div>
									<div class="form-group">
										<label for="username">
											<h6><?php echo e(__('Phone Number')); ?></h6>
										</label> 
										<input type="number" name="phone" placeholder="Enter Your Phone Number" required class="form-control "> 
									</div>
									<?php if($info->price > 0): ?>
									<button type="submit" class="subscribe btn btn-primary btn-block shadow-sm"> <?php echo e(__('Make Payment With')); ?> <?php echo e($row->name); ?> (<?php echo e($price); ?>) </button>
									<?php else: ?>
									<a href="<?php echo e(url(env('APP_URL').'/contact')); ?>" target="_blank"  class="subscribe btn btn-primary btn-block shadow-sm text-white"><?php echo e(__('Please Contact With Us')); ?></a>
									<?php endif; ?>
									
								</form>
								<?php endif; ?>								
							</div> 
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							<!-- Paypal info -->
							
							
							<!-- End -->
						</div>
						
					</div>
				</div>
				<div class="card-footer">
					<table class="table table-hover table-borderlress col-12">
								<tr>
									<td><?php echo e(__('Plan Name')); ?></td>
									<td><?php echo e($info->name); ?></td>
								</tr>
								<tr>
									<td><?php echo e(__('Plan Price')); ?></td>
									<td><?php echo e(number_format($info->price,2)); ?></td>
								</tr>
								<tr>
									<td><?php echo e(__('Tax')); ?></td>
									<td><?php echo e(number_format($tax,2)); ?></td>
								</tr>
								<tr>
									<td><?php echo e(__('Total Amount')); ?></td>
									<td><?php echo e($price); ?></td>
								</tr>
						</table>
				</div>
			</div>
		</div>

	</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<?php $__env->stopSection(); ?>	
<?php $__env->startPush('js'); ?>
<?php if($stripe == true): ?>
<script src="<?php echo e(asset('assets/js/stripe.js')); ?>"></script>
<?php endif; ?>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Volumes/my-works/laravel/dokans/script/resources/views/seller/plan/payment.blade.php ENDPATH**/ ?>