Comunidade

Ask a Question
Back to All

ERRO API TRANSFERENCIA

Boa tarde.

Estou tentando usar a api de transferência porém retorna isto:
OpenSSL SSL_connect: Connection reset by peer in connection to secure.api.pagseguro.com:443

(estou usando token de producao)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://secure.api.pagseguro.com/transfers');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "\n{\n "amount": {\n "value": 10,\n "currency": "BRL"\n },\n "instrument": {\n "type": "PIX",\n "pix": {\n "key": "[email protected]",\n "name": "kaua",\n "tax_id": "*******"\n }\n },\n "description": "valor referente as vendas do dia 01/01",\n "reference_id": "referencia_cliente12345"\n}\n");

$headers = array();
$headers[] = 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$headers[] = 'Accept: application/json';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);

curl_close($ch);

© 1996- Todos os direitos reservados.

PAGSEGURO INTERNET INSTITUIÇÃO DE PAGAMENTO S/A - CNPJ/MF 08.561.701/0001-01

Av. Brigadeiro Faria Lima, 1.384, São Paulo - SP - CEP 01451-001