I am integrating the third party API but getting port 443 after 127226 ms: Couldn't connect to server
GuzzleHttp\Exception\ConnectException cURL error 28: Failed to connect to xxxxx.xx port 443 after 127226 ms:
Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://xxxxxxxxx/api/v1/service/recharge/recharge/getoperator
CODE
public function mobileRecharge()
{
$data = recharge::latest()->where('recharge_type', 1)->where('ret_id', Auth::id())->paginate(10);
$circle_ref = [];
$circle = [];
$operators = [];
try {
$payload = [
'partnerId' => ENV('PARTNERID'),
'timestamp' => time(),
];
return $token = JWT::encode($payload, ENV('JWT_SECRET_KEY'), 'HS256');
$client = new Client();
$response = $client->post('https://API-URL/api/v1/service/recharge/recharge/getoperator', [
'headers' => [
'Token' => $token,
'accept' => 'application/json',
],
]);
$resp = json_decode($response->getBody(), true);
return $operators = $resp['data'];
Log::debug($resp);
// RETURNING A VIEW WITH ALL MOBILE RECHARGE TRANSACTIONS HISTORY
return view('employee.recharges.mobile.recharge', compact('data', 'circle', 'operators'));
} catch (Exception $e) {
return $e;
return view('employee.recharges.mobile.recharge', compact('data', 'circle', 'operators'));
}
}
This is the full error message I get. I tried contacting the server provider they told me to white list the API IP. I did, but not working. It works fine in the POSTMAN.