epics 2.2.0 → 2.3.0

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
  SHA256:
3
- metadata.gz: 196537be2328e1c2445eafddb04840616446d599e8f2c887b8d6e5884acd1107
4
- data.tar.gz: 7d0fc17a578fcae3e3827d56375c20449961b40f581fdd2a192f7addf1ac3c6e
3
+ metadata.gz: '0235859714f452d06af25055ba018845fb391e71b95813951422d851b274974e'
4
+ data.tar.gz: 699de0520f011d9755685e222e64a563ef8a7fac3558cc0520b156b0e5232bfd
5
5
  SHA512:
6
- metadata.gz: d8b5b8538c6c6100f1e6f9cf225999ec1d9bed0fa152bfb0aa5ff8f02cdfd545254eb9a348f03e868fa7544e67424b1fbd4277ba1185bc820fa68792ed23bb9b
7
- data.tar.gz: e490b632b8f018aff18c8461780875190af6a287807c7baaaa579060eca89961b83bd3404291b31f98a54859a6a8eca9df2b7053c9de080a9043a7b1ae0a84f6
6
+ metadata.gz: 8ed0c386749155a12c1b88d1b3fea266a9a2d99dad01fcbc8e5eecefa6af8a2dc0708b7ce9591b23a50d244451c05c456c31774690911dc0c96247a023a90aba
7
+ data.tar.gz: f03bab54f984eaa5ee3515854753f78b2e9c4e5b5347f4c40b762c829e174edfe8139c6f7328d2d703be3864f81c4345d7fb954d3245136d4ab047363d2780b9
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 2.3.0
4
+
5
+ - [ENHANCEMENT] Adds Z52, Z53, Z54 order type (C52, C53, C54 for swiss banks)
6
+
3
7
  ### 2.2.0
4
8
 
5
- - [ENHANCEMENT] Adds C2S order tyoe
9
+ - [ENHANCEMENT] Adds C2S order type
6
10
  - [HOUSEKEEPING] updates nokogiri dependency
7
11
  - [HOUSEKEEPING] updates rexml dependency
8
12
  - [HOUSEKEEPING] adds Ruby 3.3 to CI
data/lib/epics/client.rb CHANGED
@@ -185,6 +185,18 @@ class Epics::Client
185
185
  download_and_unzip(Epics::C54, from, to)
186
186
  end
187
187
 
188
+ def Z52(from, to)
189
+ download_and_unzip(Epics::Z52, from, to)
190
+ end
191
+
192
+ def Z53(from, to)
193
+ download_and_unzip(Epics::Z53, from, to)
194
+ end
195
+
196
+ def Z54(from, to)
197
+ download_and_unzip(Epics::Z54, from, to)
198
+ end
199
+
188
200
  def HAA
189
201
  Nokogiri::XML(download(Epics::HAA)).at_xpath("//xmlns:OrderTypes", xmlns: "urn:org:ebics:H004").content.split(/\s/)
190
202
  end
data/lib/epics/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epics
4
- VERSION = '2.2.0'
4
+ VERSION = '2.3.0'
5
5
  end
data/lib/epics/z52.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z52 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z52'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics/z53.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z53 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z53'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics/z54.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z54 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z54'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics.rb CHANGED
@@ -26,6 +26,9 @@ require "epics/vmk"
26
26
  require "epics/c52"
27
27
  require "epics/c53"
28
28
  require "epics/c54"
29
+ require "epics/z52"
30
+ require "epics/z53"
31
+ require "epics/z54"
29
32
  require "epics/ptk"
30
33
  require "epics/hac"
31
34
  require "epics/hpd"
data/spec/client_spec.rb CHANGED
@@ -209,25 +209,25 @@ RSpec.describe Epics::Client do
209
209
  end
210
210
  end
211
211
 
212
- describe '#C53/C52/C54 types with zipped data' do
212
+ describe '#C53/C52/C54/Z52/Z53/Z54 types with zipped data' do
213
213
  before do
214
214
  allow(subject).to receive(:download).and_return( File.read(File.join(File.dirname(__FILE__), 'fixtures', 'test.zip') ))
215
215
  end
216
216
 
217
217
  it 'will unzip the returned data' do
218
- %w(C52 C53 C54).each do |c|
218
+ %w(C52 C53 C54 Z52 Z53 Z54).each do |c|
219
219
  expect(subject.send(c, :today, :yesterday)).to eq(["ebics is great\n"])
220
220
  end
221
221
  end
222
222
  end
223
223
 
224
- describe '#C53/C52/C54 types with zipped data with general purpose bit flag 3 set' do
224
+ describe '#C53/C52/C54/Z52/Z53/Z54 types with zipped data with general purpose bit flag 3 set' do
225
225
  before do
226
226
  allow(subject).to receive(:download).and_return( File.read(File.join(File.dirname(__FILE__), 'fixtures', 'test_with_general_purpose_bit_3.zip') ))
227
227
  end
228
228
 
229
229
  it 'will unzip the returned data' do
230
- %w(C52 C53 C54).each do |c|
230
+ %w(C52 C53 C54 Z52 Z53 Z54).each do |c|
231
231
  expect(subject.send(c, :today, :yesterday)).to eq(["ebics is great\n"])
232
232
  end
233
233
  end
@@ -0,0 +1,11 @@
1
+ RSpec.describe Epics::Z52 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, "2014-09-01", "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,11 @@
1
+ RSpec.describe Epics::Z53 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, "2014-09-01", "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,9 @@
1
+ RSpec.describe Epics::Z54 do
2
+ 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') }
3
+
4
+ subject { described_class.new(client, "2014-09-01", "2014-09-30") }
5
+
6
+ describe '#to_xml' do
7
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -215,6 +215,9 @@ files:
215
215
  - lib/epics/vmk.rb
216
216
  - lib/epics/xct.rb
217
217
  - lib/epics/xds.rb
218
+ - lib/epics/z52.rb
219
+ - lib/epics/z53.rb
220
+ - lib/epics/z54.rb
218
221
  - lib/letter/ini.erb
219
222
  - spec/.DS_Store
220
223
  - spec/client_spec.rb
@@ -282,6 +285,9 @@ files:
282
285
  - spec/orders/sta_spec.rb
283
286
  - spec/orders/vmk_spec.rb
284
287
  - spec/orders/xds_spec.rb
288
+ - spec/orders/z52_spec.rb
289
+ - spec/orders/z53_spec.rb
290
+ - spec/orders/z54_spec.rb
285
291
  - spec/response_spec.rb
286
292
  - spec/signer_spec.rb
287
293
  - spec/spec_helper.rb
@@ -392,6 +398,9 @@ test_files:
392
398
  - spec/orders/sta_spec.rb
393
399
  - spec/orders/vmk_spec.rb
394
400
  - spec/orders/xds_spec.rb
401
+ - spec/orders/z52_spec.rb
402
+ - spec/orders/z53_spec.rb
403
+ - spec/orders/z54_spec.rb
395
404
  - spec/response_spec.rb
396
405
  - spec/signer_spec.rb
397
406
  - spec/spec_helper.rb