public static function getToken()
{
try {
$guzzle = new Client([
'headers' => [
'Content-Type' => 'application/json',
],
/ Desativar SSL/
'verify' => true
]);
$response = $guzzle->request('POST', 'https://api-pix-h.gerencianet.com.br/oauth/token',
[
'grant_type' => 'client_credentials',
'client_id' => 'Client_Id_e6e0827b856f2b',
'client_secret' => 'Client_Secret_477f1d5694cd27029a82',
'cert' => [storage_path('app/public/certificados/files/h-329571-erp_tributos.pem'), null],
]
);
$body = $response->getBody();
$contents = $body->getContents();
$token = json_decode($contents);
return $token->access_token;
} catch (GuzzleException $e) {
echo $e->getMessage();
}
}
Não consigo acessar a autenticação na api
Gera esse erro
Server error: POST https://api-pix-h.gerencianet.com.br/oauth/token resulted in a 500 Internal Server Error response: {"nome":"erro_interno_servidor","mensagem":"Erro interno do servidor"}