Gem Version Build Status Code Climate Test Coverage

NfedoBrasil

Gem to interact with NFEdoBrasil SOAP API.

Installation

Add this line to your application's Gemfile:

gem 'nfedobrasil'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nfedobrasil

Usage

This gem is just a wrapper around Savon which monkey patches (yes... I know =[) both Savon and HTTPI so that they can work with P12 authentication required by NFEdoBrasil.

require 'nfedobrasil'
# For dev mode access:
client = NfedoBrasil.client({ssl_plcs_file: './hml_natue.p12', ssl_plcs_password: 'y7bYntT3F'}, true)

# For production access:
client = NfedoBrasil.client({ssl_plcs_file: './hml_natue.p12', ssl_plcs_password: 'y7bYntT3F'})

# Now just consume the API using Savon
client.operations
# => [:enviar, :analisa_n_fe, :consultar, :consulta_token, :cancelar, :carta_correcao, :inutilizar, :consultar_cadastro_sefaz, :consultar_nota_sefaz, :status_servico, :retorna_danfe, :retorna_chaves, :retorna_xmls, :insere_emissor, :insere_armazenamento, :existe_emissor, :existe_armazenamento]

Contributing

  1. Fork it ( https://github.com/natuelabs/nfedobrasil/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request