Histórico de mensagens sobre credentials em bolix

EXIBINDO CONVERSAS RECENTES:

Texto: credentials
Canal: bolix
Avatar discord do usuario felipe5372

felipe5372

Bom dia pessoal, ao mudar status do boleto o notification está apresentando erro de ambiente isso em produção: "{\"message\":\"An error has occurred.\",\"exceptionMessage\":\"Could not authenticate. Please make sure you are using correct credentials and if you are using then in the correct environment.\",\"exceptionType\":\"Gerencianet.SDK.GnException\",\"stackTrace\":\" at Ger"

Avatar discord do usuario guilherme_efi

guilherme_efi

Ver Respostas

Bom dia, @gustavopsan. Tudo bem?
A falha Unauthorized ocorre devido a credenciais inválidas, ou são porque são de outro ambiente.
No arquivo credentials.js da SDK, se o parâmetro sandbox estiver igual a false insira as credenciais de produção, se true informe as de homologação.
Nos conte aqui se a falha persistir. 😉

Avatar discord do usuario felipe5372

felipe5372

fui gerar um boleto em produção deu mensagem que minhas credenciais estão invalidas - "Could not authenticate. Please make sure you are using correct credentials and if you are using then in the correct environment." obs: estou colocando o chave clienId e secrect client de prod correto ! alguém sabe oque pode ser ?

Avatar discord do usuario miauzinho013

miauzinho013

Bom dia!, aqui está o código:


const credentials = require('../config/gerencianet')
const Gerencianet = require('gn-api-sdk-node');

const options = {
client_id: credentials.client_id,
client_secret: credentials.client_secret,
sandbox: true,
pix_cert: credentials.pix_cert,
};
console.log(options)
const gerencianet = new Gerencianet(options);

var body = {

payment: {
banking_billet: {
expire_at: '2020-06-12',
customer: {
name: 'Gorbadoc Oldbuck',
email: '[email protected]',
cpf: '04267484171',
birth: '2020-06-10',
phone_number: '5144916523' ,
juridical_person: {
corporate_name: 'Empresa Gorbadoc',
cnpj:'92247037000137'
}
}
}
},

items: [{
name: 'Product 1',
value: 1000,
amount: 2
}],
shippings: [{
name: 'Default Shipping Cost',
value: 100
}]
}

gerencianet
.createCharge({}, body)
.then(console.log)
.catch(console.log)

Avatar discord do usuario dinaelmiranda

dinaelmiranda

MultiValueMap requestBody = new LinkedMultiValueMap<>();
requestBody.add("grant_type", "client_credentials");

Avatar discord do usuario fernandomm.

fernandomm.

Estou com um erro ao tentar gerar boleto hoje, o seguinte erro "Could not authenticate. Please make sure you are using correct credentials and if you are using then in the correct environment." Antes estava funcionando tudo certo, só hoje deu esse erro.

Avatar discord do usuario hiagosilvas

hiagosilvas

No payload da requisição, lembre-se de colocar:

{
"grant_type": "client_credentials"
}

Avatar discord do usuario Agus Rubio

Agus Rubio

Oi, tudo bem? Sou da Tuna Pagamentos, a gente está tentando ativar uns clientes que querem utilizar gerencia net. Eles enviaram as chaves de prod, mas quando tentamos autenticar da "{\"error\":\"invalid_client\",\"error_description\":\"Invalid or inactive credentials\"}"

Avatar discord do usuario andresisdanca

andresisdanca

Ver Respostas

Os parametros são estes aqui para pegar o token?

String basicAuth = Base64.getEncoder().encodeToString(((this.clienteId + ':' + this.clienteSecret).getBytes()));

HttpPost httpPost = new HttpPost(rota);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Authorization", "Basic " + basicAuth);
String requestJson = "{"grant_type": "client_credentials"}";

Retirei o certificado e estou na rota https://sandbox.gerencianet.com.br/v1/authorize

E continua dando não autorizado.

Esta API de vcs não tive muito sucesso com ela ... desculpe.

Será que estou com o Bolix liberado para realizar as transações?
O Cliente Id e o ClienteSecret é o mesmo do PIX?

Avatar discord do usuario andresisdanca

andresisdanca

Estou chamado o endereço https://sandbox.gerencianet.com.br/v1/authorize para poder pegar o token para gerar o Bolix. Estou recebendo token Unauthorized.

Estou usando

HttpPost httpPost = new HttpPost(rota);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Authorization", "Basic " + basicAuth);

String requestJson = "{\"grant_type\": \"client_credentials\"}";

Avatar discord do usuario andresisdanca

andresisdanca

Onde eu pego este valor: options.put("partner_token", credentials.getPartnerToken()); ???

Avatar discord do usuario jessica_efi

jessica_efi

Certo. Mas utilize a sdk dessa forma que não terá nenhuma falha. Faça um teste inserindo suas credenciais no arquivo credentials.json e no arquivo OneStepBankingBillet.cs não faça nenhuma alteração.

Avatar discord do usuario jessica_efi

jessica_efi

Ver Respostas

Certo. No arquivo credentials.json (Gerencianet.NETCore.SDK.Examples/credentials.json) você inseriu suas credenciais e definiu o sandbox?

Avatar discord do usuario jessica_efi

jessica_efi

Bom dia <@!697886743239852185> ! No arquivo credentials.json(Gerencianet.NETCore.SDK.Examples/credentials.json) você passa o caminho do certificado.

Avatar discord do usuario jessica_efi

jessica_efi

Ver Respostas

Entendi... alterou as credenciais para produção e o sandbox para false no arquivo credentials.json ?

Avatar discord do usuario christianosilveira4948

christianosilveira4948

Ver Respostas

hWebService := CURL_EASY_INIT()

IF !EMPTY(hWebService)

CURL_EASY_SETOPT(hWebService, HB_CURLOPT_URL, "https://sandbox.gerencianet.com.br/v1/authorize")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_RETURNTRANSFER, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_ENCODING, '')
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_MAXREDIRS, 10)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_TIMEOUT, 0)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_FOLLOWLOCATION, .T.)
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTP_VERSION, "CURL_HTTP_VERSION_1_1")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_CUSTOMREQUEST, "POST")
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_POSTFIELDS, {"grant_type","client_credentials"})
CURL_EASY_SETOPT(hWebService, HB_CURLOPT_HTTPHEADER, {'Authorization: Basic Q2...','Content-Type: application/json'})

ncurlErr:=curl_easy_perform (hWebService)
IF ncurlErr > 0
? "Curl Error: "+str(ncurlErr)
ENDIF

ENDIF

curl_easy_cleanup( hWebService )

Avatar discord do usuario marcosfilho8113

marcosfilho8113

Ver Respostas

"Could not authenticate. Please make sure you are using correct credentials and if you are using then in the correct environment."

Avatar discord do usuario leandromoreira2355

leandromoreira2355

Ver Respostas

Boa tarde, alguém sabe o motivo desse erro?
Could not authenticate. Please make sure you are using correct credentials and if you are using then in the correct environment.