epics 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MmNhM2QwYzllMzkwNTQ2Y2FmYjdiZjJmOWFjZjBiNzE2YmMyMGY0Mg==
5
- data.tar.gz: !binary |-
6
- NmM3M2NmM2VmYzczZTczN2JhZWI1ZWQ5NmVmYjRiMDg4ZmIyNmFkMw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YTQwMWUwY2QwMGUwNGM1MmEyZGJiNWQyNTQxNjE0NjQ1NzJhZWI1N2ViODhk
10
- NTQ3MTYxNzM5OTI0NWEyMTkxZjNiNTIxZTczMDY3MTg3NDg2MmI4NWNjNjQw
11
- NDY3YTRjYjNlZWRiYzUxYmU4MzA3MTZlNzIwYTlkM2I5NGRkODk=
12
- data.tar.gz: !binary |-
13
- NDk5NmUxNTdhZmUxOGU2ZThlZmQ0OThmOTU4ZWRhODVmYTIxN2FkMzQxMWNk
14
- YzMzYTMwNWU3MGRlYmJlY2UxZWI1YjQ4ZTUwOWI1YWE4ZGMwN2YwYTc2NjVh
15
- YTg5MGNhODNkNTJkYmFlNmE1YWViYTQ1YzhmNDQ4ZTVhMjNkZjM=
2
+ SHA1:
3
+ metadata.gz: 47f60779a03a8ee010aa6c71e0364d91982a83cb
4
+ data.tar.gz: 079f9e151bdd007bbe4c904110101fc27869cfdb
5
+ SHA512:
6
+ metadata.gz: 8b1da1c995a9a58a3a7c96c035897873429852b22f859c100d2628b5956417a815d7ee53bc6f560e93c1a1f97176ff3a85d0472f0c7bceec3f06b27300fdc25e
7
+ data.tar.gz: db9c24e794987263851160a296fcaf134cdd3c51df6ba82e867cf964572b381025e14e106139e4d2a14392e76438433ccb5126e49022f18f7af9917ba0b51cdb
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  EPICS is a ruby implementation of the [EBICS](http://www.ebics.org/) (Electronic Banking Internet Communication Standard)
7
7
 
8
- The client support the complete initialization process comprising INI, HIA and HPB including the INI letter generation. It offers support for the most common download and upload order types (STA HAA HTD HPD PKT HAC HKD C52 C53 CD1 CDD CCT)
8
+ The client supports the complete initialization process comprising INI, HIA and HPB including the INI letter generation. It offers support for the most common download and upload order types (STA HAA HTD HPD PKT HAC HKD C52 C53 CD1 CDD CCT)
9
9
 
10
10
 
11
11
  ## Installation
data/lib/epics/client.rb CHANGED
@@ -176,7 +176,7 @@ class Epics::Client
176
176
 
177
177
  res = post(url, order.to_transfer_xml).body
178
178
 
179
- res.transaction_id
179
+ return res.transaction_id, res.order_id
180
180
  end
181
181
 
182
182
  def download(order_type, *args)
@@ -49,6 +49,10 @@ class Epics::Response
49
49
  doc.xpath("//xmlns:header/xmlns:static/xmlns:TransactionID").text
50
50
  end
51
51
 
52
+ def order_id
53
+ doc.xpath("//xmlns:header/xmlns:mutable/xmlns:OrderID").text
54
+ end
55
+
52
56
  def digest_valid?
53
57
  authenticated = doc.xpath("//*[@authenticate='true']").map(&:canonicalize).join
54
58
  digest_value = doc.xpath("//ds:DigestValue").first
data/lib/epics/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Epics
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -86,6 +86,20 @@ RSpec.describe Epics::Client do
86
86
  end
87
87
  end
88
88
 
89
+ describe '#CD1' do
90
+ let(:cd1_document) { File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'cd1.xml')) }
91
+ before do
92
+ stub_request(:post, "https://194.180.18.30/ebicsweb/ebicsweb")
93
+ .with(:body => %r[<TransactionPhase>Initialisation</TransactionPhase>])
94
+ .to_return(status: 200, body: File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'cd1_init_response.xml')))
95
+ stub_request(:post, "https://194.180.18.30/ebicsweb/ebicsweb")
96
+ .with(:body => %r[<TransactionPhase>Transfer</TransactionPhase>])
97
+ .to_return(status: 200, body: File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'cd1_transfer_response.xml')))
98
+ end
99
+
100
+ it { expect(subject.CD1(cd1_document)).to eq(["387B7BE88FE33B0F4B60AC64A63F18E2","N00L"]) }
101
+ end
102
+
89
103
  describe '#HTD' do
90
104
  before do
91
105
  allow(subject).to receive(:download).and_return( File.read(File.join(File.dirname(__FILE__), 'fixtures', 'xml', 'htd_order_data.xml')))
@@ -0,0 +1,31 @@
1
+ <ebicsResponse Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_response_H004.xsd" xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
2
+ <header authenticate="true">
3
+ <static>
4
+ <TransactionID>387B7BE88FE33B0F4B60AC64A63F18E2</TransactionID>
5
+ </static>
6
+ <mutable>
7
+ <TransactionPhase>Initialisation</TransactionPhase>
8
+ <OrderID>N00L</OrderID>
9
+ <ReturnCode>000000</ReturnCode>
10
+ <ReportText>[EBICS_OK] OK</ReportText>
11
+ </mutable>
12
+ </header>
13
+ <AuthSignature>
14
+ <ds:SignedInfo>
15
+ <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
16
+ <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
17
+ <ds:Reference URI="#xpointer(//*[@authenticate='true'])">
18
+ <ds:Transforms>
19
+ <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
20
+ </ds:Transforms>
21
+ <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
22
+ <ds:DigestValue>hSf/fZURBW6ihKUUZDMRpqc3kloVZZRjw+DTBxjS7AM=</ds:DigestValue>
23
+ </ds:Reference>
24
+ </ds:SignedInfo>
25
+ <ds:SignatureValue>IFHzo6jch33gA0Ovxh4VWtAwJOJRdxffMy7Yi+a+UUWPM/ekNqcewCWxgjbcWgD/LiH6eQc58iKcZdNKpaKfplQ09CJi1VBry5sd97i4tlCAhoM95JTrJjp2O6PhswAo+a6dpuXmA11u57BK0/nHENMIh4+Qw3aGszn21Ft8qwo=</ds:SignatureValue>
26
+ </AuthSignature>
27
+ <body>
28
+ <ReturnCode authenticate="true">000000</ReturnCode>
29
+ <TimestampBankParameter authenticate="true">2007-10-19T14:58:39.467Z</TimestampBankParameter>
30
+ </body>
31
+ </ebicsResponse>
@@ -0,0 +1,32 @@
1
+ <ebicsResponse Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_response_H004.xsd" xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
2
+ <header authenticate="true">
3
+ <static>
4
+ <TransactionID>387B7BE88FE33B0F4B60AC64A63F18E2</TransactionID>
5
+ </static>
6
+ <mutable>
7
+ <TransactionPhase>Transfer</TransactionPhase>
8
+ <SegmentNumber lastSegment="true">1</SegmentNumber>
9
+ <OrderID>N00L</OrderID>
10
+ <ReturnCode>000000</ReturnCode>
11
+ <ReportText>[EBICS_OK] OK</ReportText>
12
+ </mutable>
13
+ </header>
14
+ <AuthSignature>
15
+ <ds:SignedInfo>
16
+ <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
17
+ <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
18
+ <ds:Reference URI="#xpointer(//*[@authenticate='true'])">
19
+ <ds:Transforms>
20
+ <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
21
+ </ds:Transforms>
22
+ <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
23
+ <ds:DigestValue></ds:DigestValue>
24
+ </ds:Reference>
25
+ </ds:SignedInfo>
26
+ <ds:SignatureValue></ds:SignatureValue>
27
+ </AuthSignature>
28
+ <body>
29
+ <ReturnCode authenticate="true">000000</ReturnCode>
30
+ <TimestampBankParameter authenticate="true">2007-10-19T14:58:39.467Z</TimestampBankParameter>
31
+ </body>
32
+ </ebicsResponse>
metadata CHANGED
@@ -1,155 +1,161 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.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: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gyoku
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.6.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.6.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: equivalent-xml
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description: ! " Epics is a ruby implementation of the EBIC standard (H004)\n\n
140
- \ It supports the complete initialization process comprising INI, HIA and HPB\n
141
- \ including the INI letter generation.\n\n Furthermore it offers support for
142
- the most common download types:\n STA HAA HTD HPD PKT HAC HKD C52 C53\n\n And
143
- the following upload orders:\n CD1 CDD CCT\n"
139
+ description: |2
140
+ Epics is a ruby implementation of the EBIC standard (H004)
141
+
142
+ It supports the complete initialization process comprising INI, HIA and HPB
143
+ including the INI letter generation.
144
+
145
+ Furthermore it offers support for the most common download types:
146
+ STA HAA HTD HPD PKT HAC HKD C52 C53
147
+
148
+ And the following upload orders:
149
+ CD1 CDD CCT
144
150
  email:
145
151
  - lars@railslove.com
146
152
  executables: []
147
153
  extensions: []
148
154
  extra_rdoc_files: []
149
155
  files:
150
- - .gitignore
151
- - .rspec
152
- - .travis.yml
156
+ - ".gitignore"
157
+ - ".rspec"
158
+ - ".travis.yml"
153
159
  - CHANGELOG.md
154
160
  - CONTRIBUTING.md
155
161
  - Gemfile
@@ -194,6 +200,8 @@ files:
194
200
  - spec/fixtures/e002.pem
195
201
  - spec/fixtures/x002.pem
196
202
  - spec/fixtures/xml/cd1.xml
203
+ - spec/fixtures/xml/cd1_init_response.xml
204
+ - spec/fixtures/xml/cd1_transfer_response.xml
197
205
  - spec/fixtures/xml/ebics_business_nok.xml
198
206
  - spec/fixtures/xml/ebics_technical_nok.xml
199
207
  - spec/fixtures/xml/hia.xml
@@ -246,7 +254,7 @@ homepage: https://github.com/railslove/epics
246
254
  licenses:
247
255
  - LGPL-3.0
248
256
  metadata: {}
249
- post_install_message: ! "\n\e[32m************************************************************\n\e[0mThanks
257
+ post_install_message: "\n\e[32m************************************************************\n\e[0mThanks
250
258
  for using Epics - your epic EBICS client!\nEpics provides a full production-tested
251
259
  implementation of the Electronic Banking Internet Communication Standard.\nRailslove
252
260
  as the maintainer is commited to provide extensive developer tools to make integrating
@@ -258,17 +266,17 @@ require_paths:
258
266
  - lib
259
267
  required_ruby_version: !ruby/object:Gem::Requirement
260
268
  requirements:
261
- - - ! '>='
269
+ - - ">="
262
270
  - !ruby/object:Gem::Version
263
271
  version: '0'
264
272
  required_rubygems_version: !ruby/object:Gem::Requirement
265
273
  requirements:
266
- - - ! '>='
274
+ - - ">="
267
275
  - !ruby/object:Gem::Version
268
276
  version: '0'
269
277
  requirements: []
270
278
  rubyforge_project:
271
- rubygems_version: 2.0.5
279
+ rubygems_version: 2.4.5
272
280
  signing_key:
273
281
  specification_version: 4
274
282
  summary: a ruby implementation of the EBICS protocol
@@ -282,6 +290,8 @@ test_files:
282
290
  - spec/fixtures/e002.pem
283
291
  - spec/fixtures/x002.pem
284
292
  - spec/fixtures/xml/cd1.xml
293
+ - spec/fixtures/xml/cd1_init_response.xml
294
+ - spec/fixtures/xml/cd1_transfer_response.xml
285
295
  - spec/fixtures/xml/ebics_business_nok.xml
286
296
  - spec/fixtures/xml/ebics_technical_nok.xml
287
297
  - spec/fixtures/xml/hia.xml