<?php
$cookie = App\Models\Admin\SiteSections::where('key','site_cookie')->first();
//cookies results
$approval_status = request()->cookie('approval_status');
$c_user_agent = request()->cookie('user_agent');
$c_ip_address = request()->cookie('ip_address');
$c_browser = request()->cookie('browser');
$c_platform = request()->cookie('platform');
//system informations
$s_ipAddress = request()->ip();
$s_location = geoip()->getLocation($s_ipAddress);
$s_browser = Agent::browser();
$s_platform = Agent::platform();
$s_agent = request()->header('User-Agent');
?>
<!DOCTYPE html>
<html lang="<?php echo e(get_default_language_code()); ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
<title><?php echo e((isset($page_title) ? __($page_title) : __("Public"))); ?></title>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet">
<link
href="https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<?php echo $__env->make('partials.header-asset', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldPushContent('css'); ?>
</head>
<body>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start Body Overlay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div id="body-overlay" class="body-overlay"></div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End Body Overlay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start Scroll-To-Top
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<a href="#" class="scrollToTop">
<i class="las la-hand-point-up"></i>
<small><?php echo e(__("top")); ?></small>
</a>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End Scroll-To-Top
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<?php echo $__env->make('frontend.partials.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldContent("content"); ?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start cookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div class="cookie-main-wrapper">
<div class="cookie-content">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21.598 11.064a1.006 1.006 0 0 0-.854-.172A2.938 2.938 0 0 1 20 11c-1.654 0-3-1.346-3.003-2.937c.005-.034.016-.136.017-.17a.998.998 0 0 0-1.254-1.006A2.963 2.963 0 0 1 15 7c-1.654 0-3-1.346-3-3c0-.217.031-.444.099-.716a1 1 0 0 0-1.067-1.236A9.956 9.956 0 0 0 2 12c0 5.514 4.486 10 10 10s10-4.486 10-10c0-.049-.003-.097-.007-.16a1.004 1.004 0 0 0-.395-.776zM12 20c-4.411 0-8-3.589-8-8a7.962 7.962 0 0 1 6.006-7.75A5.006 5.006 0 0 0 15 9l.101-.001a5.007 5.007 0 0 0 4.837 4C19.444 16.941 16.073 20 12 20z"/><circle cx="12.5" cy="11.5" r="1.5"/><circle cx="8.5" cy="8.5" r="1.5"/><circle cx="7.5" cy="12.5" r="1.5"/><circle cx="15.5" cy="15.5" r="1.5"/><circle cx="10.5" cy="16.5" r="1.5"/></svg>
<?php if($cookie && $cookie->value): ?>
<p class="text-white"><?php echo e(__(strip_tags($cookie->value->desc ?? ''))); ?> <a href="<?php echo e(url('link').'/'.$cookie->value->link ?? ''); ?>"><?php echo e(__("Privacy Policy")); ?></a></p>
<?php endif; ?>
</div>
<div class="cookie-btn-area">
<button class="cookie-btn"><?php echo e(__("Allow")); ?></button>
<button class="cookie-btn-cross"><?php echo e(__("Decline")); ?></button>
</div>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End cookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<?php echo $__env->make('frontend.partials.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('partials.footer-asset', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('frontend.partials.extensions.tawk-to', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldPushContent('script'); ?>
<script>
var status = "<?php echo e(@$cookie->status); ?>";
//cookies results
var approval_status = "<?php echo e($approval_status); ?>";
var c_user_agent = "<?php echo e($c_user_agent); ?>";
var c_ip_address = "<?php echo e($c_ip_address); ?>";
var c_browser = "<?php echo e($c_browser); ?>";
var c_platform = "<?php echo e($c_platform); ?>";
//system informations
var s_ipAddress = "<?php echo e($s_ipAddress); ?>";
var s_browser = "<?php echo e($s_browser); ?>";
var s_platform = "<?php echo e($s_platform); ?>";
var s_agent = "<?php echo e($s_agent); ?>";
const pop = document.querySelector('.cookie-main-wrapper')
if( status == 1){
if(approval_status == 'allow' || approval_status == 'decline' || c_user_agent === s_agent || c_ip_address === s_ipAddress || c_browser === s_browser || c_platform === s_platform){
pop.style.bottom = "-300px";
}else{
window.onload = function(){
setTimeout(function(){
pop.style.bottom = "20px";
}, 2000)
}
}
}else{
pop.style.bottom = "-300px";
}
// })
</script>
<script>
(function ($) {
"use strict";
//Allow
$('.cookie-btn').on('click', function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
var postData = {
type: "allow",
};
$.post('<?php echo e(route('global.set.cookie')); ?>', postData, function(response) {
throwMessage('success', [response]);
setTimeout(function() {
location.reload();
}, 1000);
});
});
//Decline
$('.cookie-btn-cross').on('click', function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
var postData = {
type: "decline",
};
$.post('<?php echo e(route('global.set.cookie')); ?>', postData, function(response) {
throwMessage('error',[response]);
setTimeout(function(){
location.reload();
},1000);
});
});
})(jQuery)
</script>
</body>
</html><?php /**PATH D:\xampp\htdocs\git\nfcpay\resources\views/frontend/layouts/master.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"
}