Skip to content

Instantly share code, notes, and snippets.

@javorosas
Created October 22, 2020 15:45
Show Gist options
  • Save javorosas/ac177ee1b3c487153f66dc9377a495f7 to your computer and use it in GitHub Desktop.
Save javorosas/ac177ee1b3c487153f66dc9377a495f7 to your computer and use it in GitHub Desktop.
[Facturapi] Subir certificados de sello digital (CSD)
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