notasegura 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/notasegura.rb +6 -4
  2. metadata +1 -1
@@ -58,12 +58,12 @@ class NotaSegura
58
58
  return resultado
59
59
  end
60
60
 
61
- def reenviar_email(chave, email)
61
+ def reenviar_email(hash, email)
62
62
  begin
63
63
  url = "#{@url}/api/invoices/resend"
64
64
  url = "#{url}?token=#{@token}" if @token
65
65
  requisicao = RestClient::Resource.new(url, @email, @senha)
66
- resposta = requisicao.post({:email => email, :key => chave})
66
+ resposta = requisicao.post({:email => email, :hash => hash})
67
67
  resultado = XmlSimple.xml_in resposta
68
68
  return resultado
69
69
  rescue => e
@@ -75,12 +75,14 @@ class NotaSegura
75
75
  end
76
76
  end
77
77
 
78
- def enviar_anexo(hash, arquivo)
78
+ def enviar_anexo(hash, arquivo, nome)
79
79
  begin
80
80
  url = "#{@url}/api/uploads"
81
81
  url = "#{url}?token=#{@token}" if @token
82
82
  requisicao = RestClient::Resource.new(url, @email, @senha)
83
- resposta = requisicao.post({:hash => hash, :file => arquivo})
83
+ body = {:hash => hash, :file => arquivo}
84
+ body['name'] = nome if nome
85
+ resposta = requisicao.post(body)
84
86
  resultado = XmlSimple.xml_in resposta
85
87
  return resultado
86
88
  rescue => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notasegura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: