<div class="navbar-wrapper">
<div class="dashboard-title-part">
<div class="left">
<div class="icon">
<button class="sidebar-menu-bar">
<i class="fas fa-exchange-alt"></i>
</button>
</div>
<div class="dashboard-path">
<?php echo $__env->yieldContent('breadcrumb'); ?>
</div>
</div>
<div class="right">
<?php
$current_url = URL::current();
?>
<?php if($current_url == setRoute('user.card.index') || $current_url == setRoute('user.transaction.log.card.payment') || $current_url == setRoute('user.transaction.log.add.money') || $current_url == setRoute('user.transaction.log.transfer.money')): ?>
<form class="header-search-wrapper">
<div class="position-relative">
<input class="form-control" type="text" name="search_text" placeholder="<?php echo e(__("Ex: Cards or Trx")); ?>" aria-label="Search">
<span class="las la-search"></span>
</div>
</form>
<?php endif; ?>
<div class="language-select me-2">
<?php
$__current_local = session("local") ?? get_default_language_code();
?>
<select class="nice-select" name="lang_switcher" id="">
<?php $__currentLoopData = $__languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $__item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($__item->code); ?>" <?php if($__current_local == $__item->code): ?>
<?php if(true): echo 'selected'; endif; ?>
<?php endif; ?>><?php echo e($__item->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="header-notification-wrapper">
<button class="notification-icon">
<i class="las la-bell"></i>
</button>
<div class="notification-wrapper">
<div class="notification-header">
<h5 class="title"><?php echo e(__("Notification")); ?></h5>
</div>
<ul class="notification-list">
<?php $__currentLoopData = get_user_notifications() ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li>
<div class="thumb">
<img src="<?php echo e(auth()->user()->userImage ?? asset('public/frontend/images/user/user-1.png')); ?>" alt="user">
</div>
<div class="content">
<div class="title-area">
<h5 class="title"><?php echo e(__(@$item->details->title)); ?></h5>
</div>
<span class="sub-title"><?php echo e(__("Amount")); ?> :<?php echo e(get_amount(@$item->details->amount,@$item->details->currency)); ?>, <?php echo e(@$item->details->message); ?></span>
</div>
</li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
</div>
<div class="header-user-wrapper">
<div class="header-user-thumb">
<a href="<?php echo e(setRoute('user.profile.index')); ?>"><img src="<?php echo e(auth()->user()->userImage ?? asset('public/frontend/images/user/user-1.png')); ?>" alt="client"></a>
</div>
</div>
</div>
</div>
</div>
<?php $__env->startPush('script'); ?>
<script>
$("select[name=lang_switcher]").change(function(){
var selected_value = $(this).val();
var submitForm = `<form action="<?php echo e(setRoute('frontend.languages.switch')); ?>" id="local_submit" method="POST"> <?php echo csrf_field(); ?> <input type="hidden" name="target" value="${$(this).val()}" ></form>`;
$("body").append(submitForm);
$("#local_submit").submit();
});
</script>
<?php $__env->stopPush(); ?><?php /**PATH D:\xampp\htdocs\git\nfcpay\resources\views/user/partials/top-nav.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"
}