sdk-node-apis-efi
Version:
Module for integration with Efi Bank API
42 lines (37 loc) • 934 B
JavaScript
const EfiPay = require('sdk-node-apis-efi')
const options = require('../../credentials')
let body = {
payment: {
credit_card: {
installments: 1,
payment_token: '6426f3abd8688639c6772963669bbb8e0eb3c319',
billing_address: {
street: 'Av. JK',
number: 909,
neighborhood: 'Bauxita',
zipcode: '35400000',
city: 'Ouro Preto',
state: 'MG',
},
customer: {
name: 'Gorbadoc Oldbuck',
email: 'oldbuck@efipay.com.br',
cpf: '94271564656',
birth: '1977-01-15',
phone_number: '5144916523',
},
},
},
}
let params = {
id: 1000,
}
const efipay = new EfiPay(options)
// O método definePayMethod indica os campos que devem ser enviados e que serão retornados
efipay.definePayMethod(params, body)
.then((resposta) => {
console.log(resposta) // Aqui você tera acesso a resposta da API e os campos retornados de forma intuitiva
})
.catch((error) => {
console.log(error)
})