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)