hbci 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -2
- data/.rubocop_todo.yml +1 -1
- data/examples/get_transactions.rb +0 -1
- data/hbci.gemspec +3 -3
- data/lib/hbci/connector.rb +4 -0
- data/lib/hbci/element_group.rb +1 -0
- data/lib/hbci/message.rb +1 -1
- data/lib/hbci/message_factory.rb +2 -0
- data/lib/hbci/parser.rb +3 -2
- data/lib/hbci/response.rb +1 -2
- data/lib/hbci/segment.rb +1 -2
- data/lib/hbci/segments/hirmg.rb +2 -0
- data/lib/hbci/segments/hisyn.rb +2 -0
- data/lib/hbci/segments/hkidn.rb +1 -1
- data/lib/hbci/segments/hksyn.rb +2 -0
- data/lib/hbci/segments/hnshk.rb +2 -2
- data/lib/hbci/segments/hnvsd.rb +1 -1
- data/lib/hbci/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 561835270d94e66ef6062e37eb5636086adcb8d8ed0b88740bf9fb88716a1508
|
4
|
+
data.tar.gz: 36f7ba79371222b6d91fa1754052ea89f5bc72d9657f2c7cf1111c867efa70fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cffbfa1831358127ecffcea548e79243a484e216a045566ddb92345f0a7da69de932b8da39befcdb148f875566bfb862ea89de1b321caf40074e142945166f14
|
7
|
+
data.tar.gz: 219ac32f77934db6916cd024eeb1c201c49f4cacc597726d346c82dfb103bdd2fbd4b951fe73814579f17a8b9491f38ef4dfb007d59bf7ac00c4084ec82dfb2f
|
data/.rubocop.yml
CHANGED
@@ -12,8 +12,7 @@ Metrics/ModuleLength:
|
|
12
12
|
|
13
13
|
Metrics/LineLength:
|
14
14
|
Exclude:
|
15
|
-
- spec
|
16
|
-
- spec/support/request_stubs.rb
|
15
|
+
- spec/**/*
|
17
16
|
|
18
17
|
Metrics/AbcSize:
|
19
18
|
Exclude:
|
@@ -24,3 +23,7 @@ Metrics/ParameterLists:
|
|
24
23
|
- spec/support/message_stubs.rb
|
25
24
|
- spec/support/request_stubs.rb
|
26
25
|
|
26
|
+
|
27
|
+
Lint/UnusedMethodArgument:
|
28
|
+
Exclude:
|
29
|
+
- spec/support/*
|
data/.rubocop_todo.yml
CHANGED
data/hbci.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'bank_credentials'
|
22
|
-
spec.add_runtime_dependency 'cmxl', '~> 1.
|
22
|
+
spec.add_runtime_dependency 'cmxl', '~> 1.2'
|
23
23
|
spec.add_runtime_dependency 'httparty', '~> 0.16'
|
24
24
|
spec.add_runtime_dependency 'ibanizator', '~> 0.3'
|
25
25
|
spec.add_runtime_dependency 'monetize', ['>=1.8', '<2.0.0']
|
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
30
30
|
spec.add_development_dependency 'byebug', '~> 10.0'
|
31
31
|
spec.add_development_dependency 'rake', '~> 12.3'
|
32
|
-
spec.add_development_dependency 'rspec',
|
33
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.8'
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 0.60'
|
34
34
|
spec.add_development_dependency 'timecop', '~> 0.9'
|
35
35
|
spec.add_development_dependency 'webmock', '~> 3.4'
|
36
36
|
end
|
data/lib/hbci/connector.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Hbci
|
2
4
|
class Connector
|
3
5
|
attr_accessor :message_number
|
@@ -16,6 +18,7 @@ module Hbci
|
|
16
18
|
|
17
19
|
def credentials=(credentials)
|
18
20
|
raise ArgumentError, "#{self.class.name}#initialize expects a BankCredentials::Hbci object" unless credentials.is_a?(BankCredentials::Hbci)
|
21
|
+
|
19
22
|
credentials.validate!
|
20
23
|
@credentials = credentials
|
21
24
|
end
|
@@ -28,6 +31,7 @@ module Hbci
|
|
28
31
|
req = HTTParty.post(@credentials.url, body: request_message.to_base64)
|
29
32
|
@message_number += 1
|
30
33
|
raise "Error in https communication with bank: #{req.response.inspect}" unless req.success?
|
34
|
+
|
31
35
|
Base64.decode64(req.response.body)
|
32
36
|
end
|
33
37
|
end
|
data/lib/hbci/element_group.rb
CHANGED
data/lib/hbci/message.rb
CHANGED
data/lib/hbci/message_factory.rb
CHANGED
data/lib/hbci/parser.rb
CHANGED
@@ -31,7 +31,7 @@ module Hbci
|
|
31
31
|
# ) end of look-ahead
|
32
32
|
# ------------------------------------------------------------------------
|
33
33
|
# ) end of \1
|
34
|
-
ELEMENT_REGEX = /(.*?(?=(?<!\?)[:+']))
|
34
|
+
ELEMENT_REGEX = /(.*?(?=(?<!\?)[:+']))/.freeze
|
35
35
|
|
36
36
|
# Binary Elements may contain unescaped delimiters. Thus they are not
|
37
37
|
# terminated by regular delimiters. But their content is preceeded with
|
@@ -40,7 +40,7 @@ module Hbci
|
|
40
40
|
# '@6@mydata' or '@12@mydatamydata'
|
41
41
|
#
|
42
42
|
# The BINARY_ELEMENT_LENGTH_REGEx matches only the length.
|
43
|
-
BINARY_ELEMENT_LENGTH_REGEX = /@(\d+)
|
43
|
+
BINARY_ELEMENT_LENGTH_REGEX = /@(\d+)@/.freeze
|
44
44
|
|
45
45
|
def self.parse(string)
|
46
46
|
new(string).parse
|
@@ -76,6 +76,7 @@ module Hbci
|
|
76
76
|
def parse_delimiter
|
77
77
|
delimiter = scanner.getch
|
78
78
|
return if scanner.eos?
|
79
|
+
|
79
80
|
if delimiter == ELEMENT_GROUP_DELIMITER
|
80
81
|
add_element_group
|
81
82
|
elsif delimiter == SEGMENT_DELIMITER
|
data/lib/hbci/response.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
module Hbci
|
@@ -15,7 +14,7 @@ module Hbci
|
|
15
14
|
end
|
16
15
|
|
17
16
|
def find_all(segment_type)
|
18
|
-
@raw_segments.select { |sd| sd[0][0] == segment_type }.map{ |sd| Hbci::SegmentFactory.build(sd) }
|
17
|
+
@raw_segments.select { |sd| sd[0][0] == segment_type }.map { |sd| Hbci::SegmentFactory.build(sd) }
|
19
18
|
end
|
20
19
|
|
21
20
|
def to_s
|
data/lib/hbci/segment.rb
CHANGED
data/lib/hbci/segments/hirmg.rb
CHANGED
data/lib/hbci/segments/hisyn.rb
CHANGED
data/lib/hbci/segments/hkidn.rb
CHANGED
@@ -13,7 +13,7 @@ module Hbci
|
|
13
13
|
element :state, default: 1
|
14
14
|
|
15
15
|
def compile
|
16
|
-
|
16
|
+
bank.code = request_message.connector.credentials.bank_code
|
17
17
|
self.user_id = request_message.connector.credentials.user_id
|
18
18
|
self.system_id = request_message.dialog ? request_message.dialog.system_id : 0
|
19
19
|
end
|
data/lib/hbci/segments/hksyn.rb
CHANGED
data/lib/hbci/segments/hnshk.rb
CHANGED
@@ -63,8 +63,8 @@ module Hbci
|
|
63
63
|
|
64
64
|
def compile
|
65
65
|
self.security_reference = request_message.sec_ref
|
66
|
-
|
67
|
-
self.tan_mechanism = request_message.dialog.tan_mechanism if request_message.dialog
|
66
|
+
security_identification_details.party_identification = request_message.dialog ? request_message.dialog.system_id : 0
|
67
|
+
self.tan_mechanism = request_message.dialog.tan_mechanism if request_message.dialog&.tan_mechanism
|
68
68
|
set_credentials
|
69
69
|
end
|
70
70
|
|
data/lib/hbci/segments/hnvsd.rb
CHANGED
@@ -22,7 +22,7 @@ module Hbci
|
|
22
22
|
|
23
23
|
def find_all(segment_type)
|
24
24
|
@raw_segments = Parser.parse(content)
|
25
|
-
@raw_segments.select { |sd| sd[0][0] == segment_type }.map{ |sd| Hbci::SegmentFactory.build(sd) }
|
25
|
+
@raw_segments.select { |sd| sd[0][0] == segment_type }.map { |sd| Hbci::SegmentFactory.build(sd) }
|
26
26
|
end
|
27
27
|
|
28
28
|
def add_segment(segment)
|
data/lib/hbci/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hbci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Lehnert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bank_credentials
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
34
|
+
version: '1.2'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
41
|
+
version: '1.2'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: httparty
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,28 +169,28 @@ dependencies:
|
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '3.
|
172
|
+
version: '3.8'
|
173
173
|
type: :development
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '3.
|
179
|
+
version: '3.8'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: rubocop
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '0.
|
186
|
+
version: '0.60'
|
187
187
|
type: :development
|
188
188
|
prerelease: false
|
189
189
|
version_requirements: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - "~>"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: '0.
|
193
|
+
version: '0.60'
|
194
194
|
- !ruby/object:Gem::Dependency
|
195
195
|
name: timecop
|
196
196
|
requirement: !ruby/object:Gem::Requirement
|