Boa tarde pessoal, estou usando o SDK 5.1 do PHP do Gerencianet com o Laravel 9 e PHP 8.2 tentando executar o exemplo de pixCreateImmediateCharge, esta ocorrendo erro ao tentar executar esse método no $pix = $api->pixCreateImmediateCharge($body);.
Alguém já se deparou com esse erro?
O erro:
"message": "Array to string conversion",
"exception": "ErrorException",
"file": "C:\\Users\\Alfredo\\Documents\\GitHub\\pix-qrcode-laravel\\vendor\\gerencianet\\gerencianet-sdk-php\\src\\Gerencianet\\Endpoints.php",
"line": 123,
"exception": "ErrorException",
"file": "C:\\Users\\Alfredo\\Documents\\GitHub\\pix-qrcode-laravel\\vendor\\gerencianet\\gerencianet-sdk-php\\src\\Gerencianet\\Endpoints.php",
"line": 123,
O código:
$body = [
"calendario" => [
"expiracao" => 3600 // Charge lifetime, specified in seconds from creation date
],
"valor" => [
"original" => "0.01"
],
"chave" => "00000000-0000-0000-0000-000000000000", // Pix key registered in the authenticated Gerencianet account
"solicitacaoPagador" => "Enter the order number or identifier.",
];
try {
$api = Gerencianet::getInstance($this->options);
$pix = $api->pixCreateImmediateCharge($body);
...
"calendario" => [
"expiracao" => 3600 // Charge lifetime, specified in seconds from creation date
],
"valor" => [
"original" => "0.01"
],
"chave" => "00000000-0000-0000-0000-000000000000", // Pix key registered in the authenticated Gerencianet account
"solicitacaoPagador" => "Enter the order number or identifier.",
];
try {
$api = Gerencianet::getInstance($this->options);
$pix = $api->pixCreateImmediateCharge($body);
...