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'], ]); $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'http://10.3.158.102:9999/api/clientinfo', 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 => sprintf('{ "idSeria": "%s", "idNo": "%s", "clientType": "recipient", "cardMaskNumber": "%s", "expDate": "%s" }', $request->passport_serie, $request->idNo, Str::mask('9934032100858088', '*', 6, 6), $request->card_expiry_date, ), CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json', ], ]); $response = curl_exec($curl); curl_close($curl); return $response; } }