<div class="card-data">
<?php $__empty_1 = true; $__currentLoopData = $cards ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div class="dashboard-list-item-wrapper">
<div class="dashboard-list-item sent">
<div class="dashboard-list-left">
<div class="dashboard-list-user-wrapper">
<div class="dashboard-list-user-icon">
<i class="las la-credit-card"></i>
</div>
<div class="dashboard-list-user-content">
<?php
$name = decrypt($item->name) ?? '';
$card_number = decrypt($item->card_number) ?? '';
$card_cvc = decrypt($item->card_cvc) ?? '';
$expiry_date = decrypt($item->expiry_date) ?? '';
?>
<h5 class="title"><?php echo e($name); ?></h5>
<span><?php echo e(__("Card Number")); ?>: ********<?php echo e(substr($card_number, -4)); ?><?php if($item->default == true): ?>
(<?php echo e(__("Default")); ?>)
<?php endif; ?></span>
<span class="date d-block text--danger"><?php echo e(__("Expiry Date")); ?>: <?php echo e($expiry_date); ?> </span>
</div>
</div>
</div>
<div class="dashboard-list-right d-flex align-items-center">
<a href="<?php echo e(setRoute('user.card.make.default',$item->slug)); ?>" class="btn btn--base text-white me-1"><i class="fas fa-check-circle"></i></a>
<button type="button" class="btn--custom small bg--danger border--danger text-white"
data-bs-toggle="modal" data-bs-target="#deleteModal-<?php echo e($item->slug); ?>"><i class="las la-trash-alt"></i></button>
</div>
</div>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start Modal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div class="modal fade" id="deleteModal-<?php echo e($item->slug); ?>" tabindex="-1" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" id="deleteModalLabel">
<h4 class="modal-title"><?php echo e(__("Delete Confirmation")); ?></h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row mb-10-none">
<div class="col-xl-12 col-lg-12">
<h5><?php echo e(__("Are you sure to delete this card?")); ?></h5>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn--base bg--danger border--danger text-white" data-bs-dismiss="modal"><?php echo e(__("Cancel")); ?></button>
<form action="<?php echo e(setRoute('user.card.delete',$item->slug)); ?>" method="post">
<?php echo csrf_field(); ?>
<button type="submit" class="btn--base"><?php echo e(__("Confirm")); ?></button>
</form>
</div>
</div>
</div>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End Modal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<div class="alert alert-primary text-center">
<?php echo e(__("Card not found!")); ?>
</div>
<?php endif; ?>
</div>
<?php /**PATH D:\xampp\htdocs\git\nfcpay\resources\views/user/components/card-table/card.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"
}