Erro ao Configurar Webhook Pix com PHP

EXIBINDO RESPOSTAS:

Avatar discord do usuario felipenunes0714

felipenunes0714


/
Detailed endpoint documentation
https://dev.efipay.com.br/docs/api-pix/webhooks#configurar-o-webhook-pix
/

$autoload = realpath(__DIR__ . "/../../../vendor/autoload.php");
if (!file_exists($autoload)) {
die("Autoload file not found or on path $autoload.");
}
require_once $autoload;

use Efi\Exception\EfiException;
use Efi\EfiPay;

$optionsFile = __DIR__ . "/../../credentials/options.php";
if (!file_exists($optionsFile)) {
die("Options file not found or on path $options.");
}
$options = include $optionsFile;

$options["headers"] = [
"x-skip-mtls-checking" => false
];

$params = [
"chave" => "12345"
];

$body = [
"webhookUrl" => "www.meulink.com"
];

try {
$api = new EfiPay($options);
$response = $api->pixConfigWebhook($params, $body);

if (isset($options["responseHeaders"]) && $options["responseHeaders"]) {
print_r("

" . json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "
");
print_r("
" . json_encode($response->headers, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "
");
} else {
print_r("
" . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "
");
}
} catch (EfiException $e) {
print_r($e->code . "
");
print_r($e->error . "
");
print_r($e->errorDescription) . "
";
if (isset($options["responseHeaders"]) && $options["responseHeaders"]) {
print_r("
" . json_encode($e->headers, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "
");
}
} catch (Exception $e) {
print_r($e->getMessage());
}

Avatar discord do usuario igor_efi

igor_efi

Boa tarde, @felipenunes0714!
A falha esta ocorrendo devido ao fato de não esta sendo possivel localizar o seu arquivo autoload.php "DIR . "/../../../vendor/autoload.php""

php
$autoload = realpath(DIR . "/../../../vendor/autoload.php");
if (!fileexists($autoload)) {
die("Autoload file not found or on path $autoload.");
}

Você verificou se este arquivo foi gerado?