This commit is contained in:
2025-05-26 21:40:03 +05:00
parent 808742b781
commit d0d26039d3
3 changed files with 38 additions and 18 deletions

View File

@@ -10,17 +10,28 @@ class ApiTesterController extends Controller
{
public function index(Request $request)
{
$request->validate([
'passport_serie' => ['required', 'string', Rule::in(PassportRepo::values())],
'passport_number' => ['required', 'numeric', 'digits:6'],
'card_number_masked' => ['required', 'string', 'max:255'],
'card_expire_date' => ['required', 'string', 'max:255'],
'start_date' => ['required', 'date'],
'end_date' => ['required', 'date'],
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://10.3.158.102:9999/api/clientinfo/all',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{ "idSeria": "I-AS", "idNo": "314567", "clientType": "recipient", "cardMaskNumber": "993403******3258", "expDate": "07/49", "fromDate" : "01.01.2020", "toDate" : "09.05.2025" }',
CURLOPT_HTTPHEADER => [
'Authorization: Basic dGJ1c2VyOlFBWndzeDEyMw==',
'Content-Type: application/json',
],
]);
// $this->fetchApi($data['foo']);
$response = curl_exec($curl);
// return "<pre>{$response}</pre>";
curl_close($curl);
return "<pre>{$response}</pre>";
}
}