Comunidade
Pix Webhook
Estou configurando o webhook no pix, ambiente sandbox, seguindo o exemplo descrito no manual de integraΓ§Γ£o.
Ocorre que em todas as requisiΓ§Γ΅es recebo sempre este retorno:
400
{
"message": "Bad Request"
}
Existe alguma maneira de rastrear e identificar o problema?
at
OlΓ‘, Luciano!
VocΓͺ estΓ‘ utilizando o endpoint de cadastro de webhook, correto? Se sim, o token que vocΓͺ estΓ‘ utilizando possui o escopo de webhook?
Esta Γ© minha requisiΓ§Γ£o
Token:
{
"access_token": "a1da49fb-ddee-41ef-8308-877437131c282ac8569d45be825c9fd8bbb705790b487c24-e944-4e61-86b0-fb7c41dd88a1",
"token_type": "Bearer",
"expires_in": 31536000,
"refresh_token": "3605f79a-73ae-4e0a-a5bf-a503ce88f529a5c25f77433ab949beaab992085fd70b6896-2d5c-44af-976e-a3838adfc5e7",
"scope": "cob.read cob.write payloadlocation.read payloadlocation.write pix.read pix.write webhook.read webhook.write"
}
RequisiΓ§Γ£o:
curl --location -g --request PUT 'https://secure.sandbox.api.pagseguro.com/instant-payments/webhook/XXX3511'
--key ./_Sand.key
--cert ./_Sand.pem
--header 'Authorization: Bearer a1da49fb-ddee-41ef-8308-877437131c282ac8569d45be825c9fd8bbb705790b487c24-e944-4e61-86b0-fb7c41dd88a1'
--header 'Content-Type: application/json'
--verbose
--data-raw '{
"webhookUrl": "https://black-pay.azurewebsites.net/api/notifications/pagseguro"
}'
Resposta:
curl: (35) LibreSSL SSL_connect: Connection reset by peer in connection to secure.sandbox.api.pagseguro.com:443
curl: (6) Could not resolve host: .
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
Luciano,
Por favor, gera um novo token e tente novamente.
Se mesmo assim ocorrer erro me avise.
Att
ο»Ώ