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.
- data/lib/notasegura.rb +6 -4
- metadata +1 -1
data/lib/notasegura.rb
CHANGED
@@ -58,12 +58,12 @@ class NotaSegura
|
|
58
58
|
return resultado
|
59
59
|
end
|
60
60
|
|
61
|
-
def reenviar_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, :
|
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
|
-
|
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
|