wip
This commit is contained in:
@@ -7,14 +7,21 @@ use Illuminate\Support\Facades\Http;
|
|||||||
|
|
||||||
class FetchCardHistoryController extends Controller
|
class FetchCardHistoryController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
|
$request->validate([
|
||||||
|
'passport_serie' => ['required', 'string', 'max:255'],
|
||||||
|
'passport_id' => ['required', 'string', 'max:255'],
|
||||||
|
'card_number' => ['required', 'string', 'max:255'],
|
||||||
|
'card_expiry_date' => ['required', 'string', 'max:255'],
|
||||||
|
]);
|
||||||
|
|
||||||
$response = Http::withBody('{
|
$response = Http::withBody('{
|
||||||
"idSeria": "I-AS",
|
"idSeria": "I-AS",
|
||||||
"idNo": "314567",
|
"idNo": "314567",
|
||||||
"clientType":"recipient",
|
|
||||||
"cardMaskNumber":"993403******3258",
|
"cardMaskNumber":"993403******3258",
|
||||||
"expDate": "07/49"
|
"expDate": "07/49"
|
||||||
|
"clientType":"recipient",
|
||||||
}')->acceptJson()->post('http://10.3.158.102:9999/api/clientinfo');
|
}')->acceptJson()->post('http://10.3.158.102:9999/api/clientinfo');
|
||||||
|
|
||||||
return $response->body();
|
return $response->body();
|
||||||
|
|||||||
10
resources/js/vendor/nova/js/additional.js
vendored
10
resources/js/vendor/nova/js/additional.js
vendored
@@ -3,13 +3,21 @@ function csrf_token()
|
|||||||
return document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
return document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchCardHistory() {
|
async function fetchCardHistory(passport_serie, passport_id, card_number, card_expiry_date) {
|
||||||
|
if (! passport_serie || ! passport_id || ! card_number || ! card_expiry_date) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let cardHistoryDetailContainer = document.getElementById('card-history-details');
|
let cardHistoryDetailContainer = document.getElementById('card-history-details');
|
||||||
|
|
||||||
var headers = new Headers();
|
var headers = new Headers();
|
||||||
headers.append('Accept', 'application/json');
|
headers.append('Accept', 'application/json');
|
||||||
|
|
||||||
var formdata = new FormData();
|
var formdata = new FormData();
|
||||||
|
formdata.append('passport_serie', passport_serie);
|
||||||
|
formdata.append('passport_id', passport_id);
|
||||||
|
formdata.append('card_number', card_number);
|
||||||
|
formdata.append('card_expiry_date', card_expiry_date);
|
||||||
|
|
||||||
fetch('/api/fetch-card-history', {
|
fetch('/api/fetch-card-history', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@@ -42,7 +42,15 @@
|
|||||||
|
|
||||||
<div class="credit-card-container">
|
<div class="credit-card-container">
|
||||||
<div class="credit-card">
|
<div class="credit-card">
|
||||||
<div class="card-number text-white cursor-pointer" onclick="fetchCardHistory()">{{ $resource->card_number }}</div>
|
<div
|
||||||
|
class="card-number text-white cursor-pointer"
|
||||||
|
onclick="fetchCardHistory(
|
||||||
|
'{{ $resource->passport_serie }}',
|
||||||
|
'{{ $resource->passport_id }}',
|
||||||
|
'{{ $resource->card_number }}',
|
||||||
|
'{{ $resource->card_month }}/{{ $resource->card_year }}'
|
||||||
|
)"
|
||||||
|
>{{ $resource->card_number }}</div>
|
||||||
<div class="expiry-container">
|
<div class="expiry-container">
|
||||||
<div class="card-holder text-white">{{ $resource->card_name }}</div>
|
<div class="card-holder text-white">{{ $resource->card_name }}</div>
|
||||||
<div class="expiry-date text-white">{{ $resource->card_month }}/{{ $resource->card_year }}</div>
|
<div class="expiry-date text-white">{{ $resource->card_month }}/{{ $resource->card_year }}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user