Gem to interact with NFEdoBrasil SOAP API.
Add this line to your application's Gemfile:
gem 'nfedobrasil'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nfedobrasil
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]
- Fork it ( https://github.com/natuelabs/nfedobrasil/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request