epics 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +5 -0
- data/CONTRIBUTING.md +1 -3
- data/lib/epics/client.rb +2 -2
- data/lib/epics/hac.rb +13 -7
- data/lib/epics/sta.rb +10 -7
- data/lib/epics/version.rb +1 -1
- data/spec/orders/hac_spec.rb +33 -5
- data/spec/orders/sta_spec.rb +31 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b144ee107acb92e07bc5374887837121f4bd25
|
4
|
+
data.tar.gz: 40b4435924bae79be5e3dccd5dd51f512c07393c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac0b1b88d188ab1ac3995bee74c5c3213121c7cf1af9406a24fe48736f3cd0bce046ffdaaff6e8da0ed73f39d9b053d979b7b75b2ce3d7e8b7257a6e21890cb
|
7
|
+
data.tar.gz: e42b512dbd90a1fe8ef7b08625338514262c276340b4116fc0ae9f94e369d14d4a061ec7345b7680e94bfb0ef8963668e4ed8d63a160ceff9c2de6fd2cb290d9
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
### 1.4.0
|
2
|
+
|
3
|
+
* [ENHANCEMENT] STA without date range to fetch all statements which have not yet been fetched
|
4
|
+
* [ENHANCEMENT] HAC without date range to fetch all transaction logs which have not yet been fetched
|
5
|
+
|
1
6
|
### 1.3.1
|
2
7
|
|
3
8
|
* [ENHANCEMENT] make xpath namespaces explicit, so we can cover a wider
|
data/CONTRIBUTING.md
CHANGED
data/lib/epics/client.rb
CHANGED
@@ -123,7 +123,7 @@ class Epics::Client
|
|
123
123
|
upload(Epics::CCT, document)
|
124
124
|
end
|
125
125
|
|
126
|
-
def STA(from, to)
|
126
|
+
def STA(from = nil, to = nil)
|
127
127
|
download(Epics::STA, from, to)
|
128
128
|
end
|
129
129
|
|
@@ -159,7 +159,7 @@ class Epics::Client
|
|
159
159
|
download(Epics::PTK, from, to)
|
160
160
|
end
|
161
161
|
|
162
|
-
def HAC(from, to)
|
162
|
+
def HAC(from = nil, to = nil)
|
163
163
|
download(Epics::HAC, from, to)
|
164
164
|
end
|
165
165
|
|
data/lib/epics/hac.rb
CHANGED
@@ -1,12 +1,23 @@
|
|
1
1
|
class Epics::HAC < Epics::GenericRequest
|
2
2
|
attr_accessor :from, :to
|
3
3
|
|
4
|
-
|
4
|
+
# By default HAC only returns data for transactions which have not yet been fetched. Therefore,
|
5
|
+
# most applications not not have to specify a date range, but can simply fetch the status and
|
6
|
+
# be done
|
7
|
+
def initialize(client, from = nil, to = nil)
|
5
8
|
super(client)
|
6
9
|
self.from = from
|
7
10
|
self.to = to
|
8
11
|
end
|
9
12
|
|
13
|
+
def date_range
|
14
|
+
if !!from && !!to
|
15
|
+
{ "DateRange" => { "Start" => from, "End" => to } }
|
16
|
+
else
|
17
|
+
{ :content! => '' }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
10
21
|
def header
|
11
22
|
{
|
12
23
|
:@authenticate => true,
|
@@ -23,12 +34,7 @@ class Epics::HAC < Epics::GenericRequest
|
|
23
34
|
"OrderDetails" => {
|
24
35
|
"OrderType" => "HAC",
|
25
36
|
"OrderAttribute" => "DZHNN",
|
26
|
-
"StandardOrderParams" =>
|
27
|
-
"DateRange" => {
|
28
|
-
"Start" => from,
|
29
|
-
"End" => to
|
30
|
-
}
|
31
|
-
}
|
37
|
+
"StandardOrderParams" => date_range
|
32
38
|
},
|
33
39
|
"BankPubKeyDigests" => {
|
34
40
|
"Authentication" => {
|
data/lib/epics/sta.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
class Epics::STA < Epics::GenericRequest
|
2
2
|
attr_accessor :from, :to
|
3
3
|
|
4
|
-
def initialize(client, from, to)
|
4
|
+
def initialize(client, from = nil, to = nil)
|
5
5
|
super(client)
|
6
6
|
self.from = from
|
7
7
|
self.to = to
|
8
8
|
end
|
9
9
|
|
10
|
+
def date_range
|
11
|
+
if !!from && !!to
|
12
|
+
{ "DateRange" => { "Start" => from, "End" => to } }
|
13
|
+
else
|
14
|
+
{ :content! => '' }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
def header
|
11
19
|
{
|
12
20
|
:@authenticate => true,
|
@@ -23,12 +31,7 @@ class Epics::STA < Epics::GenericRequest
|
|
23
31
|
"OrderDetails" => {
|
24
32
|
"OrderType" => "STA",
|
25
33
|
"OrderAttribute" => "DZHNN",
|
26
|
-
"StandardOrderParams" =>
|
27
|
-
"DateRange" => {
|
28
|
-
"Start" => from,
|
29
|
-
"End" => to
|
30
|
-
}
|
31
|
-
}
|
34
|
+
"StandardOrderParams" => date_range
|
32
35
|
},
|
33
36
|
"BankPubKeyDigests" => {
|
34
37
|
"Authentication" => {
|
data/lib/epics/version.rb
CHANGED
data/spec/orders/hac_spec.rb
CHANGED
@@ -1,11 +1,39 @@
|
|
1
1
|
RSpec.describe Epics::HAC do
|
2
|
-
|
3
2
|
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
3
|
|
5
|
-
|
4
|
+
context 'with date range' do
|
5
|
+
subject(:order) { described_class.new(client, "2014-09-01", "2014-09-30") }
|
6
|
+
|
7
|
+
describe '#to_xml' do
|
8
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
9
|
+
|
10
|
+
it 'does includes a date range as standard order parameter' do
|
11
|
+
expect(order.to_xml).to include('<StandardOrderParams><DateRange><Start>2014-09-01</Start><End>2014-09-30</End></DateRange></StandardOrderParams>')
|
12
|
+
end
|
13
|
+
end
|
6
14
|
|
7
|
-
|
8
|
-
|
15
|
+
describe '#to_receipt_xml' do
|
16
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
17
|
+
|
18
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
19
|
+
end
|
9
20
|
end
|
10
21
|
|
11
|
-
|
22
|
+
context 'without date range' do
|
23
|
+
subject(:order) { described_class.new(client) }
|
24
|
+
|
25
|
+
describe '#to_xml' do
|
26
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
27
|
+
|
28
|
+
it 'does not include a standard order parameter' do
|
29
|
+
expect(order.to_xml).to include('<StandardOrderParams/>')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#to_receipt_xml' do
|
34
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
35
|
+
|
36
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/spec/orders/sta_spec.rb
CHANGED
@@ -1,17 +1,39 @@
|
|
1
1
|
RSpec.describe Epics::STA do
|
2
|
-
|
3
2
|
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
3
|
|
5
|
-
|
4
|
+
context 'with date range' do
|
5
|
+
subject(:order) { described_class.new(client, "2014-09-01", "2014-09-30") }
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
7
|
+
describe '#to_xml' do
|
8
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
it 'does includes a date range as standard order parameter' do
|
11
|
+
expect(order.to_xml).to include('<StandardOrderParams><DateRange><Start>2014-09-01</Start><End>2014-09-30</End></DateRange></StandardOrderParams>')
|
12
|
+
end
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
+
describe '#to_receipt_xml' do
|
16
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
17
|
+
|
18
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
|
-
|
22
|
+
context 'without date range' do
|
23
|
+
subject(:order) { described_class.new(client) }
|
24
|
+
|
25
|
+
describe '#to_xml' do
|
26
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
27
|
+
|
28
|
+
it 'does not include a standard order parameter' do
|
29
|
+
expect(order.to_xml).to include('<StandardOrderParams/>')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#to_receipt_xml' do
|
34
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
35
|
+
|
36
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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.
|
4
|
+
version: 1.4.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: 2015-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
295
|
version: '0'
|
296
296
|
requirements: []
|
297
297
|
rubyforge_project:
|
298
|
-
rubygems_version: 2.4.
|
298
|
+
rubygems_version: 2.4.5.1
|
299
299
|
signing_key:
|
300
300
|
specification_version: 4
|
301
301
|
summary: a ruby implementation of the EBICS protocol
|