<?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**/ ?>
Initiates a new payment transaction.
create-order
| Parameter | Type | Details |
|---|---|---|
| amount | decimal | Your Amount , Must be rounded at 2 precision. |
| currency | string | Currency Code, Must be in Upper Case (Alpha-3 code) |
| success_url | string | Enter your return or success URL |
| cancel_url | string (optional) | Enter your cancel or failed URL |
Request Example (guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', $base_url.'create-order', [
'headers' => [
'Authorization' => 'Bearer '. $authorizationToken,
'accept' => 'application/json',
'content-type' => 'application/json',
],
'form_params' => [
'amount' => '$amount',
'currency' => 'currency',
'success_url' => 'success_url',
'cancel_url' => 'cancel_url',
],
]);
echo $response->getBody();
**Response: SUCCESS (200 OK)**
{
"message": {
"success": [
"Order created successfully."
]
},
"data": {
"redirect_url":"https://example.com/login/OISADFDFSDFSF",
"order_details":{
"amount" : "10",
"fixed_charge" : 2,
"percent_charge" : 1,
"total_charge" : 3,
"total_payable" : 13,
"currency" : "USD",
"expiry_time": "2024-04-25T06:48:35.984285Z",
"success_url": "http://127.0.0.1/nfcpay/user/transaction/success",
"cancel_url": "http://127.0.0.1/nfcpay/user/transaction/cancel"
}
},
"type": "success"
}
**Response: ERROR (400 FAILED)**
{
"message": {
"error": [
"Invalid token."
]
},
"data": null,
"type": "error"
}