<?php
include VIEWPATH . 'admin/header.php';

$stripe = (set_value("stripe")) ? set_value("stripe") : (!empty($payment_data) ? $payment_data['stripe'] : 'N');
$paypal = (set_value("paypal")) ? set_value("paypal") : (!empty($payment_data) ? $payment_data['paypal'] : 'N');
$on_cash = (set_value("offline")) ? set_value("offline") : (!empty($payment_data) ? $payment_data['offline'] : 'N');
$flutterwave = (set_value("flutterwave")) ? set_value("flutterwave") : (!empty($payment_data) ? $payment_data['flutterwave'] : 'N');
$paystack = (set_value("paystack")) ? set_value("paystack") : (!empty($payment_data) ? $payment_data['paystack'] : 'N');



$stripe_secret = (set_value("stripe_secret")) ? set_value("stripe_secret") : (!empty($payment_data) ? $payment_data['stripe_secret'] : '');
$stripe_publish = (set_value("stripe_publish")) ? set_value("stripe_publish") : (!empty($payment_data) ? $payment_data['stripe_publish'] : '');
$paypal_client_id = (set_value("paypal_client_id")) ? set_value("paypal_client_id") : (!empty($payment_data) ? $payment_data['paypal_client_id'] : '');
$paypal_secret_key = (set_value("paypal_secret_key")) ? set_value("paypal_secret_key") : (!empty($payment_data) ? $payment_data['paypal_secret_key'] : '');
$paypal_sendbox_live = (set_value("paypal_sendbox_live")) ? set_value("paypal_sendbox_live") : (!empty($payment_data) ? $payment_data['paypal_sendbox_live'] : '');

$razorpay = (set_value("razorpay")) ? set_value("razorpay") : (!empty($payment_data) ? $payment_data['razorpay'] : 'N');
$razorpay_merchant_key_id = (set_value("razorpay_merchant_key_id")) ? set_value("razorpay_merchant_key_id") : (!empty($payment_data) ? $payment_data['razorpay_merchant_key_id'] : '');
$razorpay_merchant_key_secret = (set_value("razorpay_merchant_key_secret")) ? set_value("razorpay_merchant_key_secret") : (!empty($payment_data) ? $payment_data['razorpay_merchant_key_secret'] : '');

$id = !empty($payment_data) ? $payment_data['id'] : 0;


$flutterwave_public_key = (set_value("flutterwave_public_key")) ? set_value("flutterwave_public_key") : (!empty($payment_data) ? $payment_data['flutterwave_public_key'] : '');
$flutterwave_secret_key = (set_value("flutterwave_secret_key")) ? set_value("flutterwave_secret_key") : (!empty($payment_data) ? $payment_data['flutterwave_secret_key'] : '');
$flutterwave_encryption_key = (set_value("flutterwave_encryption_key")) ? set_value("flutterwave_encryption_key") : (!empty($payment_data) ? $payment_data['flutterwave_encryption_key'] : '');
$flutterwave_env = (set_value("flutterwave_env")) ? set_value("flutterwave_env") : (!empty($payment_data) ? $payment_data['flutterwave_env'] : 'staging');

$offline_details = (set_value("offline_details")) ? set_value("offline_details") : (!empty($payment_data) ? $payment_data['offline_details'] : '');
$paystack_secret_key = (set_value("paystack_secret_key")) ? set_value("paystack_secret_key") : (!empty($payment_data) ? $payment_data['paystack_secret_key'] : '');
$paystack_public_key = (set_value("paystack_public_key")) ? set_value("paystack_public_key") : (!empty($payment_data) ? $payment_data['paystack_public_key'] : '');


$stripe_yes = $stripe_no = "";

if ($stripe == 'Y') {
    $stripe_yes = 'checked';
} else {
    $stripe_no = 'checked';
}

$paypal_yes = $paypal_no = "";
if ($paypal == 'Y') {
    $paypal_yes = 'checked';
} else {
    $paypal_no = 'checked';
}

$razorpay_yes = $razorpay_no = "";

if ($razorpay == 'Y') {
    $razorpay_yes = 'checked';
} else {
    $razorpay_no = 'checked';
}


$flutterwave_yes = $flutterwave_no = "";

if ($flutterwave == 'Y') {
    $flutterwave_yes = 'checked';
} else {
    $flutterwave_no = 'checked';
}

$on_cash_yes = $on_cash_no = "";
if ($on_cash == 'Y') {
    $on_cash_yes = 'checked';
} else {
    $on_cash_no = 'checked';
}


$paystack_yes = $paystack_no = "";
if ($paystack == 'Y') {
    $paystack_yes = 'checked';
} else {
    $paystack_no = 'checked';
}
?>
<input type="hidden" id="stripe_hidden_id" value="<?php echo $stripe; ?>" />
<input type="hidden" id="paypal_hidden_id" value="<?php echo $paypal; ?>" />
<input type="hidden" id="razorpay_hidden_id" value="<?php echo $razorpay; ?>" />
<input type="hidden" id="on_cash_hidden_id" value="<?php echo $on_cash; ?>" />
<input type="hidden" id="paystack_hidden_id" value="<?php echo $paystack; ?>" />
<input type="hidden" id="flutterwave_hidden_id" value="<?php echo $flutterwave; ?>" />


<div class="container-fluid  content-area">
    <div class="section">
        <div class="page-header">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url('admin/dashboard'); ?>"><i class="fa fa-home mr-1"></i> <?php echo dt_translate('dashboard'); ?></a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url('admin/settings'); ?>"> <?php echo dt_translate('setting'); ?></a></li>
                <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo base_url('admin/payment-setting'); ?>"><?php echo dt_translate('payment_setting');?></a></li>
            </ol>
        </div>

        <div class="row">
            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12">

                <?php include VIEWPATH . 'admin/setting/nav.php';?>


                <?php
                echo form_open('admin/save-payment-setting', array('name' => 'PaymentForm', 'id' => 'PaymentForm'));
                echo form_input(array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $id));
                echo form_input(array('type' => 'hidden', 'name' => 'action_type', 'id' => 'action_type', 'value' => $_GET['type']));
                ?>

                <div class="card">
                    <div class="card-header">
                        <ul class="nav nav-tabs">
                            <li class="nav-item ">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='stripe')||!isset($_GET['type'])): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=stripe') ?>"><?php echo dt_translate('stripe'); ?></a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='paypal')): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=paypal') ?>"><?php echo dt_translate('paypal'); ?></a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='razorpay')): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=razorpay') ?>">Razorpay</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='flutterwave')): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=flutterwave') ?>">Flutterwave</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='paystack')): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=paystack') ?>">Paystack</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link <?php if ((isset($_GET['type']) && $_GET['type']=='offline')): ?> active <?php endif; ?>" href="<?php echo base_url('admin/payment-setting?type=offline') ?>">Offline</a>
                            </li>
                        </ul>
                    </div>
                    <div class="card-body">
                        <?php $this->load->view('message'); ?>
                        <?php if ((isset($_GET['type']) && $_GET['type']=='stripe')||!isset($_GET['type'])): ?>
                        <div class="row">

                            <div class="col-md-6">

                                <div class="row">
                                    <div class="col-md-12">
                                        <label class="form-label"><?php echo dt_translate('stripe'); ?></label>
                                        <div class="custom-control custom-radio custom-control-inline">
                                            <input class="custom-control-input" name='stripe' value="Y" type='radio' id='stripe_yes' <?php echo isset($stripe_yes) ? $stripe_yes : ''; ?>>
                                            <label class="custom-control-label"  for="stripe_yes"><?php echo dt_translate('enable'); ?></label>
                                        </div>
                                        <div class="custom-control custom-radio custom-control-inline">
                                            <input class="custom-control-input" name='stripe' type='radio'  value='N' id='stripe_no' <?php echo isset($stripe_no) ? $stripe_no : ''; ?>>
                                            <label class="custom-control-label"  for='stripe_no'><?php echo dt_translate('disable'); ?></label>
                                        </div>
                                    </div>

                                    <div class="col-md-12 mt-3">
                                        <div class="form-group">
                                            <label for="stripe_secret"> <?php echo dt_translate('stripe_secret_key'); ?><small class="required">*</small></label>
                                            <input required type="text" autocomplete="off" id="stripe_secret" name="stripe_secret" value="<?php echo $stripe_secret; ?>" class="form-control" placeholder="<?php echo dt_translate('stripe_secret_key'); ?>">
                                            <?php echo form_error('stripe_secret'); ?>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <div class="form-group ">
                                            <label for="stripe_publish"> <?php echo dt_translate('stripe_publish_key'); ?><small class="required">*</small></label>
                                            <input required type="text" autocomplete="off" id="stripe_publish" name="stripe_publish" value="<?php echo $stripe_publish; ?>" class="form-control" placeholder="<?php echo dt_translate('stripe_publish_key'); ?>">
                                            <?php echo form_error('stripe_publish'); ?>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <div class="form-group ">
                                            <label for="paystack_public_key"><?php echo dt_translate('webhook_url'); ?></label>
                                            <div class="input-group mb-3">
                                                <input type="text" readonly class="form-control" id="stripe_webhook_url" value="<?php echo base_url('stripe/webhook') ?>" aria-describedby="stripe-basic-addon1"/>
                                                <div class="input-group-prepend" onclick="copy_given_data('stripe_webhook_url')" style="cursor: pointer">
                                                    <span class="input-group-text bg-secondary" id="stripe-basic-addon1"><i class="fa fa-copy"></i></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="col-md-6">
                                <div class="row">

                                    <div class="col-md-12">
                                        <div class="card">
                                            <div class="card-header">
                                                How to setup Stripe
                                            </div>

                                            <div class="card-body">

                                                <p>1. Create your account on stripe <a href="https://stripe.com" target="_blank">https://stripe.com/en-in</a>. If you already have account then login to your account.</p>
                                                <p>2. Once you logged in successfully on the dashboard you will find <a href="https://dashboard.stripe.com/developers" target="_blank">Developers</a> Click on that.
                                                    This is a redirect to the developer page where you can see different options.</p>
                                                <p>3. Then click on <a href="https://dashboard.stripe.com/apikeys" target="_blank">API Keys</a> from where you can generate Publishable Key & Secret Key. </p>
                                                <p>4. If you want to test the application then you need to enable "Test mode"</p>
                                                <p>5. Then copy and paste key values into the system.</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <?php endif; ?>


                        <?php if (isset($_GET['type']) && $_GET['type']=='paypal'): ?>

                        <div class="row">

                            <div class="col-md-6">

                                <div class="row">


                                    <div class="col-md-12">
                                        <label class="form-label"><?php echo dt_translate('paypal'); ?></label>
                                        <div class="custom-control custom-radio custom-control-inline">
                                            <input class="custom-control-input" name='paypal' value="Y" type='radio' id='paypal_yes' <?php echo isset($paypal_yes) ? $paypal_yes : ''; ?> >
                                            <label class="custom-control-label"  for="paypal_yes"><?php echo dt_translate('enable'); ?></label>
                                        </div>
                                        <div class="custom-control custom-radio custom-control-inline">
                                            <input class="custom-control-input" name='paypal' type='radio'  value='N' id='paypal_no' <?php echo isset($paypal_no) ? $paypal_no : ''; ?> >
                                            <label class="custom-control-label" for='paypal_no'><?php echo dt_translate('disable'); ?></label>
                                        </div>
                                    </div>
                                    <div class="col-md-12 mt-3">
                                        <div class="form-group">
                                            <label for="paypal_sendbox_live"> <?php echo dt_translate('paypal_mode'); ?><small class="required">*</small></label>
                                            <select required class="form-control" id="paypal_sendbox_live" name="paypal_sendbox_live">
                                                <option <?php echo ($paypal_sendbox_live == 'S') ? "selected='selected'" : ""; ?> value="S"><?php echo dt_translate('paypal_sendbox'); ?></option>
                                                <option <?php echo ($paypal_sendbox_live == 'L') ? "selected='selected'" : ""; ?> value="L"><?php echo dt_translate('paypal_live'); ?></option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="paypal_client_id"><?php echo dt_translate('paypal_client_id'); ?><small class="required">*</small></label>
                                            <input required id="paypal_client_id" name="paypal_client_id" value="<?php echo $paypal_client_id; ?>" class="form-control" placeholder="<?php echo dt_translate('paypal_client_id'); ?>">
                                            <?php echo form_error('paypal_client_id'); ?>
                                        </div>
                                    </div>

                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="paypal_secret_key"><?php echo dt_translate('paypal_secret_key'); ?><small class="required">*</small></label>
                                            <input required id="paypal_secret_key" name="paypal_secret_key" value="<?php echo $paypal_secret_key; ?>" class="form-control" placeholder="<?php echo dt_translate('paypal_secret_key'); ?>">
                                            <?php echo form_error('paypal_secret_key'); ?>
                                        </div>
                                    </div>

                                    <div class="col-md-12">
                                        <div class="form-group ">
                                            <label for="paystack_public_key"><?php echo dt_translate('webhook_url'); ?></label>
                                            <div class="input-group mb-3">
                                                <input type="text" readonly class="form-control" id="paypal_webhook_url" value="<?php echo base_url('paypal/webhook') ?>" aria-describedby="paypal-basic-addon1"/>
                                                <div class="input-group-prepend" onclick="copy_given_data('paypal_webhook_url')" style="cursor: pointer">
                                                    <span class="input-group-text bg-secondary" id="paypal-basic-addon1"><i class="fa fa-copy"></i></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="col-md-6">

                            </div>
                        </div>
                        <?php endif; ?>

                        <?php if (isset($_GET['type']) && $_GET['type']=='razorpay'): ?>
                            <div class="row">

                                <div class="col-md-6">

                                    <div class="row">
                                        <div class="col-md-12">
                                            <label class="form-label">Razorpay</label>

                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='razorpay' value="Y" type='radio' id='razorpay_yes' <?php echo isset($razorpay_yes) ? $razorpay_yes : ''; ?> >
                                                <label class="custom-control-label" for="razorpay_yes"><?php echo dt_translate('enable'); ?></label>
                                            </div>
                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='razorpay' type='radio'  value='N' id='razorpay_no' <?php echo isset($razorpay_no) ? $razorpay_no : ''; ?> >
                                                <label class="custom-control-label" for='razorpay_no'><?php echo dt_translate('disable'); ?></label>
                                            </div>
                                        </div>
                                        <div class="col-md-12 mt-3">
                                            <div class="form-group">
                                                <label for="stripe_secret">Merchant Key ID<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="razorpay_merchant_key_id" name="razorpay_merchant_key_id" value="<?php echo $razorpay_merchant_key_id; ?>" class="form-control" placeholder="">
                                                <?php echo form_error('stripe_secret'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="stripe_publish">Merchant Key Secret<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="razorpay_merchant_key_secret" name="razorpay_merchant_key_secret" value="<?php echo $razorpay_merchant_key_secret; ?>" class="form-control" placeholder="">
                                                <?php echo form_error('razorpay_merchant_key_secret'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group ">
                                                <label for="paystack_public_key"><?php echo dt_translate('webhook_url'); ?></label>
                                                <div class="input-group mb-3">
                                                    <input type="text" readonly class="form-control" id="razorpay_webhook_url" value="<?php echo base_url('razorpay/webhook') ?>" aria-describedby="razorpay-basic-addon1"/>
                                                    <div class="input-group-prepend" onclick="copy_given_data('razorpay_webhook_url')" style="cursor: pointer">
                                                        <span class="input-group-text bg-secondary" id="razorpay-basic-addon1"><i class="fa fa-copy"></i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                                <div class="col-md-6">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="card">
                                                <div class="card-header">
                                                    How to setup Razorpay
                                                </div>

                                                <div class="card-body">

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>

                        <?php if (isset($_GET['type']) && $_GET['type']=='flutterwave'): ?>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <label class="form-label">Flutterwave</label>
                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='flutterwave' value="Y" type='radio' id='flutterwave_yes' <?php echo isset($flutterwave_yes) ? $flutterwave_yes : ''; ?> >
                                                <label class="custom-control-label" for="flutterwave_yes"><?php echo dt_translate('enable'); ?></label>
                                            </div>
                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='flutterwave' type='radio'  value='N' id='flutterwave_no' <?php echo isset($flutterwave_no) ? $flutterwave_no : ''; ?> >
                                                <label class="custom-control-label" for='flutterwave_no'><?php echo dt_translate('disable'); ?></label>
                                            </div>
                                        </div>
                                        <div class="col-md-12 mt-3">
                                            <div class="form-group">
                                                <label for="stripe_secret">Public Key<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="flutterwave_public_key" name="flutterwave_public_key" value="<?php echo $flutterwave_public_key; ?>" class="form-control" placeholder="">
                                                <?php echo form_error('flutterwave_public_key'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="stripe_publish">Secret Key<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="flutterwave_secret_key" name="flutterwave_secret_key" value="<?php echo $flutterwave_secret_key; ?>" class="form-control" placeholder="">
                                                <?php echo form_error('flutterwave_secret_key'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="stripe_publish">Encryption Key<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="flutterwave_encryption_key" name="flutterwave_encryption_key" value="<?php echo $flutterwave_encryption_key; ?>" class="form-control" placeholder="">
                                                <?php echo form_error('flutterwave_encryption_key'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="flutterwave_env">Environment<small class="required">*</small></label>
                                                <select required class="form-control" id="flutterwave_env" name="flutterwave_env">
                                                    <option <?php echo ($flutterwave_env == 'staging') ? "selected='selected'" : ""; ?> value="staging">staging</option>
                                                    <option <?php echo ($flutterwave_env == 'production') ? "selected='selected'" : ""; ?> value="production">production</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group ">
                                                <label for="paystack_public_key"><?php echo dt_translate('webhook_url'); ?></label>
                                                <div class="input-group mb-3">
                                                    <input type="text" readonly class="form-control" id="flutterwave_webhook_url" value="<?php echo base_url('flutterwave/webhook') ?>" aria-describedby="flutterwave-basic-addon1"/>
                                                    <div class="input-group-prepend" onclick="copy_given_data('flutterwave_webhook_url')" style="cursor: pointer">
                                                        <span class="input-group-text bg-secondary" id="flutterwave-basic-addon1"><i class="fa fa-copy"></i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <div class="col-md-6">

                                    <div class="row">
                                        <div class="card">
                                            <div class="card-header">
                                                How to setup Flutterwave
                                            </div>

                                            <div class="card-body">

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>

                        <?php if (isset($_GET['type']) && $_GET['type']=='paystack'): ?>
                            <div class="row">
                                <div class="col-md-6">

                                    <div class="row">
                                        <div class="col-md-12 mb-3">
                                            <label class="form-label">Paystack</label>
                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='paystack' value="Y" type='radio' id='paystack_yes' <?php echo isset($paystack_yes) ? $paystack_yes : ''; ?>>
                                                <label class="custom-control-label" for="paystack_yes"><?php echo dt_translate('enable'); ?></label>
                                            </div>
                                            <div class="custom-control custom-radio custom-control-inline">
                                                <input class="custom-control-input" name='paystack' type='radio'  value='N' id='paystack_no' <?php echo isset($paystack_no) ? $paystack_no : ''; ?>>
                                                <label class="custom-control-label" for='paystack_no'><?php echo dt_translate('disable'); ?></label>
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label for="paystack_secret">Secret Key<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="paystack_secret_key" name="paystack_secret_key" value="<?php echo $paystack_secret_key; ?>" class="form-control" placeholder="Secret Key">
                                                <?php echo form_error('paystack_secret_key'); ?>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="form-group ">
                                                <label for="paystack_public_key">Public Key<small class="required">*</small></label>
                                                <input required type="text" autocomplete="off" id="paystack_public_key" name="paystack_public_key" value="<?php echo $paystack_public_key; ?>" class="form-control" placeholder="Public Key">
                                                <?php echo form_error('paystack_public_key'); ?>
                                            </div>
                                        </div>



                                        <div class="col-md-12">
                                            <div class="form-group ">
                                                <label for="paystack_public_key">Callback URL</label>
                                                <div class="input-group mb-3">
                                                    <input type="text" readonly class="form-control" id="call_back_url" value="<?php echo base_url('paystack/payment') ?>" aria-describedby="basic-addon1">
                                                    <div class="input-group-prepend" onclick="copy_given_data('call_back_url')" style="cursor: pointer">
                                                        <span class="input-group-text bg-secondary" id="basic-addon1"><i class="fa fa-copy"></i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group ">
                                                <label for="paystack_public_key"><?php echo dt_translate('webhook_url'); ?></label>
                                                <div class="input-group mb-3">
                                                    <input type="text" readonly class="form-control" id="paystack_webhook_url" value="<?php echo base_url('paystack/webhook') ?>" aria-describedby="paystack-basic-addon1">
                                                    <div class="input-group-prepend" onclick="copy_given_data('paystack_webhook_url')" style="cursor: pointer">
                                                        <span class="input-group-text bg-secondary" id="paystack-basic-addon1"><i class="fa fa-copy"></i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>


                                </div>
                                <div class="col-md-6">

                                    <div class="card">
                                        <div class="card-header">
                                            How to setup paystack
                                        </div>

                                        <div class="card-body">

                                            <p class="mb-3">
                                                1. If you already have paystack account then login to your account via <a target="_blank" href="https://dashboard.paystack.com/#/login">https://dashboard.paystack.com/#/login</a>
                                            </p>


                                            <p class="mb-3">
                                                2. After login goto given link <a target="_blank" href="https://dashboard.paystack.com/#/settings/developers">https://dashboard.paystack.com/#/settings/developers</a> there you will find Secret Key, Public Key copy that values and save it to our payment setting page.
                                            </p>

                                            <p class="mb-3">
                                                3. Now copy value of Callback URL & Webhook URL from our system and update it to <a target="_blank" href="https://dashboard.paystack.com/#/settings/developers">https://dashboard.paystack.com/#/settings/developers</a> Callback URL and Webhook URL field.
                                            </p>

                                        </div>

                                    </div>

                                </div>


                            </div>

                        <?php endif; ?>

                        <?php if (isset($_GET['type']) && $_GET['type']=='offline'): ?>
                            <div class="row">
                                <div class="col-md-2">
                                    <label class="form-label">Offline</label>

                                    <div class="custom-control custom-radio custom-control-inline">
                                        <input class="custom-control-input" name='offline' value="Y" type='radio' id='offline_yes' <?php echo isset($on_cash_yes) ? $on_cash_yes : ''; ?> >
                                        <label class="custom-control-label" for="offline_yes"><?php echo dt_translate('enable'); ?></label>
                                    </div>
                                    <div class="custom-control custom-radio custom-control-inline">
                                        <input class="custom-control-input" name='offline' type='radio'  value='N' id='offline_no' <?php echo isset($on_cash_no) ? $on_cash_no : ''; ?> >
                                        <label class="custom-control-label" for='offline_no'><?php echo dt_translate('disable'); ?></label>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="stripe_secret">Details<small class="required">*</small></label>
                                        <textarea rows="5" required type="text" autocomplete="off" id="offline_details" name="offline_details" class="form-control" placeholder="Enter Details here"><?php echo $offline_details; ?></textarea>
                                        <?php echo form_error('offline_details'); ?>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
                    <div class="card-footer">
                        <a class="btn btn-warning" href="<?php echo base_url('admin/setting'); ?>"><?php echo dt_translate('cancel'); ?></a>
                        <button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
                            <?php echo dt_translate('save'); ?>
                        </button>
                    </div>
                </div>
                <?php echo form_close(); ?>
            </div>
        </div>
    </div>
</div>
<?php
include VIEWPATH . 'admin/footer.php';
?>
<script src="<?php echo base_url('assets/admin/js/payment_setting.js') ?>"></script>