Histórico de mensagens sobre Product em pix

EXIBINDO CONVERSAS RECENTES:

Texto: Product
Canal: pix
Avatar discord do usuario raphaelribeiro

raphaelribeiro

Ver Respostas

Bom dia, tenho alguns certificados de alguns ambientes. staging, sandbox e production,. cada um com um subject diferente. o staging expirou... temos alguma documentação de como criar um novo certificado com o mesmo subject de staging? grato

Avatar discord do usuario andrebarbosa_dev

andrebarbosa_dev

Ver Respostas

2024-08-06 19:07:13] production.ERROR: Efi\Exception\PixException::getErrorTitle(): Return value must be of type string, array returned {"exception":"[object] (TypeError(code: 0): Efi\\Exception\\PixException::getErrorTitle(): Return value must be of type string, array returned at /var/www/html/vendor/efipay/sdk-php-apis-efi/src/Efi/Exception/PixException.php:27)

Alguem ja passou por esse erro?

Tá funcionado, mas fica disparando essa erro no log do laravel pra mim.

Avatar discord do usuario andersonhsilva

andersonhsilva

Efi\EfiPay {#348 ▼ // routes/web.php:39
-requester: null
-endpoints: array:5 [▼
"CHARGES" => array:2 [▶]
"PIX" => array:2 [▼
"URL" => array:2 [▼
"production" => "https://pix.api.efipay.com.br"
"sandbox" => "https://pix-h.api.efipay.com.br"
]
"ENDPOINTS" => array:48 [▶]
]
"OPEN-FINANCE" => array:2 [▶]
"PAYMENTS" => array:2 [▶]
"OPENING-ACCOUNTS" => array:2 [▶]
]
-methods: null
-options: array:12 [▼
"sandbox" => true
"debug" => false
"cache" => true
"timeout" => 60
"clientId" => "xxxxxxxxx"
"clientSecret" => "xxxxxxxx"
"partnerToken" => null
"headers" => null
"baseUri" => null
"api" => null
"certificate" => false
"pwdCertificate" => ""
]
}

este é o retorno que estou tendo quando instacio a class EfiPay, acredito que deu certo, mas vou fazer mais testes

Avatar discord do usuario matheuzin6375

matheuzin6375

então, eu ja baixei o arquivo até no diretorio e passei o caminho relativo: show\producao-550582-AC7PRODUCTION_cert.pem, mas também deu o mesmo erro

Avatar discord do usuario lidiamariano

lidiamariano

Ver Respostas

essas são todas as variáveis de ambiente que uso. elas estão preenchidas mas mandem vazias por questão de segurançaEFI_CLIENT_ID =""
EFI_CLIENT_SECRET =""
EFI_ENDPOINT = "https://pix.api.efipay.com.br"
NODE_ENV = "production"
EFI_CERT = ""

Avatar discord do usuario _josemax

_josemax

Ver Respostas

if(EFI_API_MOD =='sanbox'){
$sandbox = true; // false = Production | true = Homologation
}elseif(EFI_API_MOD =='production'){
$sandbox = false; // false = Production | true = Homologation
}

Avatar discord do usuario disneyjj

disneyjj

Ver Respostas

Boa tarde pessoal, estou usando o método CreateOneStepLink na SDK .net core.

Estou recebendo esse seguinte erro:{"code":3500034,"error":"validation_error","error_description":"A propriedade [request_delivery_address] é obrigatória."}

Estou enviando o body disponibilizado na SDK.

var body = new
{
items = new[] {
new {
name = "Product 1",
value = 590,
amount = 2
}
},
settings = new
{
payment_method = "all",
expire_at = "2022-12-15",
request_delivery_address = false
}
};

Avatar discord do usuario peterfritz

peterfritz

Algo assim funcionaria:

js
import axios from "axios";
import https from "https";

const subdomain = process.env.NODE_ENV === "production" ? "pix" : "pix-h";

const clientCreds = clientId + ":" + clientSecret;
const authorization = Basic ${Buffer.from(clientCreds).toString("base64")};

const certificate = Buffer.from(certificateBase64Encoded, "base64");

const httpsAgent = new https.Agent({
pfx: certificate,
passphrase: "",
});

const oAuthResponse = await axios.post(
https://${subdomain}.api.efipay.com.br/oauth/token,
{
grant_type: "client_credentials",
},
{
headers: {
Authorization: authorization,
"Content-Type": "application/json",
},
httpsAgent,
}
);

const token = oAuthResponse.data.access_token;

const efiApi = axios.create({
baseURL: https://${subdomain}.api.efipay.com.br,
headers: {
Authorization: Bearer ${token},
"Content-Type": "application/json",
},
httpsAgent,
});

await efiApi.put(
/v2/webhook/${process.env.PIX_KEY},
{
webhookUrl:
${process.env.WEBHOOK_BASE_URL}/api/webhook/efi?secret=${process.env.WEBHOOK_SECRET}&ignore=.replace(
"//api",
"/api"
),
},
{
headers: {
"x-skip-mtls-checking": "true",
},
}
);

Avatar discord do usuario guilherme_efi

guilherme_efi

Ver Respostas

@conexao_cefet, agora está incluindo outros parâmetros. A variável options deve conter os seguintes parâmetros, e depois é acrescentado o headers com o parâmetro x-skip-mtls-checking.
$options = [
"client_id" => "Client_Id",
"client_secret" => "Client_Secret",
"certificate" => realpath(__DIR__ . "/productionCertificate.p12"), // Absolute path to the certificate in .pem or .p12 format
"sandbox" => false,
"debug" => false,
"timeout" => 30
];
https://github.com/gerencianet/gn-api-sdk-php/blob/master/examples/credentials/options.php