epics 1.3.0 → 1.3.1

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
  SHA1:
3
- metadata.gz: 374545797bb76c3cca30bc9e628692dc7e1d3667
4
- data.tar.gz: 73abda6207abda78a72706b8e76161acfb1e73f1
3
+ metadata.gz: 61d881bf8791586ff4fa95db25764760a5ca0a1f
4
+ data.tar.gz: 63360ac97af8276e2338498e38f43e9c3460d10f
5
5
  SHA512:
6
- metadata.gz: 34ff475ce4c532e56308cb300db75f1c87c0b9bf09e51093e80d4d09cef3c37510a49c48eef769277e32d74fa59dfb296dda228b91ca6e23a996585bd3e03fcd
7
- data.tar.gz: 327e51904471698d960b82888a39eff70fb3516008f40d56af39ad6878e2c4444448eebbcf963f5fc061102d5b33cd8d21e813acb6058e2f51daa3af3b68077f
6
+ metadata.gz: d9d31d54ffdeb3c97f0a4c3b49192272b1ea6e1829a3de89b299a783cb28b487e12dfb5e1c531156a26083c38f3d774664942a9390dac99f0171c7b2e031137d
7
+ data.tar.gz: 856a8e8940b28ced56c3d02118dd1a819331d2eb16febbe08cf797e69e1099153456a3e3dcaec89d503a1b45a43a31f96f7287c740c81a9f4b22dd313983d460
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 1.3.1
2
+
3
+ * [ENHANCEMENT] make xpath namespaces explicit, so we can cover a wider
4
+ rage of responses
5
+
1
6
  ### 1.3.0
2
7
 
3
8
  * [BUGFIX] unzip C5X payloads
data/lib/epics/client.rb CHANGED
@@ -95,7 +95,7 @@ class Epics::Client
95
95
  end
96
96
 
97
97
  def HPB
98
- Nokogiri::XML(download(Epics::HPB)).xpath("//xmlns:PubKeyValue").each do |node|
98
+ Nokogiri::XML(download(Epics::HPB)).xpath("//xmlns:PubKeyValue", xmlns: "urn:org:ebics:H004").each do |node|
99
99
  type = node.parent.last_element_child.content
100
100
 
101
101
  modulus = Base64.decode64(node.at_xpath(".//*[local-name() = 'Modulus']").content)
@@ -136,14 +136,14 @@ class Epics::Client
136
136
  end
137
137
 
138
138
  def HAA
139
- Nokogiri::XML(download(Epics::HAA)).at_xpath("//xmlns:OrderTypes").content.split(/\s/)
139
+ Nokogiri::XML(download(Epics::HAA)).at_xpath("//xmlns:OrderTypes", xmlns: "urn:org:ebics:H004").content.split(/\s/)
140
140
  end
141
141
 
142
142
  def HTD
143
143
  Nokogiri::XML(download(Epics::HTD)).tap do |htd|
144
- @iban ||= htd.at_xpath("//xmlns:AccountNumber[@international='true']").text
145
- @bic ||= htd.at_xpath("//xmlns:BankCode[@international='true']").text
146
- @name ||= htd.at_xpath("//xmlns:Name").text
144
+ @iban ||= htd.at_xpath("//xmlns:AccountNumber[@international='true']", xmlns: "urn:org:ebics:H004").text
145
+ @bic ||= htd.at_xpath("//xmlns:BankCode[@international='true']", xmlns: "urn:org:ebics:H004").text
146
+ @name ||= htd.at_xpath("//xmlns:Name", xmlns: "urn:org:ebics:H004").text
147
147
  end.to_xml
148
148
  end
149
149
 
@@ -12,7 +12,7 @@ class Epics::Response
12
12
  end
13
13
 
14
14
  def technical_code
15
- doc.xpath("//xmlns:header/xmlns:mutable/xmlns:ReturnCode").text
15
+ doc.xpath("//xmlns:header/xmlns:mutable/xmlns:ReturnCode", xmlns: "urn:org:ebics:H004").text
16
16
  end
17
17
 
18
18
  def business_error?
@@ -20,7 +20,7 @@ class Epics::Response
20
20
  end
21
21
 
22
22
  def business_code
23
- doc.xpath("//xmlns:body/xmlns:ReturnCode").text
23
+ doc.xpath("//xmlns:body/xmlns:ReturnCode", xmlns: "urn:org:ebics:H004").text
24
24
  end
25
25
 
26
26
  def ok?
@@ -28,34 +28,34 @@ class Epics::Response
28
28
  end
29
29
 
30
30
  def last_segment?
31
- !!doc.at_xpath("//xmlns:header/xmlns:mutable/*[@lastSegment='true']")
31
+ !!doc.at_xpath("//xmlns:header/xmlns:mutable/*[@lastSegment='true']", xmlns: "urn:org:ebics:H004")
32
32
  end
33
33
 
34
34
  def segmented?
35
- !!doc.at_xpath("//xmlns:header/xmlns:mutable/xmlns:SegmentNumber")
35
+ !!doc.at_xpath("//xmlns:header/xmlns:mutable/xmlns:SegmentNumber", xmlns: "urn:org:ebics:H004")
36
36
  end
37
37
 
38
38
  def return_code
39
- doc.xpath("//xmlns:ReturnCode").last.content
39
+ doc.xpath("//xmlns:ReturnCode", xmlns: "urn:org:ebics:H004").last.content
40
40
  rescue NoMethodError
41
41
  nil
42
42
  end
43
43
 
44
44
  def report_text
45
- doc.xpath("//xmlns:ReportText").first.content
45
+ doc.xpath("//xmlns:ReportText", xmlns: "urn:org:ebics:H004").first.content
46
46
  end
47
47
 
48
48
  def transaction_id
49
- doc.xpath("//xmlns:header/xmlns:static/xmlns:TransactionID").text
49
+ doc.xpath("//xmlns:header/xmlns:static/xmlns:TransactionID", xmlns: 'urn:org:ebics:H004').text
50
50
  end
51
51
 
52
52
  def order_id
53
- doc.xpath("//xmlns:header/xmlns:mutable/xmlns:OrderID").text
53
+ doc.xpath("//xmlns:header/xmlns:mutable/xmlns:OrderID", xmlns: "urn:org:ebics:H004").text
54
54
  end
55
55
 
56
56
  def digest_valid?
57
57
  authenticated = doc.xpath("//*[@authenticate='true']").map(&:canonicalize).join
58
- digest_value = doc.xpath("//ds:DigestValue").first
58
+ digest_value = doc.xpath("//ds:DigestValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
59
59
 
60
60
  digest = Base64.encode64(digester.digest(authenticated)).strip
61
61
 
@@ -63,20 +63,20 @@ class Epics::Response
63
63
  end
64
64
 
65
65
  def signature_valid?
66
- signature = doc.xpath("//ds:SignedInfo").first.canonicalize
67
- signature_value = doc.xpath("//ds:SignatureValue").first
66
+ signature = doc.xpath("//ds:SignedInfo", ds: "http://www.w3.org/2000/09/xmldsig#").first.canonicalize
67
+ signature_value = doc.xpath("//ds:SignatureValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
68
68
 
69
69
  client.bank_x.key.verify(digester, Base64.decode64(signature_value.content), signature)
70
70
  end
71
71
 
72
72
  def public_digest_valid?
73
- encryption_pub_key_digest = doc.xpath("//xmlns:EncryptionPubKeyDigest").first
73
+ encryption_pub_key_digest = doc.xpath("//xmlns:EncryptionPubKeyDigest", xmlns: 'urn:org:ebics:H004').first
74
74
 
75
75
  client.e.public_digest == encryption_pub_key_digest.content
76
76
  end
77
77
 
78
78
  def order_data
79
- order_data_encrypted = Base64.decode64(doc.xpath("//xmlns:OrderData").first.content)
79
+ order_data_encrypted = Base64.decode64(doc.xpath("//xmlns:OrderData", xmlns: 'urn:org:ebics:H004').first.content)
80
80
 
81
81
  data = (cipher.update(order_data_encrypted) + cipher.final)
82
82
 
@@ -93,7 +93,7 @@ class Epics::Response
93
93
  end
94
94
 
95
95
  def transaction_key
96
- transaction_key_encrypted = Base64.decode64(doc.xpath("//xmlns:TransactionKey").first.content)
96
+ transaction_key_encrypted = Base64.decode64(doc.xpath("//xmlns:TransactionKey", xmlns: 'urn:org:ebics:H004').first.content)
97
97
 
98
98
  @transaction_key ||= client.e.key.private_decrypt(transaction_key_encrypted)
99
99
  end
data/lib/epics/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Epics
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -67,8 +67,8 @@ RSpec.describe Epics::Client do
67
67
 
68
68
  before do
69
69
  stub_request(:post, "https://194.180.18.30/ebicsweb/ebicsweb")
70
- .with(:body => %r[<?xml(.*)ebicsNoPubKeyDigestsRequest>])
71
- .to_return(status: 200, body: File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'hpb_response.xml')))
70
+ .with(:body => %r[ebicsNoPubKeyDigestsRequest])
71
+ .to_return(status: 200, body: File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'hpb_response_ebics_ns.xml')))
72
72
  end
73
73
 
74
74
  it { expect(subject.HPB).to match([be_a(Epics::Key), be_a(Epics::Key)]) }
@@ -1,21 +1,20 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ebicsKeyManagementResponse xmlns="http://www.ebics.org/H003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H003" xsi:schemaLocation="http://www.ebics.org/H003 http://www.ebics.org/H003/ebics_keymgmt_response.xsd">
3
- <header authenticate="true">
4
- <static/>
5
- <mutable>
6
- <ReturnCode>000000</ReturnCode>
7
- <ReportText>[EBICS_OK] OK</ReportText>
8
- </mutable>
9
- </header>
10
- <body>
11
- <DataTransfer>
12
- <DataEncryptionInfo authenticate="true">
13
- <EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">rwIxSUJAVEFDQ0sdYe+CybdspMllDG6ArNtdCzUbT1E=</EncryptionPubKeyDigest>
14
- <TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</TransactionKey>
15
- </DataEncryptionInfo>
16
- <OrderData>lJ/v1HvOYAZKTPkxULH4mOcUy01+EaAsxLzCPhtieAo9m5AtU5URdyBVfmclHbtWe3ELb02lR37bChynq0Esqpljxx7CiB+kl/bVs7XkNQQmtGPlh08O7ApJ7AHdKPFFvE+SM2OWpSwUrqJGtmyaU6s+RM66o/3Q0wvKi4y3+Q2jm8nkiWZpPfNt52g4ReE9Ge86o+L+EBOBgZm634L5Z/i6pq908mXBAklPdk1ERdEgWONaOeYYmB70FToplR1gINJEF2CnfAtD/wV+DuQFPDth+EWHqhe3a4xO0d9eJ55ou2QCYOPUC2g/qz1sp7GR74W7P5IWJdmnUEuPFsKJ6OvM+1V8S06jZGDa/QhUGDK8F3G/TMP09W1MsrlQTRr3YQ5H43+pMY7I6Jysze+X9OKZZTTpv4GmYm1USjmraGyMuPF3j9hrlmpttK+1gg2WzytCJO44YsZp9ckls8JNK4bT5uwTuomKZoRgmiIOTcMh4VP7V28TWj2XdF+T6rBFILTvQyXMOzvbe1kLwg2O31JDBdJ8X1fHCYJxKsIrYCSDPz4sha8h7QmHrCSFmjoXb+LUElnbLXZVRkY5/Dc73EM6Es3wAgjwSJK2asRqdqU0PhbS5qpIlgYKsNcb+Wes</OrderData>
17
- </DataTransfer>
18
- <ReturnCode authenticate="true">091116</ReturnCode>
19
- <TimestampBankParameter authenticate="true">2009-06-16T17:56:05.698+02:00</TimestampBankParameter>
20
- </body>
21
- </ebicsKeyManagementResponse>
1
+ <ebics:ebicsKeyManagementResponse xmlns:ebics="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_keymgmt_response_H004.xsd">
2
+ <ebics:header authenticate="true">
3
+ <ebics:static />
4
+ <ebics:mutable>
5
+ <ebics:ReturnCode>000000</ebics:ReturnCode>
6
+ <ebics:ReportText>[EBICS_OK] OK</ebics:ReportText>
7
+ </ebics:mutable>
8
+ </ebics:header>
9
+ <ebics:body>
10
+ <ebics:DataTransfer>
11
+ <ebics:DataEncryptionInfo authenticate="true">
12
+ <ebics:EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">rwIxSUJAVEFDQ0sdYe+CybdspMllDG6ArNtdCzUbT1E=</ebics:EncryptionPubKeyDigest>
13
+ <ebics:TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</ebics:TransactionKey>
14
+ </ebics:DataEncryptionInfo>
15
+ <ebics:OrderData>lJ/v1HvOYAZKTPkxULH4mOcUy01+EaAsxLzCPhtieAo9m5AtU5URdyBVfmclHbtWe3ELb02lR37bChynq0Esqpljxx7CiB+kl/bVs7XkNQQmtGPlh08O7ApJ7AHdKPFFvE+SM2OWpSwUrqJGtmyaU6s+RM66o/3Q0wvKi4y3+Q2jm8nkiWZpPfNt52g4ReE9Ge86o+L+EBOBgZm634L5Z/i6pq908mXBAklPdk1ERdEgWONaOeYYmB70FToplR1gINJEF2CnfAtD/wV+DuQFPDth+EWHqhe3a4xO0d9eJ55ou2QCYOPUC2g/qz1sp7GR74W7P5IWJdmnUEuPFsKJ6OvM+1V8S06jZGDa/QhUGDK8F3G/TMP09W1MsrlQTRr3YQ5H43+pMY7I6Jysze+X9OKZZTTpv4GmYm1USjmraGyMuPF3j9hrlmpttK+1gg2WzytCJO44YsZp9ckls8JNK4bT5uwTuomKZoRgmiIOTcMh4VP7V28TWj2XdF+T6rBFILTvQyXMOzvbe1kLwg2O31JDBdJ8X1fHCYJxKsIrYCSDPz4sha8h7QmHrCSFmjoXb+LUElnbLXZVRkY5/Dc73EM6Es3wAgjwSJK2asRqdqU0PhbS5qpIlgYKsNcb+Wes</ebics:OrderData>
16
+ </ebics:DataTransfer>
17
+ <ebics:ReturnCode authenticate="true">091116</ebics:ReturnCode>
18
+ <ebics:TimestampBankParameter authenticate="true">2007-10-19T14:58:39.467Z</ebics:TimestampBankParameter>
19
+ </ebics:body>
20
+ </ebics:ebicsKeyManagementResponse>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ebicsKeyManagementResponse xmlns="http://www.ebics.org/H003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H003" xsi:schemaLocation="http://www.ebics.org/H003 http://www.ebics.org/H003/ebics_keymgmt_response.xsd">
2
+ <ebicsKeyManagementResponse xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_keymgmt_response_H004.xsd">
3
3
  <header authenticate="true">
4
4
  <static/>
5
5
  <mutable>
@@ -9,4 +9,4 @@
9
9
  </header>
10
10
  <body>
11
11
  </body>
12
- </ebicsKeyManagementResponse>
12
+ </ebicsKeyManagementResponse>
@@ -0,0 +1,20 @@
1
+ <ebics:bicsKeyManagementResponse xmlns:ebics="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_keymgmt_response_H004.xsd">
2
+ <ebics:header authenticate="true">
3
+ <ebics:static />
4
+ <ebics:mutable>
5
+ <ebics:ReturnCode>000000</ebics:ReturnCode>
6
+ <ebics:ReportText>[EBICS_OK] OK</ebics:ReportText>
7
+ </ebics:mutable>
8
+ </ebics:header>
9
+ <ebics:body>
10
+ <ebics:DataTransfer>
11
+ <ebics:DataEncryptionInfo authenticate="true">
12
+ <ebics:EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">rwIxSUJAVEFDQ0sdYe+CybdspMllDG6ArNtdCzUbT1E=</ebics:EncryptionPubKeyDigest>
13
+ <ebics:TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</ebics:TransactionKey>
14
+ </ebics:DataEncryptionInfo>
15
+ <ebics:OrderData>tPp8sZbGSkjaUy4IoNektKEK1KekTQxLwIZ+AYhyuL99erg26xK1ZcvXd+vJwSfl5TV21qQHybID5CnnP5ZvjcxBdwrK0hyMyp2FYJAY16wLAt++Esydx55XSBvutQASBEnPd01uq3Gd4tPLLbrlBGCDEtqJcfbLEOyWvxYFNDb/HU6RpOCD7JN3jL+LRLsFfrZEK96QO8IzpCtiAYBJ6C3OaHsETt0wBx1lYy7JBSw+nIEEzE6+N3EjJjE3++9BfCDE0ca7kpWCSJ666dUuelPuIS45LjcFbTGROdZ1BTJc6F39Zjxud2yUJIEJINQUZA2O8628gVi2GvoUZuILFx1TsCik1T2ims7EVqkfSNEBpKCa3mtmNMEFepdXNTBm3Kf+J+5ATnqq1EJrYBkGpDPii4jgvVPNIkXJlx5DqqhgUUCShnCLOingwrE+z5ekRM5091iHl1C4APfR05gl0Q81D5HiV9m4CuMjx4Lp7mm0vdgP1LNiaA1BnKIeFob+4SN4Kv7AoP7nxk+3nINMd0yGujsnMx6WgGFn4lvv7IH250+LUZJM4rkdVx9FacxU+P+B6+GDHpLKZyT84WKvPXWnoIhPpykR/Pbysoe+WdAf7cMVp9K5Q5QhfPaMu2eIZjR5+IRIUXxhTo8k2vDG4XBcjgVygP5GJAN83pjXuwdo5JRxyGZAOqvBr7cHmmCG</ebics:OrderData>
16
+ </ebics:DataTransfer>
17
+ <ebics:ReturnCode authenticate="true">000000</ebics:ReturnCode>
18
+ <ebics:TimestampBankParameter authenticate="true">2007-10-19T14:58:39.467Z</ebics:TimestampBankParameter>
19
+ </ebics:body>
20
+ </ebics:ebicsKeyManagementResponse>
@@ -1,11 +1,12 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <HPBResponseOrderData xmlns="http://www.ebics.org/H003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="http://www.ebics.org/H003 http://www.ebics.org/H003/ebics_orders.xsd">
2
+ <HPBResponseOrderData xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="http://www.ebics.org/H003 http://www.ebics.org/H003/ebics_orders.xsd">
3
3
  <AuthenticationPubKeyInfo>
4
4
  <PubKeyValue>
5
5
  <ds:RSAKeyValue>
6
6
  <ds:Modulus>AJ2/0OoIZydb9sgKbiwqDcwA0NtcUMIYi6GK7PqoRszu1uytGnxJjQhGt62kMslWvLgebUSwdq/T3YyGsa3KQeIGaUUn9iqyu3BoNOMdo2DLN4NdGMY1WR/HbYRKR3JHyURhTBKw27KScRRdKGl6jY+VcXcTKJL8PjXMQH5cD6Gz</ds:Modulus>
7
7
  <ds:Exponent>AQAB</ds:Exponent>
8
8
  </ds:RSAKeyValue>
9
+ <TimeStamp>2007-03-13T11:33:16.616Z</TimeStamp>
9
10
  </PubKeyValue>
10
11
  <AuthenticationVersion>X002</AuthenticationVersion>
11
12
  </AuthenticationPubKeyInfo>
@@ -15,8 +16,9 @@
15
16
  <ds:Modulus>AJ2/0OoIZydb9sgKbiwqDcwA0NtcUMIYi6GK7PqoRszu1uytGnxJjQhGt62kMslWvLgebUSwdq/T3YyGsa3KQeIGaUUn9iqyu3BoNOMdo2DLN4NdGMY1WR/HbYRKR3JHyURhTBKw27KScRRdKGl6jY+VcXcTKJL8PjXMQH5cD6Gz</ds:Modulus>
16
17
  <ds:Exponent>AQAB</ds:Exponent>
17
18
  </ds:RSAKeyValue>
19
+ <TimeStamp>2007-03-13T11:33:16.616Z</TimeStamp>
18
20
  </PubKeyValue>
19
21
  <EncryptionVersion>E002</EncryptionVersion>
20
22
  </EncryptionPubKeyInfo>
21
23
  <HostID>SIZBN001</HostID>
22
- </HPBResponseOrderData>
24
+ </HPBResponseOrderData>
@@ -0,0 +1,13 @@
1
+ <h004:ebicsKeyManagementResponse xmlns:h004="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:ebics:H004 ebics_H004.xsd" Version="H004" Revision="1">
2
+ <h004:header authenticate="true">
3
+ <h004:static />
4
+ <h004:mutable>
5
+ <h004:OrderID>B004</h004:OrderID>
6
+ <h004:ReturnCode>000000</h004:ReturnCode>
7
+ <h004:ReportText>[EBICS_OK] OK</h004:ReportText>
8
+ </h004:mutable>
9
+ </h004:header>
10
+ <h004:body>
11
+ <h004:ReturnCode authenticate="true">000000</h004:ReturnCode>
12
+ </h004:body>
13
+ </h004:ebicsKeyManagementResponse>
@@ -28,4 +28,4 @@
28
28
  <ReturnCode authenticate="true">000000</ReturnCode>
29
29
  <TimestampBankParameter authenticate="true">2009-06-16T17:56:05.698+02:00</TimestampBankParameter>
30
30
  </body>
31
- </ebicsResponse>
31
+ </ebicsResponse>
@@ -5,7 +5,7 @@ RSpec.describe Epics::ParseEbics do
5
5
  builder.adapter :test, Faraday::Adapter::Test::Stubs.new do |stub|
6
6
  stub.post('/business_nok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'ebics_business_nok.xml') ) ]}
7
7
  stub.post('/technical_nok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'ebics_technical_nok.xml') ) ]}
8
- stub.post('/ok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'hpb_response.xml') ) ]}
8
+ stub.post('/ok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'hpb_response_ebics_ns.xml') ) ]}
9
9
  end
10
10
  builder.use Epics::ParseEbics
11
11
  end
@@ -10,6 +10,22 @@ RSpec.describe Epics::Response do
10
10
  end
11
11
  end
12
12
 
13
+ describe '#technical_code' do
14
+ let(:ebics_response) { File.read('spec/fixtures/xml/ini_response_h004_ns.xml') }
15
+
16
+ it 'is extracted from the response' do
17
+ expect(subject.technical_code).to eq("000000")
18
+ end
19
+ end
20
+
21
+ describe '#business_code' do
22
+ let(:ebics_response) { File.read('spec/fixtures/xml/ebics_business_nok.xml') }
23
+
24
+ it 'is extracted from the response' do
25
+ expect(subject.business_code).to eq("091116")
26
+ end
27
+ end
28
+
13
29
  describe '#signature_valid?' do
14
30
  let(:ebics_response) { File.read('spec/fixtures/xml/upload_init_response.xml') }
15
31
 
@@ -19,7 +35,7 @@ RSpec.describe Epics::Response do
19
35
  end
20
36
 
21
37
  describe '#public_digest_valid?' do
22
- let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response.xml') }
38
+ let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response_ebics_ns.xml') }
23
39
 
24
40
  it "checks if //xmlns:EncryptionPubKeyDigest matches the user encryption key" do
25
41
  expect(subject.public_digest_valid?).to be(true)
@@ -27,7 +43,7 @@ RSpec.describe Epics::Response do
27
43
  end
28
44
 
29
45
  describe 'order_data' do
30
- let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response.xml') }
46
+ let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response_ebics_ns.xml') }
31
47
  let(:order_data) { File.read('spec/fixtures/xml/hpb_response_order.xml') }
32
48
 
33
49
  it "retrieves the decrypted order data" do
@@ -35,6 +51,13 @@ RSpec.describe Epics::Response do
35
51
  end
36
52
  end
37
53
 
54
+ describe '#report_text' do
55
+ let(:ebics_response) { File.read('spec/fixtures/xml/sta_response.xml') }
56
+ it 'pulls the report_text from the response' do
57
+ expect(subject.report_text).to eq('[EBICS_OK] OK')
58
+ end
59
+ end
60
+
38
61
  describe '#transaction_id' do
39
62
  let(:ebics_response) { File.read('spec/fixtures/xml/sta_response.xml') }
40
63
  it 'pulls the transaction_id from the response' do
@@ -42,6 +65,13 @@ RSpec.describe Epics::Response do
42
65
  end
43
66
  end
44
67
 
68
+ describe '#order_id' do
69
+ let(:ebics_response) { File.read('spec/fixtures/xml/cd1_init_response.xml') }
70
+ it 'pulls the order_id from the response' do
71
+ expect(subject.order_id).to eq('N00L')
72
+ end
73
+ end
74
+
45
75
  describe '#last_segment?' do
46
76
  describe 'when its the last segement' do
47
77
  let(:ebics_response) { File.read('spec/fixtures/xml/sta_response.xml') }
@@ -69,7 +99,7 @@ RSpec.describe Epics::Response do
69
99
  end
70
100
 
71
101
  describe 'when the response is not segemnted' do
72
- let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response.xml') }
102
+ let(:ebics_response) { File.read('spec/fixtures/xml/hpb_response_ebics_ns.xml') }
73
103
 
74
104
  it 'will be false' do
75
105
  expect(subject.segmented?).to be(false)
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: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2015-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -224,11 +224,12 @@ files:
224
224
  - spec/fixtures/xml/hia_request_order_data.xml
225
225
  - spec/fixtures/xml/hpb.xml
226
226
  - spec/fixtures/xml/hpb_request.xml
227
- - spec/fixtures/xml/hpb_response.xml
227
+ - spec/fixtures/xml/hpb_response_ebics_ns.xml
228
228
  - spec/fixtures/xml/hpb_response_order.xml
229
229
  - spec/fixtures/xml/hpb_response_order_without_ns.xml
230
230
  - spec/fixtures/xml/htd_order_data.xml
231
231
  - spec/fixtures/xml/ini.xml
232
+ - spec/fixtures/xml/ini_response_h004_ns.xml
232
233
  - spec/fixtures/xml/signature_pub_key_order_data.xml
233
234
  - spec/fixtures/xml/sta_response.xml
234
235
  - spec/fixtures/xml/sta_response_continued.xml
@@ -294,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
295
  version: '0'
295
296
  requirements: []
296
297
  rubyforge_project:
297
- rubygems_version: 2.4.5
298
+ rubygems_version: 2.4.8
298
299
  signing_key:
299
300
  specification_version: 4
300
301
  summary: a ruby implementation of the EBICS protocol
@@ -317,11 +318,12 @@ test_files:
317
318
  - spec/fixtures/xml/hia_request_order_data.xml
318
319
  - spec/fixtures/xml/hpb.xml
319
320
  - spec/fixtures/xml/hpb_request.xml
320
- - spec/fixtures/xml/hpb_response.xml
321
+ - spec/fixtures/xml/hpb_response_ebics_ns.xml
321
322
  - spec/fixtures/xml/hpb_response_order.xml
322
323
  - spec/fixtures/xml/hpb_response_order_without_ns.xml
323
324
  - spec/fixtures/xml/htd_order_data.xml
324
325
  - spec/fixtures/xml/ini.xml
326
+ - spec/fixtures/xml/ini_response_h004_ns.xml
325
327
  - spec/fixtures/xml/signature_pub_key_order_data.xml
326
328
  - spec/fixtures/xml/sta_response.xml
327
329
  - spec/fixtures/xml/sta_response_continued.xml
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ebicsKeyManagementResponse xmlns="http://www.ebics.org/H003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H003" xsi:schemaLocation="http://www.ebics.org/H003 http://www.ebics.org/H003/ebics_keymgmt_response.xsd">
3
- <header authenticate="true">
4
- <static/>
5
- <mutable>
6
- <ReturnCode>000000</ReturnCode>
7
- <ReportText>[EBICS_OK] OK</ReportText>
8
- </mutable>
9
- </header>
10
- <body>
11
- <DataTransfer>
12
- <DataEncryptionInfo authenticate="true">
13
- <EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">rwIxSUJAVEFDQ0sdYe+CybdspMllDG6ArNtdCzUbT1E=</EncryptionPubKeyDigest>
14
- <TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</TransactionKey>
15
- </DataEncryptionInfo>
16
- <OrderData>lJ/v1HvOYAZKTPkxULH4mOcUy01+EaAsxLzCPhtieAo9m5AtU5URdyBVfmclHbtWe3ELb02lR37bChynq0Esqpljxx7CiB+kl/bVs7XkNQQmtGPlh08O7ApJ7AHdKPFFvE+SM2OWpSwUrqJGtmyaU6s+RM66o/3Q0wvKi4y3+Q2jm8nkiWZpPfNt52g4ReE9Ge86o+L+EBOBgZm634L5Z/i6pq908mXBAklPdk1ERdEgWONaOeYYmB70FToplR1gINJEF2CnfAtD/wV+DuQFPDth+EWHqhe3a4xO0d9eJ55ou2QCYOPUC2g/qz1sp7GR74W7P5IWJdmnUEuPFsKJ6OvM+1V8S06jZGDa/QhUGDK8F3G/TMP09W1MsrlQTRr3YQ5H43+pMY7I6Jysze+X9OKZZTTpv4GmYm1USjmraGyMuPF3j9hrlmpttK+1gg2WzytCJO44YsZp9ckls8JNK4bT5uwTuomKZoRgmiIOTcMh4VP7V28TWj2XdF+T6rBFILTvQyXMOzvbe1kLwg2O31JDBdJ8X1fHCYJxKsIrYCSDPz4sha8h7QmHrCSFmjoXb+LUElnbLXZVRkY5/Dc73EM6Es3wAgjwSJK2asRqdqU0PhbS5qpIlgYKsNcb+Wes</OrderData>
17
- </DataTransfer>
18
- <ReturnCode authenticate="true">000000</ReturnCode>
19
- <TimestampBankParameter authenticate="true">2009-06-16T17:56:05.698+02:00</TimestampBankParameter>
20
- </body>
21
- </ebicsKeyManagementResponse>