Erro ao se conectar na api. Messagem de erro: "You must supply a valid API key"
See original GitHub issueCriei uma função básica para se conectar ao serviço.
import { client } from 'pagarme'
export async function connect(apiKey: string | undefined) {
try {
console.log(apiKey) // Minha chave api
return await client.connect({ api_key: apiKey })
} catch (error) {
throw error
}
}
Criei também um teste unitário:
import { connect } from '../../src/services/pagarme'
import { env } from '../../src/env'
describe('To connect pagarme', () => {
it('should to be able return success', async () => {
const apiKey = env('PAGARME_API_KEY')
const connected = await connect(apiKey)
expect(connected).toHaveProperty('acquirers')
})
})
Formato da chave api gerada na v5: sk_qrezZl4TrZFRb1Vx Formato da chave api gerada na v4: ak_test_grXijQ4GicOa2BLGZrDRTR5qNQxJW0
Quando utilizo a chave api gerada na versão 4 consigo me conectar com sucesso ao serviço e o teste passa, porém utlizando a chave api gerada pela versão 5, é me retornado esse erro: “You must supply a valid API key”
Sinceramente não sei o que estou fazendo de errado
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Error: You must supply a valid API key - Stackoverflow
seguinte problema em node: "You must supply a valid API key". Estou iniciando a conexão com esse código: pagarme.client .connect({ api_key: " ...
Read more >Error Messages | Maps JavaScript API - Google Developers
This page describes the error messages that can be returned by the Maps JavaScript API. The Maps JavaScript API writes error and warning...
Read more >How do I troubleshoot HTTP 403 errors from API Gateway?
An HTTP 403 response code means that a client is forbidden from accessing a valid URL. The server understands the request, ...
Read more >Guia de solução de problemas e perguntas frequentes do ...
Esta mensagem de erro é exibida quando o valor do cabeçalho da chave de API fornecido ( x-api-key ) é inválido. Certifique-se de...
Read more >API Error Codes - Neutrino API Docs
API Error Code HTTP Status Code Error Message
01 400 MISSING OR INVALID PARAMETER
02 400 DAILY API LIMIT EXCEEDED
03 400 INVALID URL
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fala @pcsantana corrigindo. O endereço é esse aqui https://github.com/pagarme/pagarme-core-api-nodejs
Bom dia galera, tudo bem? Então, nossa SDK pagarme-js integra com a versão 4, para integrar com a versão 5 lançamos uma nova SDK. Criamos essa nova SDK com a junção da Pagarme com a Mundi, que é a pagarme-core-api-nodejs. Caso vocês queiram utilizar essa versão, terão que instalar o pacote referente a nova sdk que é o @pagarme/sdk.