epics 1.2.1 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41b020d68ab3a469b61510ceefbfa55ca6c4b81c
4
- data.tar.gz: 83d711b4f1b54469346cc8216af50cccde41523e
3
+ metadata.gz: d148b60ba07e4c81dbfcc0ddcb3d7263b2f74be2
4
+ data.tar.gz: 35b69cb5ef7f143f5d92974f47adfe4206cecbea
5
5
  SHA512:
6
- metadata.gz: 72dec5d67b597746b327bd6a7c79943d1089b1be440565c8e28b98d71909aed5f67c958069e46916f8d8f3964558f69a73e5c6ea0e51248d4da7515c16fd899a
7
- data.tar.gz: 45dba2eb8ca8facfb44d4a26d8b1395c797a8e7865277767539044e91e54ce85afc9b1aff45461e3d56c89c4b9e2b73c85d3bf19394f53e942b31d264a845f10
6
+ metadata.gz: 838a5d4be65b6339238dd6bc2f7f918c3b58ec2563e33b02fa21a9bc741e2636e4b2f94ad75f6e16a261aed43a3666300f1e088ebfbbed74a42228584d44c30d
7
+ data.tar.gz: 80d7a32a587947ad7a73ae525f2cacabffa4fc44a478d42194acfad92e7cd990719db28d94329a3d3457fc7b8b83ea8d6e66657fc1be487ac791b09da352e70b
@@ -1,3 +1,15 @@
1
+ ### 1.2.2
2
+
3
+ * [BUGFIX] HPB namespaces are unpredictable so be ignore them
4
+
5
+ ### 1.2.1
6
+
7
+ * [BUGFIX] fixing wrong variable bind within `credit`, `debit` and `statements`
8
+
9
+ ### 1.2.0
10
+
11
+ * [ENHANCEMENT] uploads will return both ebics_order_id and ebics_transaction_id
12
+
1
13
  ### 1.1.2
2
14
 
3
15
  * [BUGFIX] missing require statements for `zlib`
@@ -19,4 +31,4 @@
19
31
 
20
32
  ### 1.0.0
21
33
 
22
- * first release
34
+ * first release
data/README.md CHANGED
@@ -200,10 +200,10 @@ Besides EBCIS being a standard, some server implementations are slighty differen
200
200
  Is Epics working with your institution?
201
201
  Please help us to grow this list of supported banks:
202
202
 
203
- * Sofortbank
203
+ * Handelsbank
204
204
  * Deutsche Bank
205
205
  * Sparkasse KölnBonn
206
-
206
+ * Commerz Bank
207
207
 
208
208
  ## Links
209
209
 
@@ -29,6 +29,7 @@ require "epics/hac"
29
29
  require "epics/hpd"
30
30
  require "epics/cd1"
31
31
  require "epics/cct"
32
+ require "epics/cdb"
32
33
  require "epics/cdd"
33
34
  require "epics/hia"
34
35
  require "epics/ini"
@@ -0,0 +1,42 @@
1
+ class Epics::CDB < Epics::GenericUploadRequest
2
+
3
+ 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" => "CDD",
18
+ "OrderAttribute" => "OZHNN",
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
31
+ }
32
+ },
33
+ "SecurityMedium" => "0000",
34
+ "NumSegments" => 1
35
+ },
36
+ "mutable" => {
37
+ "TransactionPhase" => "Initialisation"
38
+ }
39
+ }
40
+ end
41
+
42
+ end
@@ -98,8 +98,8 @@ class Epics::Client
98
98
  Nokogiri::XML(download(Epics::HPB)).xpath("//xmlns:PubKeyValue").each do |node|
99
99
  type = node.parent.last_element_child.content
100
100
 
101
- modulus = Base64.decode64(node.at_xpath(".//ds:Modulus").content)
102
- exponent = Base64.decode64(node.at_xpath(".//ds:Exponent").content)
101
+ modulus = Base64.decode64(node.at_xpath(".//*[local-name() = 'Modulus']").content)
102
+ exponent = Base64.decode64(node.at_xpath(".//*[local-name() = 'Exponent']").content)
103
103
 
104
104
  bank = OpenSSL::PKey::RSA.new
105
105
  bank.n = OpenSSL::BN.new(modulus, 2)
@@ -1,3 +1,3 @@
1
1
  module Epics
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -61,6 +61,10 @@ RSpec.describe Epics::Client do
61
61
  end
62
62
 
63
63
  describe '#HPB' do
64
+ let(:e_key) do
65
+ Epics::Key.new(OpenSSL::PKey::RSA.new(File.read(File.join(File.dirname(__FILE__), 'fixtures', 'bank_e.pem'))))
66
+ end
67
+
64
68
  before do
65
69
  stub_request(:post, "https://194.180.18.30/ebicsweb/ebicsweb")
66
70
  .with(:body => %r[<?xml(.*)ebicsNoPubKeyDigestsRequest>])
@@ -75,15 +79,24 @@ RSpec.describe Epics::Client do
75
79
  end
76
80
 
77
81
  describe 'crypto' do
78
- let(:e_key) do
79
- Epics::Key.new(OpenSSL::PKey::RSA.new(File.read(File.join(File.dirname(__FILE__), 'fixtures', 'bank_e.pem'))))
80
- end
81
82
 
82
83
  before { subject.HPB }
83
84
 
84
85
  it { expect(subject.keys["SIZBN001.E002"].public_digest).to eq(e_key.public_digest) }
85
86
  it { expect(subject.keys["SIZBN001.X002"].public_digest).to eq(e_key.public_digest) }
86
87
  end
88
+
89
+ describe 'when order data wont include namesspaces' do
90
+ before do
91
+ allow(subject).to receive(:download).with(Epics::HPB).and_return(File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'hpb_response_order_without_ns.xml')))
92
+
93
+ subject.HPB
94
+ end
95
+
96
+ it { expect(subject.keys["SIZBN001.E002"].public_digest).to eq(e_key.public_digest) }
97
+ it { expect(subject.keys["SIZBN001.X002"].public_digest).to eq(e_key.public_digest) }
98
+
99
+ end
87
100
  end
88
101
 
89
102
  describe '#CD1' do
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <HPBResponseOrderData xmlns="urn:org:ebics:H004">
3
+ <AuthenticationPubKeyInfo>
4
+ <PubKeyValue>
5
+ <RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
6
+ <Modulus>AJ2/0OoIZydb9sgKbiwqDcwA0NtcUMIYi6GK7PqoRszu1uytGnxJjQhGt62kMslWvLgebUSwdq/T3YyGsa3KQeIGaUUn9iqyu3BoNOMdo2DLN4NdGMY1WR/HbYRKR3JHyURhTBKw27KScRRdKGl6jY+VcXcTKJL8PjXMQH5cD6Gz</Modulus>
7
+ <Exponent>AQAB</Exponent>
8
+ </RSAKeyValue>
9
+ <TimeStamp>2007-03-13T11:33:16.616Z</TimeStamp>
10
+ </PubKeyValue>
11
+ <AuthenticationVersion>X002</AuthenticationVersion>
12
+ </AuthenticationPubKeyInfo>
13
+ <EncryptionPubKeyInfo>
14
+ <PubKeyValue>
15
+ <RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
16
+ <Modulus>AJ2/0OoIZydb9sgKbiwqDcwA0NtcUMIYi6GK7PqoRszu1uytGnxJjQhGt62kMslWvLgebUSwdq/T3YyGsa3KQeIGaUUn9iqyu3BoNOMdo2DLN4NdGMY1WR/HbYRKR3JHyURhTBKw27KScRRdKGl6jY+VcXcTKJL8PjXMQH5cD6Gz</Modulus>
17
+ <Exponent>AQAB</Exponent>
18
+ </RSAKeyValue>
19
+ <TimeStamp>2007-03-13T11:33:16.682Z</TimeStamp>
20
+ </PubKeyValue>
21
+ <EncryptionVersion>E002</EncryptionVersion>
22
+ </EncryptionPubKeyInfo>
23
+ <HostID>SIZBN001</HostID>
24
+ </HPBResponseOrderData>
@@ -0,0 +1,17 @@
1
+ RSpec.describe Epics::CDB 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
+ let(:document) { File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'cd1.xml') ) }
5
+ subject { described_class.new(client, document) }
6
+
7
+ describe '#to_xml' do
8
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
9
+ end
10
+
11
+ describe '#to_transfer_xml' do
12
+ before { subject.transaction_id = SecureRandom.hex(16) }
13
+
14
+ specify { expect(subject.to_transfer_xml).to be_a_valid_ebics_doc }
15
+ end
16
+
17
+ 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: 1.2.1
4
+ version: 1.2.2
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-04-16 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -168,6 +168,7 @@ files:
168
168
  - lib/epics/c53.rb
169
169
  - lib/epics/cct.rb
170
170
  - lib/epics/cd1.rb
171
+ - lib/epics/cdb.rb
171
172
  - lib/epics/cdd.rb
172
173
  - lib/epics/client.rb
173
174
  - lib/epics/error.rb
@@ -210,6 +211,7 @@ files:
210
211
  - spec/fixtures/xml/hpb_request.xml
211
212
  - spec/fixtures/xml/hpb_response.xml
212
213
  - spec/fixtures/xml/hpb_response_order.xml
214
+ - spec/fixtures/xml/hpb_response_order_without_ns.xml
213
215
  - spec/fixtures/xml/htd_order_data.xml
214
216
  - spec/fixtures/xml/ini.xml
215
217
  - spec/fixtures/xml/signature_pub_key_order_data.xml
@@ -225,6 +227,7 @@ files:
225
227
  - spec/orders/c53_spec.rb
226
228
  - spec/orders/cct_spec.rb
227
229
  - spec/orders/cd1_spec.rb
230
+ - spec/orders/cdb_spec.rb
228
231
  - spec/orders/cdd_spec.rb
229
232
  - spec/orders/haa_spec.rb
230
233
  - spec/orders/hac_spec.rb
@@ -300,6 +303,7 @@ test_files:
300
303
  - spec/fixtures/xml/hpb_request.xml
301
304
  - spec/fixtures/xml/hpb_response.xml
302
305
  - spec/fixtures/xml/hpb_response_order.xml
306
+ - spec/fixtures/xml/hpb_response_order_without_ns.xml
303
307
  - spec/fixtures/xml/htd_order_data.xml
304
308
  - spec/fixtures/xml/ini.xml
305
309
  - spec/fixtures/xml/signature_pub_key_order_data.xml
@@ -315,6 +319,7 @@ test_files:
315
319
  - spec/orders/c53_spec.rb
316
320
  - spec/orders/cct_spec.rb
317
321
  - spec/orders/cd1_spec.rb
322
+ - spec/orders/cdb_spec.rb
318
323
  - spec/orders/cdd_spec.rb
319
324
  - spec/orders/haa_spec.rb
320
325
  - spec/orders/hac_spec.rb