Created
October 22, 2020 15:45
-
-
Save javorosas/ac177ee1b3c487153f66dc9377a495f7 to your computer and use it in GitHub Desktop.
[Facturapi] Subir certificados de sello digital (CSD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const run = async () => { | |
const Facturapi = require('facturapi') | |
const fs = require('fs'); | |
const path = require('path'); | |
const facturapi = new Facturapi('sk_user_LLAVE_DE_USUARIO'); | |
const cerStream = fs.createReadStream(path.join(__dirname, 'cer.cer')); | |
const keyStream = fs.createReadStream(path.join(__dirname, 'key.key')); | |
console.log({ keyBuffer }); | |
const result = await facturapi.organizations.uploadCertificate('ID_DE_LA_ORGANIZACION', cerStream, keyStream, 'mipassword'); | |
console.log({ result }); | |
}; | |
run() | |
.then(() => console.log('done')) | |
.catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment