<?php $__env->startSection('page_title', __('Edit Payment Method')); ?>
<?php $__env->startPush('extra_styles'); ?>
	<link href="<?php echo e(asset('assets/dashboard/css/select2.min.css')); ?>" rel="stylesheet" type="text/css">
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
	<div class="main-content">
		<section class="section">
			<div class="section-header">
				<h1><?php echo app('translator')->get("Edit"); ?> <?php echo e(trans($method->name)); ?></h1>
				<div class="section-header-breadcrumb">
					<div class="breadcrumb-item active">
						<a href="<?php echo e(route('admin.home')); ?>"><?php echo app('translator')->get('Dashboard'); ?></a>
					</div>
					<div class="breadcrumb-item"><?php echo app('translator')->get("Edit"); ?> <?php echo e(trans($method->name)); ?></div>
				</div>
			</div>

			<div class="row mb-3">
				<div class="container-fluid" id="container-wrapper">
					<div class="row">
						<div class="col-lg-12">
							<div class="card mb-4 card-primary shadow">
								<div
									class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
									<h6 class="m-0 font-weight-bold text-primary"><?php echo app('translator')->get("Edit"); ?> <?php echo e(trans($method->name)); ?></h6>
									<a href="<?php echo e(route('payment.methods')); ?>" class="btn btn-sm btn-outline-primary"> <i
											class="fas fa-arrow-left"></i> <?php echo app('translator')->get('Back'); ?></a>
								</div>
								<div class="card-body">
									<form method="post" action="<?php echo e(route('update.payment.methods', $method->id)); ?>"
										  enctype="multipart/form-data">
										<?php echo csrf_field(); ?>
										<?php echo method_field('put'); ?>
										<div class="row">
											<div class="col-md-6">
												<div class="form-group">
													<label for="name"><?php echo app('translator')->get('Name'); ?></label>
													<input type="text" value="<?php echo e(old('name', $method->name ?? '')); ?>"
														   name="name"
														   class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
														   disabled required>
													<div class="invalid-feedback">
														<?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
													</div>
												</div>
											</div>
											<?php if($method->currencies): ?>
												<div class="col-md-6">
													<div class="form-group">
														<label for="currency"><?php echo app('translator')->get('Currency'); ?></label>
														<select
															class="form-control currency-change <?php $__errorArgs = ['currency'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
															name="currency" required>
															<option disabled selected><?php echo app('translator')->get('Select Currency'); ?></option>
															<?php $__currentLoopData = $method->currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
																<?php $__currentLoopData = $currency; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $curKey => $singleCurrency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
																	<option value="<?php echo e($curKey); ?>"
																			<?php echo e(old('currency', $method->currency) == $curKey ? 'selected' : ''); ?> data-fiat="<?php echo e($key); ?>"><?php echo e(trans($curKey)); ?></option>
																<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
															<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
														</select>
														<div class="invalid-feedback">
															<?php $__errorArgs = ['currency'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
														</div>
													</div>
												</div>
											<?php endif; ?>
											<div class="col-md-6">
												<div class="form-group">
													<label for="currency_symbol"><?php echo app('translator')->get('Currency Symbol'); ?></label>
													<input type="text"
														   class="form-control <?php $__errorArgs = ['currency_symbol'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
														   name="currency_symbol"
														   value="<?php echo e(old('currency_symbol', $method->symbol ?? '')); ?>"
														   required>
													<div class="invalid-feedback">
														<?php $__errorArgs = ['currency_symbol'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
													</div>
												</div>
											</div>
										</div>
										<div class="row">
											<?php $__currentLoopData = $method->parameters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $parameter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
												<div class="col-md-6">
													<div class="form-group">
														<label
															for="<?php echo e($key); ?>"><?php echo e(__(strtoupper(str_replace('_',' ', $key)))); ?></label>
														<input type="text" name="<?php echo e($key); ?>"
															   value="<?php echo e(old($key, $parameter)); ?>"
															   id="<?php echo e($key); ?>"
															   class="form-control <?php $__errorArgs = [$key];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
														<div class="invalid-feedback">
															<?php $__errorArgs = [$key];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
														</div>
													</div>
												</div>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</div>
										<?php if($method->extra_parameters): ?>
											<div class="row">
												<?php $__currentLoopData = $method->extra_parameters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $param): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
													<div class="col-md-6">
														<div class="form-group">
															<label
																for="<?php echo e($key); ?>"><?php echo e(__(strtoupper(str_replace('_',' ', $key)))); ?></label>
															<div class="input-group">
																<input type="text" name="<?php echo e($key); ?>"
																	   class="form-control <?php $__errorArgs = [$key];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
																	   value="<?php echo e(old($key, route($param, $method->code ))); ?>"
																	   disabled>
																<div class="input-group-append">
																	<button type="button"
																			class="btn btn-info copy-btn btn-sm">
																		<i class="fas fa-copy"></i>
																	</button>
																</div>
															</div>
															<div class="invalid-feedback">
																<?php $__errorArgs = [$key];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
															</div>
														</div>
													</div>
												<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
											</div>
										<?php endif; ?>
										<div class="row align-items-center">
											<div class="col-md-6">
												<div class="form-group mb-4">
													<label class="col-form-label"><?php echo app('translator')->get('Image'); ?></label>
													<div id="image-preview" class="image-preview"
														 style="background-image: url(<?php echo e(getFile(config('location.gateway.path') . $method->image) ? : 0); ?>);">
														<label for="image-upload"
															   id="image-label"><?php echo app('translator')->get('Choose File'); ?></label>
														<input type="file" name="image"
															   class="<?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
															   id="image-upload"/>
													</div>
													<div class="invalid-feedback">
														<?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
													</div>
												</div>
											</div>
											<div class="col-md-3">
												<div class="form-group">
													<label><?php echo app('translator')->get('Enable to active'); ?></label>
													<div class="selectgroup w-100">
														<label class="selectgroup-item">
															<input type="radio" name="status" value="0"
																   class="selectgroup-input" <?php echo e(old('status', $method->status) == 0 ? 'checked' : ''); ?>>
															<span class="selectgroup-button"><?php echo app('translator')->get('OFF'); ?></span>
														</label>
														<label class="selectgroup-item">
															<input type="radio" name="status" value="1"
																   class="selectgroup-input" <?php echo e(old('status', $method->status) == 1 ? 'checked' : ''); ?>>
															<span class="selectgroup-button"><?php echo app('translator')->get('ON'); ?></span>
														</label>
													</div>
													<?php $__errorArgs = ['status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
													<span class="text-danger" role="alert">
														<strong><?php echo e(__($message)); ?></strong>
													</span>
													<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
												</div>
											</div>
											<?php if($method->is_sandbox == 1): ?>
												<div class="col-md-3">
													<div class="form-group">
														<label><?php echo app('translator')->get('Enable test environment'); ?></label>
														<div class="selectgroup w-100">
															<label class="selectgroup-item">
																<input type="radio" name="environment" value="live"
																	   class="selectgroup-input" <?php echo e(old('environment', $method->environment) == 'live' ? 'checked' : ''); ?>>
																<span class="selectgroup-button"><?php echo app('translator')->get('OFF'); ?></span>
															</label>
															<label class="selectgroup-item">
																<input type="radio" name="environment" value="test"
																	   class="selectgroup-input" <?php echo e(old('environment', $method->environment) == 'test' ? 'checked' : ''); ?>>
																<span class="selectgroup-button"><?php echo app('translator')->get('ON'); ?></span>
															</label>
														</div>
														<?php $__errorArgs = ['environment'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
														<span class="text-danger" role="alert">
															<strong><?php echo e(__($message)); ?></strong>
														</span>
														<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
													</div>
												</div>
											<?php endif; ?>
										</div>
										<button type="submit"
												class="btn btn-block btn-primary"><?php echo app('translator')->get('Save Changes'); ?></button>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</section>
	</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('extra_scripts'); ?>
	<script src="<?php echo e(asset('assets/dashboard/js/select2.min.js')); ?>"></script>
	<script src="<?php echo e(asset('assets/dashboard/js/jquery.uploadPreview.min.js')); ?>"></script>
<?php $__env->stopPush(); ?>
<?php $__env->startSection('scripts'); ?>
	<script>
		'use strict'
		$(document).ready(function () {
			$('.currency-change').select2();
			setCurrency();
			$(document).on('change', '.currency-change', function () {
				setCurrency();
			});

			function setCurrency() {
				let currency = $('.currency-change').val();
				let fiatYn = $('.currency-change option:selected').attr('data-fiat');
				if (fiatYn == 0) {
					$('.set-currency').text(currency);
				} else {
					$('.set-currency').text('USD');
				}
			}

			$(document).on('click', '.copy-btn', function () {
				let _this = $(this)[0];
				let copyText = $(this).parents('.input-group-append').siblings('input');
				$(copyText).prop('disabled', false);
				copyText.select();
				document.execCommand("copy");
				$(copyText).prop('disabled', true);
				$(this).text('Coppied');
				setTimeout(function () {
					$(_this).text('');
					$(_this).html('<i class="fas fa-copy"></i>');
				}, 500);
			});

			$.uploadPreview({
				input_field: "#image-upload",
				preview_box: "#image-preview",
				label_field: "#image-label",
				label_default: "Choose File",
				label_selected: "Change File",
				no_label: false
			});
		});
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xamp\htdocs\Paysecure-wallet\project\resources\views/admin/payment_methods/edit.blade.php ENDPATH**/ ?>