biro 0.6.2 → 0.6.3
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.
- checksums.yaml +4 -4
- data/biro-0.6.2.gem +0 -0
- data/lib/biro/gateways/bacen/response.rb +13 -6
- data/lib/biro/gateways/bvs/builders/debits_response_builder.rb +6 -2
- data/lib/biro/gateways/bvs/builders/score_response_builder.rb +6 -2
- data/lib/biro/gateways/midia100/request.rb +4 -0
- data/lib/biro/gateways/midia100/response.rb +1 -1
- data/lib/biro/gateways/ph3a/request.rb +1 -0
- data/lib/biro/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b63fc7f5ea082401ccd01dace52d066fa3ecac5
|
4
|
+
data.tar.gz: e58611f6182db11cfe0c9074d95955dfe65063c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5b605828328753c07c5288787a0ca99d570f51a98b610650f50fadaea6f9f9bcb79f9b10949854819bbc563e56060aaa57136b572482713671b79d8c10f8361
|
7
|
+
data.tar.gz: d4cb54ed358e3f0f5eff6362ab6a65a38618b49052d982791971fc5a07bfe8030b5b6d06110de4914ddad1c8c070a3f875d277929853a6fd9bc2bc6f79ad6159
|
data/biro-0.6.2.gem
ADDED
Binary file
|
@@ -34,15 +34,22 @@ module Biro
|
|
34
34
|
def invoice_list
|
35
35
|
return if operation_list.blank?
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
Array.wrap(result.dig(:lista_de_resumo_das_operacoes)).map do |item|
|
38
|
+
{
|
39
|
+
:tax_variation => item[:variacao_cambial],
|
40
|
+
:modality => item[:modalidade],
|
41
|
+
:dues_list => invoice_list_item(item[:lista_de_vencimentos])
|
42
|
+
}
|
40
43
|
end
|
41
|
-
list
|
42
44
|
end
|
43
45
|
|
44
|
-
def
|
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]
|
51
|
+
}
|
52
|
+
end
|
46
53
|
end
|
47
54
|
|
48
55
|
def processed_documents_percentage
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Biro
|
2
2
|
module Bvs
|
3
3
|
class DebitsResponseBuilder
|
4
|
-
def initialize
|
5
|
-
@body = body
|
4
|
+
def initialize(body)
|
5
|
+
@body = build(body)
|
6
6
|
end
|
7
7
|
|
8
8
|
def transaction
|
@@ -44,6 +44,10 @@ module Biro
|
|
44
44
|
def debits_info
|
45
45
|
response_text[6]
|
46
46
|
end
|
47
|
+
|
48
|
+
def build(body)
|
49
|
+
body.gsub("\n", '').gsub("\t", '').gsub("\\t", '').gsub("\\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0]
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
49
53
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Biro
|
2
2
|
module Bvs
|
3
3
|
class ScoreResponseBuilder
|
4
|
-
def initialize
|
5
|
-
@body = body
|
4
|
+
def initialize(body)
|
5
|
+
@body = build(body)
|
6
6
|
end
|
7
7
|
|
8
8
|
def transaction
|
@@ -92,6 +92,10 @@ module Biro
|
|
92
92
|
def error_message
|
93
93
|
response_text[8..100]
|
94
94
|
end
|
95
|
+
|
96
|
+
def build(body)
|
97
|
+
body.gsub("\n", '').gsub("\t", '').gsub("\\t", '').gsub("\\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0]
|
98
|
+
end
|
95
99
|
end
|
96
100
|
end
|
97
101
|
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
|
@@ -25,6 +25,7 @@ module Biro
|
|
25
25
|
Response.new(response)
|
26
26
|
rescue => e
|
27
27
|
Biro.log(:warn, "Unable to process Ph3a request")
|
28
|
+
raise AuthenticationError.new("Error at PH3A request: #{e.message}") if e.message.include?("User not authenticated")
|
28
29
|
raise StandardError.new("Error at PH3A request: #{e.message}")
|
29
30
|
end
|
30
31
|
end
|
data/lib/biro/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.3
|
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-
|
14
|
+
date: 2017-07-31 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: savon
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- Rakefile
|
146
146
|
- bin/console
|
147
147
|
- bin/setup
|
148
|
+
- biro-0.6.2.gem
|
148
149
|
- biro.gemspec
|
149
150
|
- lib/biro.rb
|
150
151
|
- lib/biro/configuration.rb
|