epics 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,49 +10,40 @@ class Epics::HAC < Epics::GenericRequest
10
10
  self.to = to
11
11
  end
12
12
 
13
- def date_range
14
- if !!from && !!to
15
- { "DateRange" => { "Start" => from, "End" => to } }
16
- else
17
- { :content! => '' }
18
- end
19
- end
20
-
21
13
  def header
22
- {
23
- :@authenticate => true,
24
- static: {
25
- "HostID" => host_id,
26
- "Nonce" => nonce,
27
- "Timestamp" => timestamp,
28
- "PartnerID" => partner_id,
29
- "UserID" => user_id,
30
- "Product" => {
31
- :@Language => "de",
32
- :content! => "EPICS - a ruby ebics kernel"
33
- },
34
- "OrderDetails" => {
35
- "OrderType" => "HAC",
36
- "OrderAttribute" => "DZHNN",
37
- "StandardOrderParams" => date_range
38
- },
39
- "BankPubKeyDigests" => {
40
- "Authentication" => {
41
- :@Version => "X002",
42
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
43
- :content! => client.bank_x.public_digest
44
- },
45
- "Encryption" => {
46
- :@Version => "E002",
47
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
48
- :content! => client.bank_e.public_digest
14
+ Nokogiri::XML::Builder.new do |xml|
15
+ xml.header(authenticate: true) {
16
+ xml.static {
17
+ xml.HostID host_id
18
+ xml.Nonce nonce
19
+ xml.Timestamp timestamp
20
+ xml.PartnerID partner_id
21
+ xml.UserID user_id
22
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
23
+ xml.OrderDetails {
24
+ xml.OrderType 'HAC'
25
+ xml.OrderAttribute 'DZHNN'
26
+ if !!from && !!to
27
+ xml.StandardOrderParams {
28
+ xml.DateRange {
29
+ xml.Start from
30
+ xml.End to
31
+ }
32
+ }
33
+ else
34
+ xml.StandardOrderParams
35
+ end
36
+ }
37
+ xml.BankPubKeyDigests {
38
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
39
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
49
40
  }
50
- },
51
- "SecurityMedium" => "0000"
52
- },
53
- "mutable" => {
54
- "TransactionPhase" => "Initialisation"
41
+ xml.SecurityMedium '0000'
42
+ }
43
+ xml.mutable {
44
+ xml.TransactionPhase 'Initialisation'
45
+ }
55
46
  }
56
- }
47
+ end.doc.root
57
48
  end
58
49
  end
@@ -1,78 +1,70 @@
1
1
  class Epics::HIA < Epics::GenericRequest
2
-
3
2
  def root
4
3
  "ebicsUnsecuredRequest"
5
4
  end
6
5
 
7
6
  def header
8
- {
9
- :@authenticate => true,
10
- static: {
11
- "HostID" => host_id,
12
- "PartnerID" => partner_id,
13
- "UserID" => user_id,
14
- "Product" => {
15
- :@Language => "de",
16
- :content! => "EPICS - a ruby ebics kernel"
17
- },
18
- "OrderDetails" => {
19
- "OrderType" => "HIA",
20
- "OrderAttribute" => "DZNNN"
21
- },
22
- "SecurityMedium" => "0000"
23
- },
24
- "mutable" => ""
25
- }
7
+ Nokogiri::XML::Builder.new do |xml|
8
+ xml.header(authenticate: true) {
9
+ xml.static {
10
+ xml.HostID host_id
11
+ xml.PartnerID partner_id
12
+ xml.UserID user_id
13
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
14
+ xml.OrderDetails {
15
+ xml.OrderType 'HIA'
16
+ xml.OrderAttribute 'DZNNN'
17
+ }
18
+ xml.SecurityMedium '0000'
19
+ }
20
+ xml.mutable ''
21
+ }
22
+ end.doc.root
26
23
  end
27
24
 
28
25
  def body
29
- {
30
- "DataTransfer" => {
31
- "OrderData" => Base64.strict_encode64(Zlib::Deflate.deflate(order_data))
26
+ Nokogiri::XML::Builder.new do |xml|
27
+ xml.body{
28
+ xml.DataTransfer {
29
+ xml.OrderData Base64.strict_encode64(Zlib::Deflate.deflate(order_data))
30
+ }
32
31
  }
33
- }
32
+ end.doc.root
34
33
  end
35
34
 
36
35
  def order_data
37
- "<?xml version='1.0' encoding='utf-8'?>\n"+
38
- Gyoku.xml("HIARequestOrderData" => {
39
- :"@xmlns:ds" => "http://www.w3.org/2000/09/xmldsig#",
40
- :"@xmlns" => "urn:org:ebics:H004",
41
- "AuthenticationPubKeyInfo" => {
42
- "PubKeyValue" => {
43
- "ds:RSAKeyValue" => {
44
- "ds:Modulus" => Base64.strict_encode64([client.x.n].pack("H*")),
45
- "ds:Exponent" => Base64.strict_encode64(client.x.key.e.to_s(2))
36
+ Nokogiri::XML::Builder.new do |xml|
37
+ xml.HIARequestOrderData('xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#', 'xmlns' => 'urn:org:ebics:H004') {
38
+ xml.AuthenticationPubKeyInfo {
39
+ xml.PubKeyValue {
40
+ xml.send('ds:RSAKeyValue') {
41
+ xml.send('ds:Modulus', Base64.strict_encode64([client.x.n].pack("H*")))
42
+ xml.send('ds:Exponent', Base64.strict_encode64(client.x.key.e.to_s(2)))
43
+ }
46
44
  }
47
- },
48
- "AuthenticationVersion" => "X002"
49
- },
50
- "EncryptionPubKeyInfo" => {
51
- "PubKeyValue" => {
52
- "ds:RSAKeyValue" => {
53
- "ds:Modulus" => Base64.strict_encode64([client.e.n].pack("H*")),
54
- "ds:Exponent" => Base64.strict_encode64(client.e.key.e.to_s(2))
45
+ xml.AuthenticationVersion 'X002'
46
+ }
47
+ xml.EncryptionPubKeyInfo{
48
+ xml.PubKeyValue {
49
+ xml.send('ds:RSAKeyValue') {
50
+ xml.send('ds:Modulus', Base64.strict_encode64([client.e.n].pack("H*")))
51
+ xml.send('ds:Exponent', Base64.strict_encode64(client.e.key.e.to_s(2)))
52
+ }
55
53
  }
56
- },
57
- "EncryptionVersion" => "E002"
58
- },
59
-
60
- "PartnerID" => partner_id,
61
- "UserID" => user_id
62
- })
54
+ xml.EncryptionVersion 'E002'
55
+ }
56
+ xml.PartnerID partner_id
57
+ xml.UserID user_id
58
+ }
59
+ end.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML, encoding: 'utf-8')
63
60
  end
64
61
 
65
62
  def to_xml
66
- Nokogiri::XML.parse(Gyoku.xml( {
67
- root => {
68
- :"@xmlns:ds" => "http://www.w3.org/2000/09/xmldsig#",
69
- :@xmlns => "urn:org:ebics:H004",
70
- :@Version => "H004",
71
- :@Revision => "1",
72
- :header => header,
73
- "body" => body
63
+ Nokogiri::XML::Builder.new do |xml|
64
+ xml.send(root, 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#', 'xmlns' => 'urn:org:ebics:H004', 'Version' => 'H004', 'Revision' => '1') {
65
+ xml.parent.add_child(header)
66
+ xml.parent.add_child(body)
74
67
  }
75
- }), nil, "utf-8").to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
68
+ end.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML, encoding: 'utf-8')
76
69
  end
77
-
78
70
  end
@@ -1,40 +1,29 @@
1
1
  class Epics::HKD < Epics::GenericRequest
2
-
3
2
  def header
4
- {
5
- :@authenticate => true,
6
- static: {
7
- "HostID" => host_id,
8
- "Nonce" => nonce,
9
- "Timestamp" => timestamp,
10
- "PartnerID" => partner_id,
11
- "UserID" => user_id,
12
- "Product" => {
13
- :@Language => "de",
14
- :content! => "EPICS - a ruby ebics kernel"
15
- },
16
- "OrderDetails" => {
17
- "OrderType" => "HKD",
18
- "OrderAttribute" => "DZHNN",
19
- "StandardOrderParams/" => ""
20
- },
21
- "BankPubKeyDigests" => {
22
- "Authentication" => {
23
- :@Version => "X002",
24
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
25
- :content! => client.bank_x.public_digest
26
- },
27
- "Encryption" => {
28
- :@Version => "E002",
29
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
30
- :content! => client.bank_e.public_digest
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 'HKD'
14
+ xml.OrderAttribute 'DZHNN'
15
+ xml.StandardOrderParams ''
31
16
  }
32
- },
33
- "SecurityMedium" => "0000"
34
- },
35
- "mutable" => {
36
- "TransactionPhase" => "Initialisation"
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
+ }
23
+ xml.mutable {
24
+ xml.TransactionPhase 'Initialisation'
25
+ }
37
26
  }
38
- }
27
+ end.doc.root
39
28
  end
40
29
  end
@@ -1,29 +1,26 @@
1
1
  class Epics::HPB < Epics::GenericRequest
2
-
3
2
  def root
4
3
  "ebicsNoPubKeyDigestsRequest"
5
4
  end
6
5
 
7
6
  def header
8
- {
9
- :@authenticate => true,
10
- static: {
11
- "HostID" => host_id,
12
- "Nonce" => nonce,
13
- "Timestamp" => timestamp,
14
- "PartnerID" => partner_id,
15
- "UserID" => user_id,
16
- "Product" => {
17
- :@Language => "de",
18
- :content! => "EPICS - a ruby ebics kernel"
19
- },
20
- "OrderDetails" => {
21
- "OrderType" => "HPB",
22
- "OrderAttribute" => "DZHNN"
23
- },
24
- "SecurityMedium" => "0000"
25
- },
26
- "mutable/" => ""
27
- }
7
+ Nokogiri::XML::Builder.new do |xml|
8
+ xml.header(authenticate: true) {
9
+ xml.static {
10
+ xml.HostID host_id
11
+ xml.Nonce nonce
12
+ xml.Timestamp timestamp
13
+ xml.PartnerID partner_id
14
+ xml.UserID user_id
15
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
16
+ xml.OrderDetails {
17
+ xml.OrderType 'HPB'
18
+ xml.OrderAttribute 'DZHNN'
19
+ }
20
+ xml.SecurityMedium '0000'
21
+ }
22
+ xml.mutable ''
23
+ }
24
+ end.doc.root
28
25
  end
29
26
  end
@@ -1,40 +1,29 @@
1
1
  class Epics::HPD < Epics::GenericRequest
2
-
3
2
  def header
4
- {
5
- :@authenticate => true,
6
- static: {
7
- "HostID" => host_id,
8
- "Nonce" => nonce,
9
- "Timestamp" => timestamp,
10
- "PartnerID" => partner_id,
11
- "UserID" => user_id,
12
- "Product" => {
13
- :@Language => "de",
14
- :content! => "EPICS - a ruby ebics kernel"
15
- },
16
- "OrderDetails" => {
17
- "OrderType" => "HPD",
18
- "OrderAttribute" => "DZHNN",
19
- "StandardOrderParams/" => ""
20
- },
21
- "BankPubKeyDigests" => {
22
- "Authentication" => {
23
- :@Version => "X002",
24
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
25
- :content! => client.bank_x.public_digest
26
- },
27
- "Encryption" => {
28
- :@Version => "E002",
29
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
30
- :content! => client.bank_e.public_digest
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 'HPD'
14
+ xml.OrderAttribute 'DZHNN'
15
+ xml.StandardOrderParams
31
16
  }
32
- },
33
- "SecurityMedium" => "0000"
34
- },
35
- "mutable" => {
36
- "TransactionPhase" => "Initialisation"
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
+ }
23
+ xml.mutable {
24
+ xml.TransactionPhase 'Initialisation'
25
+ }
37
26
  }
38
- }
27
+ end.doc.root
39
28
  end
40
29
  end
@@ -1,40 +1,29 @@
1
1
  class Epics::HTD < Epics::GenericRequest
2
-
3
2
  def header
4
- {
5
- :@authenticate => true,
6
- static: {
7
- "HostID" => host_id,
8
- "Nonce" => nonce,
9
- "Timestamp" => timestamp,
10
- "PartnerID" => partner_id,
11
- "UserID" => user_id,
12
- "Product" => {
13
- :@Language => "de",
14
- :content! => "EPICS - a ruby ebics kernel"
15
- },
16
- "OrderDetails" => {
17
- "OrderType" => "HTD",
18
- "OrderAttribute" => "DZHNN",
19
- "StandardOrderParams/" => ""
20
- },
21
- "BankPubKeyDigests" => {
22
- "Authentication" => {
23
- :@Version => "X002",
24
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
25
- :content! => client.bank_x.public_digest
26
- },
27
- "Encryption" => {
28
- :@Version => "E002",
29
- :@Algorithm => "http://www.w3.org/2001/04/xmlenc#sha256",
30
- :content! => client.bank_e.public_digest
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 'HTD'
14
+ xml.OrderAttribute 'DZHNN'
15
+ xml.StandardOrderParams
31
16
  }
32
- },
33
- "SecurityMedium" => "0000"
34
- },
35
- "mutable" => {
36
- "TransactionPhase" => "Initialisation"
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
+ }
23
+ xml.mutable {
24
+ xml.TransactionPhase 'Initialisation'
25
+ }
37
26
  }
38
- }
27
+ end.doc.root
39
28
  end
40
29
  end