biro 0.4.1 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e898daacd7fa4b56c2ce54960e2f674cb7d8da8
4
- data.tar.gz: 09a3623fb29de2ad7c8d353d0ed6978188f5c4b8
3
+ metadata.gz: ce870fe733cb5c7dca7449dd5cda540b11e6e1e4
4
+ data.tar.gz: 5e5b9f929a45ba1f3cdc09a7add1e5d8d64a03f3
5
5
  SHA512:
6
- metadata.gz: d03dab94cbfc3ebee7496fde62304bdcb1f3647d2e6a37364159f89ed56bd0fa5a192fe02f454412d3ee7888c007bf3e07657839577cbe88f3d4686eca3ed5a5
7
- data.tar.gz: b91d665c0183718283c3884bad506178f5fd276af1e33643318ca24ab6a429f21535a71cc29768875b7acf75d849adabd5d6eda11c22eb2518639a3e4e36fb51
6
+ metadata.gz: 6eec94535e8da276edc96e0f3abf79882346763b8054d50d1fc4b91abbe85a715eaa2850cc533470e40a050a31e58e28e20e049792985f1bc9d993c1287cbcdf
7
+ data.tar.gz: 5184c9445acc8df73b4801d9dbc10bbdfc6cbbbb51c6a6e5015064367ddf363cc7ec8ba4bc5906847076365746c62bb38ded367adc9c4d604c6d896fba0a9e9f
@@ -36,9 +36,18 @@ module Biro
36
36
 
37
37
  Array.wrap(result.dig(:lista_de_resumo_das_operacoes)).map do |item|
38
38
  {
39
- :variacao_cambial => item[:variacao_cambial],
40
- :modalidade => item[:modalidade],
41
- :lista_de_vencimentos => item[:lista_de_vencimentos]
39
+ :tax_variation => item[:variacao_cambial],
40
+ :modality => item[:modalidade],
41
+ :dues_list => invoice_list_item(item[:lista_de_vencimentos])
42
+ }
43
+ end
44
+ end
45
+
46
+ def invoice_list_item(items)
47
+ Array.wrap(items).map do |item|
48
+ {
49
+ :code => item[:codigo_vencimento],
50
+ :value => item[:valor_vencimento]
42
51
  }
43
52
  end
44
53
  end
@@ -31,6 +31,10 @@ module Biro
31
31
 
32
32
  private
33
33
 
34
+ def savon_options
35
+ { strip_namespaces: false }
36
+ end
37
+
34
38
  def verify_response responses
35
39
  raise AuthenticationError.new("Error at Midia100 request: #{responses[:registration].body[:consultar_response][:consultar_result]}") if responses[:registration]&.body[:consultar_response][:consultar_result]&.include? "Usuário ou Senha Estão Incorretos"
36
40
  raise DocumentNotFoundError.new("Error at Midia100 request: #{responses[:registration].body[:consultar_response][:consultar_result]}") if responses[:registration]&.body[:consultar_response][:consultar_result]&.include? "Cpf Inválido"
@@ -159,7 +159,7 @@ module Biro
159
159
  end
160
160
 
161
161
  def result(data)
162
- Nori.new.parse(data[:consultar_response][:consultar_result])['NewDataSet'] unless data.nil?
162
+ Nori.new(convert_attributes_to: ->(key, value) { [] }).parse(data[:consultar_response][:consultar_result])['NewDataSet'] unless data.nil?
163
163
  end
164
164
  end
165
165
  end
@@ -11,7 +11,6 @@ module Biro
11
11
  'https://ws.databusca.com.br/DataHistory.svc?wsdl'
12
12
  end
13
13
 
14
-
15
14
  def required_params
16
15
  [:username, :password, :domain]
17
16
  end
data/lib/biro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Biro
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noverde Team
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2017-07-05 00:00:00.000000000 Z
14
+ date: 2017-07-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: savon
@@ -145,7 +145,6 @@ files:
145
145
  - Rakefile
146
146
  - bin/console
147
147
  - bin/setup
148
- - biro-0.4.0.gem
149
148
  - biro.gemspec
150
149
  - lib/biro.rb
151
150
  - lib/biro/configuration.rb
data/biro-0.4.0.gem DELETED
Binary file