Histórico de mensagens sobre Product em bolix

EXIBINDO CONVERSAS RECENTES:

Texto: Product
Canal: bolix
Avatar discord do usuario rafael_13315

rafael_13315

Ver Respostas

Boa tarde, estou tentando gerar um boleto em homologaçao

POST
Endereço: https://cobrancas-h.api.efipay.com.br/v1/charge/one-step

no campo body -> raw informo ex:

{
"items": [
{
"name": "Product 1",
"value": 1000,
"amount": 1
}
],
"payment": {
"banking_billet": {
"expire_at": "2019-10-16",
"customer": {
"name": "Gorbadoc Oldbuck",
"email": "[email protected]",
"cpf": "14014603059",
"birth": "1977-01-15",
"phone_number": "62986070247"
}
}
}
}

no header informo

Authorization: "meu token gerado"
Content-Type: application/json

ao executar, recebo o erro "Bad Request 400"

alguem consegue me informar o que poderia estar errado ?

Avatar discord do usuario rafaelogliari

rafaelogliari

Ver Respostas

Bom dia!

Estou com dificuldades de gerar boleto com PHP Curl. Sempre retorna: Unauthorized.
Utilizei credencias de Homologação.

Estou utilizando esse modelo:
$config = [
"client_id" => "Client_Id_....",
"client_secret" => "Client_Secret_...."
];
$autorizacao = base64_encode($config["client_id"] . ":" . $config["client_secret"]);

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://cobrancas-h.api.efipay.com.br/v1/charge/one-step',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"items": [{
"name": "Product 1",
"value": 500,
"amount": 1
}],
"shippings": [{
"name": "Default Shipping Cost",
"value": 100
}],
"payment": {
"banking_billet": {
"expire_at": "2024-04-16",
"customer": {
"name": "Gorbadoc Oldbuck",
"email": "[email protected]",
"cpf": "10617184682",
"birth": "1977-01-15",
"phone_number": "62986070247"

}
}
}
}',
CURLOPT_HTTPHEADER => array(
"Authorization: Basic $autorizacao",
"Content-Type: application/json"
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Avatar discord do usuario _alexandrehenrique

_alexandrehenrique

Ver Respostas

outra coisa ve se entendi corretamente

/ eslint-disable import/extensions /
import EfiPay from 'gn-api-sdk-typescript';
import options from '../../credentials';

const body = {
payment: {
banking_billet: {
expire_at: '2024-09-20',
customer: {
name: 'Gorbadoc Oldbuck',
email: '[email protected]',
cpf: '94271564656',
birth: '1977-01-15',
phone_number: '5144916523',
},
},
},

items: [
{
name: 'Product 1',
value: 500,
amount: 1,
},
],
notification_url: 'http://your_domain.com/notification',
};

const efipay = new EfiPay(options);

efipay
.createOneStepCharge([], body)
.then((resposta: Promise) => {
console.log(resposta);
})
.catch((error: Promise) => {
console.log(error);
});
posso fazer dessa forma?

Avatar discord do usuario miauzinho013

miauzinho013

Bom dia!, aqui está o código:


const credentials = require('../config/gerencianet')
const Gerencianet = require('gn-api-sdk-node');

const options = {
client_id: credentials.client_id,
client_secret: credentials.client_secret,
sandbox: true,
pix_cert: credentials.pix_cert,
};
console.log(options)
const gerencianet = new Gerencianet(options);

var body = {

payment: {
banking_billet: {
expire_at: '2020-06-12',
customer: {
name: 'Gorbadoc Oldbuck',
email: '[email protected]',
cpf: '04267484171',
birth: '2020-06-10',
phone_number: '5144916523' ,
juridical_person: {
corporate_name: 'Empresa Gorbadoc',
cnpj:'92247037000137'
}
}
}
},

items: [{
name: 'Product 1',
value: 1000,
amount: 2
}],
shippings: [{
name: 'Default Shipping Cost',
value: 100
}]
}

gerencianet
.createCharge({}, body)
.then(console.log)
.catch(console.log)

Avatar discord do usuario renatobosa

renatobosa

Ver Respostas

Ola, Bom dia. estou tentando implementar o GerenciaNet em TS mas quando tento criar qualquer cobrança recebo não autorizado,
private gerenciaInstance = Gerencianet({
sandbox: this.config.sandbox,
client_id: this.config.client_id,
client_secret: this.config.client_secret,
pix_cert: this.config.pix_cert,
});
async createCharge(credit_card: any, billing_address: any, costumer_data: any, products: any): Promise < any > {
const test = {
items: [
{
name: 'Product 1',
value: 1000,
amount: 2,
},
],
shippings: [
{
name: 'Default Shipping Cost',
value: 100,
},
],
};
console.log("Create Charge Gerencianet Data:" + JSON.stringify(test));
return this.gerenciaInstance.createCharge({}, test).then((response: any) => {
console.log("Create Charge Gerencianet Response:" + JSON.stringify(response));
return response;
}).catch((error: any) => {
console.log("Create Charge Gerencianet Error:" + JSON.stringify(error));
return error;
})
}


Resposta
Create Charge Gerencianet Data:{"items":[{"name":"Product 1","value":1000,"amount":2}],"shippings":[{"name":"Default Shipping Cost","value":100}]}
Create Charge Gerencianet Error:"Unauthorized"

Avatar discord do usuario carlosh.skraba4582

carlosh.skraba4582

>>>>>> dynamic endpoints = new Endpoints("client_id", "client_secret", true, "production.p12");