<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-money"></i> <?php echo e(trans('application.payment_methods')); ?></h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-3">
            <?php echo $__env->make('settings.partials._menu', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </div>
        <div class="col-md-9">
            <div class="box box-primary">
                <div class="box-body">
                    <?php if(count($errors) > 0): ?>
                        <?php echo form_errors($errors); ?>
                    <?php endif; ?>
                    <?php echo Form::open(['route' => ['payment.store']]); ?>
                    <div class="form-group">
                        <?php echo Form::label('name', trans('application.name')); ?>
                        <div class="input-group col-md-4">
                        <?php echo Form::text('name', null, ['class' => "form-control input-sm", 'required']); ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <?php echo Form::submit(trans('application.save'), ['class="btn btn-sm btn-primary"']); ?>
                    </div>
                    <?php echo Form::close(); ?>
                    <table class="table table-striped table-bordered datatable">
                        <thead>
                        <tr>
                            <th></th>
                            <th><?php echo e(trans('application.name')); ?></th>
                            <th><?php echo e(trans('application.default')); ?></th>
                            <th><?php echo e(trans('application.action')); ?></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if($payment_methods->count() > 0): ?>
                            <?php $__currentLoopData = $payment_methods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $method): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                                <?php if($method->name != 'Paypal' && $method->name != 'Stripe'){ ?>
                                    <tr>
                                        <td></td>
                                        <td><?php echo e($method->name); ?></td>
                                        <td><?php echo $method->selected  ? '<span class="label label-success">'.trans('application.yes').'</span>' : '<span class="label label-danger">'.trans('application.no').'</span>'; ?></td>
                                        <td>
                                            <?php echo edit_btn('payment.edit', $method->uuid); ?>
                                            <?php echo delete_btn('payment.destroy', $method->uuid); ?>
                                        </td>
                                    </tr>
                                <?php }else{
                                    if($method->name == 'Paypal') $paypal_id = $method->uuid;
                                    if($method->name == 'Stripe') $stripe_id = $method->uuid;
                                 } ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                        <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h2 class="box-title">Payment Gateways</h2>
                </div>
                <div class="box-body">
                    <div id="payment_gateway_accordion" class="panel-group">
                        <div class="panel panel-default">
                            <div class="panel-heading" style="background: #00457C;color:#ffffff;">
                                <h4 class="panel-title">
                                    <a data-toggle="collapse" data-parent="#payment_gateway_accordion" href="#paypal_details">1. Paypal</a>
                                </h4>
                            </div>
                            <div id="paypal_details" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <?php echo Form::open(['url' => ['settings/paypal_details']]); ?>
                                    <?php if(isset($paypal_id)): ?>
                                        <?php echo Form::hidden('id', $paypal_id, ['class' => "form-control input-sm", 'required']); ?>
                                    <?php endif; ?>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('paypal_status', trans('application.paypal_status')); ?>
                                        <?php echo Form::select('paypal_status', ['1'=>'Active','0'=>'Inactive'],$paypal_details['status'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('paypal_mode', trans('application.mode')); ?>
                                        <?php echo Form::select('paypal_mode', ['sandbox'=>'Sandbox','live'=>'Live'],$paypal_details['mode'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('paypal_account', trans('application.account')); ?>
                                        <?php echo Form::text('paypal_account', $paypal_details['account'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('client_id', trans('application.client_id')); ?>
                                        <?php echo Form::text('client_id', $paypal_details['client_id'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('secret_key', trans('application.secret_key')); ?>
                                        <?php echo Form::text('secret_key', $paypal_details['secret'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('ipn_url', trans('application.ipn_url')); ?>
                                        <?php echo Form::text('ipn_url', route('paypal_notify'), ['class' => "form-control input-sm", 'disabled']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::submit(trans('application.save'), ['class="btn btn-sm btn-primary"']); ?>
                                    </div>
                                    <?php echo Form::close(); ?>
                                </div>
                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading" style="background: #6772e5;color:#ffffff;">
                                <h4 class="panel-title">
                                    <a data-toggle="collapse" data-parent="#payment_gateway_accordion" href="#stripe_details">2. Stripe</a>
                                </h4>
                            </div>
                            <div id="stripe_details" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <?php echo Form::open(['url' => ['settings/stripe_details']]); ?>
                                    <?php if(isset($stripe_id)): ?>
                                        <?php echo Form::hidden('id', $stripe_id, ['class' => "form-control input-sm", 'required']); ?>
                                    <?php endif; ?>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('stripe_status', trans('application.stripe_status')); ?>
                                        <?php echo Form::select('stripe_status', ['1'=>'Active','0'=>'Inactive'],$stripe_details['status'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('stripe_key', trans('application.stripe_key')); ?>
                                        <?php echo Form::text('stripe_key', $stripe_details['key'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::label('stripe_secret', trans('application.stripe_secret')); ?>
                                        <?php echo Form::text('stripe_secret', $stripe_details['secret'], ['class' => "form-control input-sm", 'required']); ?>
                                    </div>
                                    <div class="col-sm-12 form-group">
                                        <?php echo Form::submit(trans('application.save'), ['class="btn btn-sm btn-primary"']); ?>
                                    </div>
                                    <?php echo Form::close(); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>