<?php if(isset($gateway)): ?>
<div class="payment-gateway-currencies-wrapper">
<?php $__currentLoopData = $gateway->currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="custom-card mt-15 gateway-currency" id="<?php echo e(Str::lower($item->currency_code) . "-block"); ?>" data-target="<?php echo e($item->id); ?>">
<div class="card-header">
<h6 class="currency-title"><?php echo e($item->name); ?></h6>
</div>
<div class="card-body">
<div class="row align-items-center">
<div class="col-xl-2 col-lg-2 form-group">
<?php echo $__env->make('admin.components.form.input-file',[
'label' => __("Gateway Image"),
'name' => "gateway_currency[".$item->currency_code."][image]",
'class' => "file-holder",
'old_files_path' => files_asset_path('payment-gateways'),
'old_files' => $item->image,
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
<div class="col-xl-3 col-lg-3 mb-10">
<div class="custom-inner-card">
<div class="card-inner-header">
<h5 class="title"><?php echo e(__("Amount Limit")); ?></h5>
</div>
<div class="card-inner-body">
<div class="row">
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<?php echo $__env->make('admin.components.form.input-amount',[
'label' => __("Minimum"),
'name' => "gateway_currency[".$item->currency_code."][min_limit]",
'value' => old("gateway_currency.".$item->currency_code.".min_limit",$item->min_limit),
'currency' => $item->currency_code,
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<?php echo $__env->make('admin.components.form.input-amount',[
'label' => __("Maximum"),
'name' => "gateway_currency[".$item->currency_code."][max_limit]",
'value' => old("gateway_currency.".$item->currency_code.".max_limit",$item->max_limit),
'currency' => $item->currency_code,
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-3 mb-10">
<div class="custom-inner-card">
<div class="card-inner-header">
<h5 class="title"><?php echo e(__("Charge")); ?></h5>
</div>
<div class="card-inner-body">
<div class="row">
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<?php echo $__env->make('admin.components.form.input-amount',[
'label' => __("Fixed"),
'name' => "gateway_currency[".$item->currency_code."][fixed_charge]",
'value' => old("gateway_currency.".$item->currency_code.".fixed_charge",$item->fixed_charge),
'currency' => $item->currency_code,
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<?php echo $__env->make('admin.components.form.input-amount',[
'label' => __("Percent"),
'name' => "gateway_currency[".$item->currency_code."][percent_charge]",
'value' => old("gateway_currency.".$item->currency_code.".percent_charge",$item->percent_charge),
'currency' => "%",
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4 col-lg-4 mb-10">
<div class="custom-inner-card">
<div class="card-inner-header">
<h5 class="title"><?php echo e(__("Rate")); ?></h5>
</div>
<div class="card-inner-body">
<div class="row">
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<label><?php echo e(__("Rate")); ?></label>
<div class="input-group">
<span class="input-group-text append ">1 <span class="default-currency"><?php echo e(get_default_currency_code($default_currency)); ?></span> = </span>
<input type="number" class="form--control" value="<?php echo e(old("gateway_currency.".$item->currency_code.".rate",$item->rate)); ?>" name="<?php echo e("gateway_currency[".$item->currency_code."][rate]"); ?>">
<span class="input-group-text"><?php echo e($item->currency_code); ?></span>
</div>
</div>
</div>
<div class="col-xxl-12 col-xl-6 col-lg-6 form-group">
<div class="form-group">
<?php echo $__env->make('admin.components.form.input',[
'label' => __("Symbol"),
'name' => "gateway_currency[".$item->currency_code."][currency_symbol]",
'value' => old("gateway_currency.".$item->currency_code.".currency_symbol",$item->currency_symbol),
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php endif; ?><?php /**PATH /home/kueuepay/public_html/resources/views/admin/components/payment-gateway/automatic/gateway-currency.blade.php ENDPATH**/ ?>
Get access token to initiates payment transaction.
generate-token
| Parameter | Type | Comments |
|---|---|---|
| client_id | string | Enter merchant API client/primary key |
| secret_id | string | Enter merchant API secret key |
| env | string | Enter merchant API environment |
| merchant_id | string | Enter merchant API merchant id |
Request Example (guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', $base_url. 'v1/generate-token', [
'headers' => [
'accept' => 'application/json',
'content-type' => 'application/json',
],
'form_params' => [
'client_id' => '$client_id',
'secret_id' => 'secret_id',
'env' => 'env',
'merchant_id' => 'merchant_id',
],
]);
echo $response->getBody();
**Response: SUCCESS (200 OK)**
{
"message": {
"success": [
"Successfully token is generated"
]
},
"data": {
"token":"eyJpdiI6InpkczhjTjhQdVhUL2lKQ0pSUUx6aUE9PSIsInZhbHVlIjoiVGVBTVBDTXltbjNZcEIvdEJveGpTSno3TU5NRUtnVkhCZ1pHTFNCUnZGQ2UxMnYxN202cEE1YVRDTEFsc0ZERExoTjdtL0dTL2xoU3QzeUJJOExiMUx5T0w1L0llUXhTUkU1cWVLWEdEbEplb0dKNXcwbTNRM0VxdkUwYzZuNFdtNkhMQ0pRZysyNWkvdzBxSlBoSVBSOGFTekNnR2RXNHVtcG9lMGZOTmNCcm1hR3c5Sk9KTnB4Y3ltZDl6cm90MThrR21Ca3B1azc3bXRiQ0J6SW96UVo1elNkU1ZqeE05bTcwWGp1MEUxWlJFdnNWTmpSbnVpeW92b2U4dXZkUGgyb1VmK0luaGdyaFlsVTZlcVpVRnZlTG1DeFF6Ykk2T2h6Z3JzbnIyNHpNdHowSE5JdDR0Y0pZT20zUm1XYW8iLCJtYWMiOiJlY2M4NGE1OGUzYzkzYzk0YzljNmVmNjE0YWI0ZDIwOGI3NDQ2YWEyY2ZhNzc0NzE4ZmY1ZmYyMz
IyZmQzNDY1IiwidGFnIjoiIn0=",
},
"type": "success"
}
**Response: ERROR (400 FAILED)**
{
"message": {
"error": [
"Invalid credentials."
]
},
"data": null,
"type": "error"
}