Histórico

EXIBINDO CONVERSAS RECENTES:

Texto: pix\'
# pix
Avatar discord do usuario alissonmaciel_32335

alissonmaciel_32335

Ver no Discord

Meu Webhook: public function webhook() {
$body = '{
"webhookUrl": "https://julioerp.agenciaweblab.com.br/webhook.php"
}';
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->config['rotas'] . '/v2/webhook/' . $this->config['chave_pix']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSLCERT, $this->config["certificado"]);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
$headers = array();
$headers[] = 'Authorization: Basic ' . $this->access_token;
$headers[] = 'X-Skip-Mtls-Checking: true';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);

echo '

';
var_dump($this->config['chave_pix'], $this->config['client_id'], $this->config['client_secret'], $result);
echo '
';

if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
return $result;
} catch (Exception $e) {
echo '
';
var_dump($e->getCode(), $e->getFile(), $e->getMessage());
echo '
';
}
}

# pix
Avatar discord do usuario alissonmaciel_32335

alissonmaciel_32335

Ver RespostasVer no Discord

Estou executando este método:
public function webhook() {
$body = '{
"webhookUrl": "https://julioerp.agenciaweblab.com.br/webhook.php"
}';
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->config['rotas'] . '/v2/webhook/' . $this->config['chave_pix']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSLCERT, $this->config["certificado"]);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
$headers = array();
$headers[] = 'Authorization: Bearer ' . $this->access_token;
$headers[] = 'X-Skip-Mtls-Checking: true';
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);

echo '

';
var_dump($this->config['chave_pix'], $result);
echo '
';

if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
return $result;
} catch (Exception $e) {
echo '
';
var_dump($e->getCode(), $e->getFile(), $e->getMessage());
echo '
';
}
}

# pix
Avatar discord do usuario buenolitz

buenolitz

Ver RespostasVer no Discord

Estou rodando o pix_received_list mas não estou obtendo os pixs pagos

{'parametros': {'inicio': '2024-05-08T10:00:00Z', 'fim': '2024-05-08T19:20:00Z', 'paginacao': {'paginaAtual': 0, 'itensPorPagina': 100, 'quantidadeDePaginas': 0, 'quantidadeTotalDeItens': 0}}, 'pix': []}"
realizei dois pixs e nenhum aparece no mesmo. o que posso ter feito de errado ?

# pix
Avatar discord do usuario thiagorobles

thiagorobles

Ver RespostasVer no Discord

@rubenskuhl obrigado pelo retorno, eu tentei integrar no meu Controller (uso nestjs) na minha API que está no heroku, aqui está o código:

import {
ClassSerializerInterceptor,
Controller,
HttpCode,
HttpStatus,
Logger,
Post,
Req,
UseInterceptors,
} from '@nestjs/common';
import { LoggerInterceptor } from '@src/common/logger/logger-interceptor';
import configuration from '@src/config/configuration';
import axios from 'axios';
import { Request } from 'express';
import as https from 'https';

const { httpsOptions } = configuration();
@Controller('efi-gerencianet')
@UseInterceptors(ClassSerializerInterceptor, LoggerInterceptor)
export class EfiGerencianetController {
private readonly logger = new Logger(EfiGerencianetController.name);

private instance = axios.create({
httpsAgent: new https.Agent({
ca: httpsOptions.ca,
requestCert: true,
rejectUnauthorized: true,
}),
headers: {
'x-skip-mtls-checking': true,
},
});

@Post('webhook/pix')
@HttpCode(HttpStatus.OK)
handlePixCallback(@Req() req: Request) {
const body = req.body;

this.logger.log(Received callback from Gerencianet);
this.logger.debug(body);
return body;
}

@Post('configure-webhook')
async configureWebhook() {
const url =
'https://api-pix.gerencianet.com.br/v2/webhook/4114c4e9-202c-4979-8534-34a4e5a29ad0';
const data = {
webhookUrl: '',
};

try {
const response = await this.instance.put(url, data);
this.logger.log(
Webhook configured successfully. Status code: ${response.status},
);
return response.data;
} catch (error) {
this.logger.error(Error configuring webhook: ${error.message});
throw new Error(Error configuring webhook: ${error.message});
}
}
}


subi pra produção, e ao chamar o endpoint recebo o erro: Error: Error configuring webhook: read ECONNRESET

Para SSL estou usando o heroku ACM (auto managed).


Sabem o que posso estar fazendo errado?