-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (31 loc) · 955 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import NFeNode from './src/services'
import { readFile } from 'fs-extra'
const main = async () => {
try {
const certificado = await readFile('./certificado.pfx')
const senha = '12345678'
const nfeNode = new NFeNode({ certificado, senha })
// const responseCadastro = await nfeNode.consultaCadastro({
// uf: 'MT',
// tpAmb: 'producao',
// argumentos: { nome: 'CNPJ', valor: '04084183000121' }
// })
//
// console.log(JSON.stringify(responseCadastro, null, 2))
const responseStatus = await nfeNode.consultaStatusSefaz({
uf: 'MT',
tpAmb: 'producao'
})
console.log(responseStatus)
// const responseChave = await nfeNode.consultaChaveSefaz({
// uf: 'MT',
// tpAmb: 'producao',
// chave: '51181004084183000121550030001193781060388610'
// })
//
// console.log(JSON.stringify(responseChave, null, 2))
} catch (e) {
console.error(e)
}
}
main()