epics 2.7.0 → 2.9.0
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/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/epics.gemspec +2 -0
- data/lib/epics/bka.rb +17 -0
- data/lib/epics/client.rb +11 -0
- data/lib/epics/hev.rb +19 -0
- data/lib/epics/response.rb +8 -0
- data/lib/epics/signer.rb +3 -3
- data/lib/epics/version.rb +1 -1
- data/lib/epics.rb +2 -0
- data/spec/orders/bka_spec.rb +11 -0
- data/spec/orders/hev_spec.rb +14 -0
- metadata +37 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc38fae79ba6b5ebcbafa535bfd7b4364b708deff8d1d45caa44ed9273a338e1
|
4
|
+
data.tar.gz: 3a54d33face295d3f0718baeb6343d8aff05946b27aaf11f9df0871869e266bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3827df11227abf25613c8b27356cbb45465d2be54b58421725bb9625338be4c1bedab8683c3b0f9e9630bc3a63700bfcc897fff130baae465475e53f5112aa43
|
7
|
+
data.tar.gz: 168a79d4581dcc1053a130081d70bf08741f7d7f96582863963653aab189f866c303b6c582d15584851443d5c65756139b3956ca81c3dfbf0715afc5ba3040ae
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ It supports EBICS 2.5.
|
|
10
10
|
|
11
11
|
The client supports the complete initialization process comprising INI, HIA and HPB including the
|
12
12
|
INI letter generation. It offers support for the most common download and upload order types
|
13
|
-
(STA HAA HTD HPD PTK HAC HKD C52 C53 C54 CD1 CDB CDD CCT VMK FDL).
|
13
|
+
(STA HAA HTD HPD PTK HAC HKD BKA C52 C53 C54 CD1 CDB CDD CCT VMK FDL).
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
data/epics.gemspec
CHANGED
@@ -44,6 +44,8 @@ Gem::Specification.new do |spec|
|
|
44
44
|
spec.post_install_message += "Please create an issue on github (railslove/epics) if anything does not work as expected. And contact team@railslove.com if you are looking for support with your integration.\n"
|
45
45
|
spec.post_install_message += "\e[32m" + ('*' * 60) + "\n\e[0m"
|
46
46
|
|
47
|
+
spec.add_dependency 'base64'
|
48
|
+
spec.add_dependency 'bigdecimal'
|
47
49
|
spec.add_dependency 'faraday', '>= 1.10.0'
|
48
50
|
spec.add_dependency 'i18n', '>= 1.1.0'
|
49
51
|
spec.add_dependency 'nokogiri', '>= 1.16.7'
|
data/lib/epics/bka.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
class Epics::BKA < Epics::GenericRequest
|
2
|
+
def header
|
3
|
+
client.header_request.build(
|
4
|
+
nonce: nonce,
|
5
|
+
timestamp: timestamp,
|
6
|
+
order_type: 'BKA',
|
7
|
+
order_attribute: 'DZHNN',
|
8
|
+
order_params: {
|
9
|
+
DateRange: {
|
10
|
+
Start: options[:from],
|
11
|
+
End: options[:to]
|
12
|
+
}
|
13
|
+
},
|
14
|
+
mutable: { TransactionPhase: 'Initialisation' }
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
data/lib/epics/client.rb
CHANGED
@@ -107,6 +107,13 @@ class Epics::Client
|
|
107
107
|
post(url, Epics::INI.new(self).to_xml).body.ok?
|
108
108
|
end
|
109
109
|
|
110
|
+
def HEV
|
111
|
+
res = post(url, Epics::HEV.new(self).to_xml).body
|
112
|
+
res.doc.xpath("//xmlns:VersionNumber", xmlns: 'http://www.ebics.org/H000').each_with_object({}) do |node, versions|
|
113
|
+
versions[node['ProtocolVersion']] = node.content
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
110
117
|
def HPB
|
111
118
|
Nokogiri::XML(download(Epics::HPB)).xpath("//xmlns:PubKeyValue", xmlns: "urn:org:ebics:H004").each do |node|
|
112
119
|
type = node.parent.last_element_child.content
|
@@ -198,6 +205,10 @@ class Epics::Client
|
|
198
205
|
download_and_unzip(Epics::CRZ, from: from, to: to)
|
199
206
|
end
|
200
207
|
|
208
|
+
def BKA(from, to)
|
209
|
+
download_and_unzip(Epics::BKA, from: from, to: to)
|
210
|
+
end
|
211
|
+
|
201
212
|
def C52(from, to)
|
202
213
|
download_and_unzip(Epics::C52, from: from, to: to)
|
203
214
|
end
|
data/lib/epics/hev.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
class Epics::HEV < Epics::GenericRequest
|
2
|
+
def root
|
3
|
+
"ebicsHEVRequest"
|
4
|
+
end
|
5
|
+
|
6
|
+
def body
|
7
|
+
Nokogiri::XML::Builder.new do |xml|
|
8
|
+
xml.HostID host_id
|
9
|
+
end.doc.root
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_xml
|
13
|
+
Nokogiri::XML::Builder.new do |xml|
|
14
|
+
xml.send(root, 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'http://www.ebics.org/H000 http://www.ebics.org/H000/ebics_hev.xsd', 'xmlns' => 'http://www.ebics.org/H000') {
|
15
|
+
xml.parent.add_child(body)
|
16
|
+
}
|
17
|
+
end.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML, encoding: 'utf-8')
|
18
|
+
end
|
19
|
+
end
|
data/lib/epics/response.rb
CHANGED
@@ -12,9 +12,17 @@ class Epics::Response
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def technical_code
|
15
|
+
mutable_return_code.empty? ? system_return_code : mutable_return_code
|
16
|
+
end
|
17
|
+
|
18
|
+
def mutable_return_code
|
15
19
|
doc.xpath("//xmlns:header/xmlns:mutable/xmlns:ReturnCode", xmlns: "urn:org:ebics:H004").text
|
16
20
|
end
|
17
21
|
|
22
|
+
def system_return_code
|
23
|
+
doc.xpath("//xmlns:SystemReturnCode/xmlns:ReturnCode", xmlns: 'http://www.ebics.org/H000').text
|
24
|
+
end
|
25
|
+
|
18
26
|
def business_error?
|
19
27
|
!["", "000000"].include?(business_code)
|
20
28
|
end
|
data/lib/epics/signer.rb
CHANGED
@@ -17,7 +17,7 @@ class Epics::Signer
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def sign!
|
20
|
-
signature_value_node = doc.xpath("//ds:SignatureValue").first
|
20
|
+
signature_value_node = doc.xpath("//ds:SignatureValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
21
21
|
|
22
22
|
if signature_node
|
23
23
|
signature_value_node.content = Base64.encode64(client.x.key.sign(digester, signature_node.canonicalize)).gsub(/\n/,'')
|
@@ -27,11 +27,11 @@ class Epics::Signer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def digest_node
|
30
|
-
@d ||= doc.xpath("//ds:DigestValue").first
|
30
|
+
@d ||= doc.xpath("//ds:DigestValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
31
31
|
end
|
32
32
|
|
33
33
|
def signature_node
|
34
|
-
@s ||= doc.xpath("//ds:SignedInfo").first
|
34
|
+
@s ||= doc.xpath("//ds:SignedInfo", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
35
35
|
end
|
36
36
|
|
37
37
|
def digester
|
data/lib/epics/version.rb
CHANGED
data/lib/epics.rb
CHANGED
@@ -27,6 +27,7 @@ require "epics/haa"
|
|
27
27
|
require "epics/sta"
|
28
28
|
require "epics/fdl"
|
29
29
|
require "epics/vmk"
|
30
|
+
require "epics/bka"
|
30
31
|
require "epics/c52"
|
31
32
|
require "epics/c53"
|
32
33
|
require "epics/c54"
|
@@ -55,6 +56,7 @@ require "epics/crz"
|
|
55
56
|
require "epics/xct"
|
56
57
|
require "epics/hia"
|
57
58
|
require "epics/ini"
|
59
|
+
require "epics/hev"
|
58
60
|
require "epics/signer"
|
59
61
|
require "epics/client"
|
60
62
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
RSpec.describe Epics::BKA do
|
2
|
+
|
3
|
+
let(:client) { Epics::Client.new( File.open(File.join( File.dirname(__FILE__), '..', 'fixtures', 'SIZBN001.key')), 'secret' , 'https://194.180.18.30/ebicsweb/ebicsweb', 'SIZBN001', 'EBIX', 'EBICS') }
|
4
|
+
|
5
|
+
subject { described_class.new(client, from: "2014-09-01", to: "2014-09-30") }
|
6
|
+
|
7
|
+
describe '#to_xml' do
|
8
|
+
specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
RSpec.describe Epics::HEV do
|
2
|
+
|
3
|
+
let(:client) { Epics::Client.new( File.open(File.join( File.dirname(__FILE__), '..', 'fixtures', 'SIZBN001.key')), 'secret' , 'https://194.180.18.30/ebicsweb/ebicsweb', 'SIZBN001', 'EBIX', 'EBICS') }
|
4
|
+
|
5
|
+
let(:xsd) { Nokogiri::XML::Schema(File.open( File.join( File.dirname(__FILE__), '..', 'xsd', 'ebics_hev.xsd') )) }
|
6
|
+
let(:validator) { xsd.valid?(Nokogiri::XML(subject.to_xml)) }
|
7
|
+
|
8
|
+
subject { described_class.new(client) }
|
9
|
+
|
10
|
+
describe '#to_xml' do
|
11
|
+
specify { expect(validator).to be_truthy }
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Brillert
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-24 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: base64
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bigdecimal
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
13
40
|
- !ruby/object:Gem::Dependency
|
14
41
|
name: faraday
|
15
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +225,7 @@ files:
|
|
198
225
|
- lib/epics.rb
|
199
226
|
- lib/epics/azv.rb
|
200
227
|
- lib/epics/b2b.rb
|
228
|
+
- lib/epics/bka.rb
|
201
229
|
- lib/epics/c2s.rb
|
202
230
|
- lib/epics/c52.rb
|
203
231
|
- lib/epics/c53.rb
|
@@ -220,6 +248,7 @@ files:
|
|
220
248
|
- lib/epics/haa.rb
|
221
249
|
- lib/epics/hac.rb
|
222
250
|
- lib/epics/header_request.rb
|
251
|
+
- lib/epics/hev.rb
|
223
252
|
- lib/epics/hia.rb
|
224
253
|
- lib/epics/hkd.rb
|
225
254
|
- lib/epics/hpb.rb
|
@@ -294,6 +323,7 @@ files:
|
|
294
323
|
- spec/middleware/parse_ebics_spec.rb
|
295
324
|
- spec/orders/azv_spec.rb
|
296
325
|
- spec/orders/b2b_spec.rb
|
326
|
+
- spec/orders/bka_spec.rb
|
297
327
|
- spec/orders/c2s_spec.rb
|
298
328
|
- spec/orders/c52_spec.rb
|
299
329
|
- spec/orders/c53_spec.rb
|
@@ -310,6 +340,7 @@ files:
|
|
310
340
|
- spec/orders/fdl_spec.rb
|
311
341
|
- spec/orders/haa_spec.rb
|
312
342
|
- spec/orders/hac_spec.rb
|
343
|
+
- spec/orders/hev_spec.rb
|
313
344
|
- spec/orders/hia_spec.rb
|
314
345
|
- spec/orders/hkd_spec.rb
|
315
346
|
- spec/orders/hpb_spec.rb
|
@@ -368,8 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
399
|
- !ruby/object:Gem::Version
|
369
400
|
version: '0'
|
370
401
|
requirements: []
|
371
|
-
rubygems_version: 3.
|
372
|
-
signing_key:
|
402
|
+
rubygems_version: 3.6.2
|
373
403
|
specification_version: 4
|
374
404
|
summary: a ruby implementation of the EBICS protocol
|
375
405
|
test_files:
|
@@ -419,6 +449,7 @@ test_files:
|
|
419
449
|
- spec/middleware/parse_ebics_spec.rb
|
420
450
|
- spec/orders/azv_spec.rb
|
421
451
|
- spec/orders/b2b_spec.rb
|
452
|
+
- spec/orders/bka_spec.rb
|
422
453
|
- spec/orders/c2s_spec.rb
|
423
454
|
- spec/orders/c52_spec.rb
|
424
455
|
- spec/orders/c53_spec.rb
|
@@ -435,6 +466,7 @@ test_files:
|
|
435
466
|
- spec/orders/fdl_spec.rb
|
436
467
|
- spec/orders/haa_spec.rb
|
437
468
|
- spec/orders/hac_spec.rb
|
469
|
+
- spec/orders/hev_spec.rb
|
438
470
|
- spec/orders/hia_spec.rb
|
439
471
|
- spec/orders/hkd_spec.rb
|
440
472
|
- spec/orders/hpb_spec.rb
|