Git Product home page Git Product logo

afip.js's Introduction


Afip.js

Este es un fork de @afipsdk/afip.js

Necesitaba aislar los certificados digitales de AFIP del código, por eso hicimos el fork. Los certificados y el token generado son enviados por parámetros a la librería. Esto era necesario para poder desplegarlo en Nube.

Acerca del proyecto

Gracias Afip SDK por el gran aporte!

Afip SDK.

Guia de inicio

Instalacion

Via npm

npm install --save @aledj02/afip.js

Via Yarn

yarn add @aledj02/afip.js

Como usarlo

Lo primero es incluir el SDK en tu aplicación

const Afip = require('@aledj02/afip.js');

Luego creamos una instancia de la clase Afip pasandole un Objeto como parámetro.

const afip = new Afip({ CUIT: 20111111112,
                        production: false,
                        cert: "put your cert string here",
                        key: "put your key string here",
                      });

Ahora debemos pedir un token y almacenarlo, como parámetro enviar el nombre de servicio. 'ws_sr_padron_a5' 'ws_sr_padron_a10' 'ws_sr_padron_a13' etc...

var token = afip.Authorization.getTokenAuth('ws_sr_padron_a13');

Luego usar el token generado para consumir el servicio.

const taxpayerDetails = afip.RegisterScopeThirteen.getTaxpayerDetails("cuit a consultar", token.credentials);

Puede ver como usario la librería en el repo original, tener en cuenta que al llamar la función para pedir los datos de un cuit, enviar como parámetro un json con { token, sign}. Primeros pasos de la documentación

afip.js's People

Contributors

ivanalemunioz avatar aledj02 avatar afipsdk avatar dependabot[bot] avatar pdrappo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.