epics 2.3.0 → 2.5.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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.semaphore/semaphore.yml +3 -12
  3. data/CHANGELOG.md +13 -0
  4. data/epics.gemspec +5 -4
  5. data/lib/epics/azv.rb +9 -26
  6. data/lib/epics/b2b.rb +11 -3
  7. data/lib/epics/c2s.rb +11 -7
  8. data/lib/epics/c52.rb +12 -37
  9. data/lib/epics/c53.rb +12 -37
  10. data/lib/epics/c54.rb +12 -37
  11. data/lib/epics/c5n.rb +17 -0
  12. data/lib/epics/ccs.rb +11 -7
  13. data/lib/epics/cct.rb +9 -34
  14. data/lib/epics/cd1.rb +9 -26
  15. data/lib/epics/cdb.rb +9 -34
  16. data/lib/epics/cdd.rb +9 -34
  17. data/lib/epics/cds.rb +11 -7
  18. data/lib/epics/cdz.rb +12 -41
  19. data/lib/epics/client.rb +44 -19
  20. data/lib/epics/crz.rb +12 -41
  21. data/lib/epics/generic_request.rb +8 -3
  22. data/lib/epics/generic_upload_request.rb +2 -2
  23. data/lib/epics/haa.rb +8 -25
  24. data/lib/epics/hac.rb +12 -41
  25. data/lib/epics/header_request.rb +60 -0
  26. data/lib/epics/hia.rb +6 -16
  27. data/lib/epics/hkd.rb +8 -25
  28. data/lib/epics/hpb.rb +8 -18
  29. data/lib/epics/hpd.rb +8 -25
  30. data/lib/epics/htd.rb +8 -25
  31. data/lib/epics/ini.rb +6 -16
  32. data/lib/epics/letter_renderer.rb +22 -0
  33. data/lib/epics/ptk.rb +12 -41
  34. data/lib/epics/sta.rb +12 -41
  35. data/lib/epics/version.rb +1 -1
  36. data/lib/epics/vmk.rb +12 -41
  37. data/lib/epics/wss.rb +13 -0
  38. data/lib/epics/xct.rb +9 -26
  39. data/lib/epics/xds.rb +11 -3
  40. data/lib/epics/xe2.rb +13 -0
  41. data/lib/epics/xe3.rb +13 -0
  42. data/lib/epics/z52.rb +12 -37
  43. data/lib/epics/z53.rb +12 -37
  44. data/lib/epics/z54.rb +12 -37
  45. data/lib/epics.rb +9 -0
  46. data/lib/letter/ini.erb +260 -150
  47. data/lib/letter/locales/de.yml +19 -0
  48. data/lib/letter/locales/en.yml +19 -0
  49. data/lib/letter/locales/fr.yml +19 -0
  50. data/spec/fixtures/xml/swiss_credit_transfer.xml +69 -0
  51. data/spec/fixtures/xml/swiss_direct_debit.xml +104 -0
  52. data/spec/hpb_spec.rb +4 -4
  53. data/spec/orders/c52_spec.rb +1 -1
  54. data/spec/orders/c53_spec.rb +1 -1
  55. data/spec/orders/c54_spec.rb +1 -1
  56. data/spec/orders/c5n_spec.rb +9 -0
  57. data/spec/orders/cdz_spec.rb +1 -1
  58. data/spec/orders/crz_spec.rb +1 -1
  59. data/spec/orders/hac_spec.rb +1 -1
  60. data/spec/orders/ptk_spec.rb +1 -1
  61. data/spec/orders/sta_spec.rb +1 -1
  62. data/spec/orders/vmk_spec.rb +1 -1
  63. data/spec/orders/wss_spec.rb +9 -0
  64. data/spec/orders/xe2_spec.rb +17 -0
  65. data/spec/orders/xe3_spec.rb +17 -0
  66. data/spec/orders/z52_spec.rb +1 -1
  67. data/spec/orders/z53_spec.rb +1 -1
  68. data/spec/orders/z54_spec.rb +1 -1
  69. metadata +45 -10
data/lib/epics/ptk.rb CHANGED
@@ -1,46 +1,17 @@
1
1
  class Epics::PTK < Epics::GenericRequest
2
- attr_accessor :from, :to
3
-
4
- def initialize(client, from = nil, to = nil)
5
- super(client)
6
- self.from = from
7
- self.to = to
8
- end
9
-
10
2
  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 'PTK'
22
- xml.OrderAttribute 'DZHNN'
23
- if !!from && !!to
24
- xml.StandardOrderParams {
25
- xml.DateRange {
26
- xml.Start from
27
- xml.End to
28
- }
29
- }
30
- else
31
- xml.StandardOrderParams
32
- end
33
- }
34
- xml.BankPubKeyDigests {
35
- xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
36
- xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
37
- }
38
- xml.SecurityMedium '0000'
39
- }
40
- xml.mutable {
41
- xml.TransactionPhase 'Initialisation'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'PTK',
7
+ order_attribute: 'DZHNN',
8
+ order_params: !!options[:from] && !!options[:to] ? {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
42
12
  }
43
- }
44
- end.doc.root
13
+ } : {},
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
45
16
  end
46
17
  end
data/lib/epics/sta.rb CHANGED
@@ -1,46 +1,17 @@
1
1
  class Epics::STA < Epics::GenericRequest
2
- attr_accessor :from, :to
3
-
4
- def initialize(client, from = nil, to = nil)
5
- super(client)
6
- self.from = from
7
- self.to = to
8
- end
9
-
10
2
  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 'STA'
22
- xml.OrderAttribute 'DZHNN'
23
- if !!from && !!to
24
- xml.StandardOrderParams {
25
- xml.DateRange {
26
- xml.Start from
27
- xml.End to
28
- }
29
- }
30
- else
31
- xml.StandardOrderParams
32
- end
33
- }
34
- xml.BankPubKeyDigests {
35
- xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
36
- xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
37
- }
38
- xml.SecurityMedium '0000'
39
- }
40
- xml.mutable {
41
- xml.TransactionPhase 'Initialisation'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'STA',
7
+ order_attribute: 'DZHNN',
8
+ order_params: !!options[:from] && !!options[:to] ? {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
42
12
  }
43
- }
44
- end.doc.root
13
+ } : {},
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
45
16
  end
46
17
  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.3.0'
4
+ VERSION = '2.5.0'
5
5
  end
data/lib/epics/vmk.rb CHANGED
@@ -1,46 +1,17 @@
1
1
  class Epics::VMK < Epics::GenericRequest
2
- attr_accessor :from, :to
3
-
4
- def initialize(client, from = nil, to = nil)
5
- super(client)
6
- self.from = from
7
- self.to = to
8
- end
9
-
10
2
  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 'VMK'
22
- xml.OrderAttribute 'DZHNN'
23
- if !!from && !!to
24
- xml.StandardOrderParams {
25
- xml.DateRange {
26
- xml.Start from
27
- xml.End to
28
- }
29
- }
30
- else
31
- xml.StandardOrderParams
32
- end
33
- }
34
- xml.BankPubKeyDigests {
35
- xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
36
- xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
37
- }
38
- xml.SecurityMedium '0000'
39
- }
40
- xml.mutable {
41
- xml.TransactionPhase 'Initialisation'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'VMK',
7
+ order_attribute: 'DZHNN',
8
+ order_params: !!options[:from] && !!options[:to] ? {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
42
12
  }
43
- }
44
- end.doc.root
13
+ } : {},
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
45
16
  end
46
17
  end
data/lib/epics/wss.rb ADDED
@@ -0,0 +1,13 @@
1
+ class Epics::WSS < Epics::GenericRequest
2
+ def header
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'WSS',
7
+ order_attribute: 'DZHNN',
8
+ order_params: {},
9
+ mutable: { TransactionPhase: 'Initialisation' }
10
+ )
11
+ end
12
+ end
13
+
data/lib/epics/xct.rb CHANGED
@@ -1,30 +1,13 @@
1
1
  class Epics::XCT < Epics::GenericUploadRequest
2
2
  def header
3
- Nokogiri::XML::Builder.new do |xml|
4
- xml.header(authenticate: true) {
5
- xml.static {
6
- xml.HostID host_id
7
- xml.Nonce nonce
8
- xml.Timestamp timestamp
9
- xml.PartnerID partner_id
10
- xml.UserID user_id
11
- xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
12
- xml.OrderDetails {
13
- xml.OrderType 'XCT'
14
- xml.OrderAttribute 'OZHNN'
15
- xml.StandardOrderParams
16
- }
17
- xml.BankPubKeyDigests {
18
- xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
19
- xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
20
- }
21
- xml.SecurityMedium '0000'
22
- xml.NumSegments 1
23
- }
24
- xml.mutable {
25
- xml.TransactionPhase 'Initialisation'
26
- }
27
- }
28
- end.doc.root
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'XCT',
7
+ order_attribute: 'OZHNN',
8
+ order_params: {},
9
+ num_segments: 1,
10
+ mutable: { TransactionPhase: 'Initialisation' }
11
+ )
29
12
  end
30
13
  end
data/lib/epics/xds.rb CHANGED
@@ -1,5 +1,13 @@
1
- class Epics::XDS < Epics::CDD
2
- def order_type
3
- 'XDS'
1
+ class Epics::XDS < Epics::GenericUploadRequest
2
+ def header
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'XDS',
7
+ order_attribute: 'OZHNN',
8
+ order_params: {},
9
+ num_segments: 1,
10
+ mutable: { TransactionPhase: 'Initialisation' }
11
+ )
4
12
  end
5
13
  end
data/lib/epics/xe2.rb ADDED
@@ -0,0 +1,13 @@
1
+ class Epics::XE2 < Epics::GenericUploadRequest
2
+ def header
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'XE2',
7
+ order_attribute: 'OZHNN',
8
+ order_params: {},
9
+ num_segments: 1,
10
+ mutable: { TransactionPhase: 'Initialisation' }
11
+ )
12
+ end
13
+ end
data/lib/epics/xe3.rb ADDED
@@ -0,0 +1,13 @@
1
+ class Epics::XE3 < Epics::GenericUploadRequest
2
+ def header
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'XE3',
7
+ order_attribute: 'OZHNN',
8
+ order_params: {},
9
+ num_segments: 1,
10
+ mutable: { TransactionPhase: 'Initialisation' }
11
+ )
12
+ end
13
+ end
data/lib/epics/z52.rb CHANGED
@@ -1,42 +1,17 @@
1
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
2
  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'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'Z52',
7
+ order_attribute: 'DZHNN',
8
+ order_params: {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
38
12
  }
39
- }
40
- end.doc.root
13
+ },
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
41
16
  end
42
17
  end
data/lib/epics/z53.rb CHANGED
@@ -1,42 +1,17 @@
1
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
2
  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'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'Z53',
7
+ order_attribute: 'DZHNN',
8
+ order_params: {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
38
12
  }
39
- }
40
- end.doc.root
13
+ },
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
41
16
  end
42
17
  end
data/lib/epics/z54.rb CHANGED
@@ -1,42 +1,17 @@
1
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
2
  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'
3
+ client.header_request.build(
4
+ nonce: nonce,
5
+ timestamp: timestamp,
6
+ order_type: 'Z54',
7
+ order_attribute: 'DZHNN',
8
+ order_params: {
9
+ DateRange: {
10
+ Start: options[:from],
11
+ End: options[:to]
38
12
  }
39
- }
40
- end.doc.root
13
+ },
14
+ mutable: { TransactionPhase: 'Initialisation' }
15
+ )
41
16
  end
42
17
  end
data/lib/epics.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'openssl'
2
2
  require 'base64'
3
3
  require 'erb'
4
+ require 'i18n'
4
5
  require 'json'
5
6
  require 'zlib'
6
7
  require 'zip'
@@ -12,10 +13,12 @@ require "epics/version"
12
13
  require "epics/key"
13
14
  require "epics/response"
14
15
  require "epics/error"
16
+ require 'epics/letter_renderer'
15
17
  require "epics/middleware/xmlsig"
16
18
  require "epics/middleware/parse_ebics"
17
19
  require "epics/generic_request"
18
20
  require "epics/generic_upload_request"
21
+ require "epics/header_request"
19
22
  require "epics/azv"
20
23
  require "epics/hpb"
21
24
  require "epics/hkd"
@@ -26,17 +29,21 @@ require "epics/vmk"
26
29
  require "epics/c52"
27
30
  require "epics/c53"
28
31
  require "epics/c54"
32
+ require "epics/c5n"
29
33
  require "epics/z52"
30
34
  require "epics/z53"
31
35
  require "epics/z54"
32
36
  require "epics/ptk"
33
37
  require "epics/hac"
38
+ require "epics/wss"
34
39
  require "epics/hpd"
35
40
  require "epics/cd1"
36
41
  require "epics/cct"
37
42
  require "epics/ccs"
38
43
  require "epics/cdb"
39
44
  require "epics/cdd"
45
+ require "epics/xe2"
46
+ require "epics/xe3"
40
47
  require "epics/b2b"
41
48
  require "epics/xds"
42
49
  require "epics/cds"
@@ -49,6 +56,8 @@ require "epics/ini"
49
56
  require "epics/signer"
50
57
  require "epics/client"
51
58
 
59
+ I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'letter/locales', '*.yml')]
60
+
52
61
  module Epics
53
62
 
54
63
  end