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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61d881bf8791586ff4fa95db25764760a5ca0a1f
4
- data.tar.gz: 63360ac97af8276e2338498e38f43e9c3460d10f
3
+ metadata.gz: e1b144ee107acb92e07bc5374887837121f4bd25
4
+ data.tar.gz: 40b4435924bae79be5e3dccd5dd51f512c07393c
5
5
  SHA512:
6
- metadata.gz: d9d31d54ffdeb3c97f0a4c3b49192272b1ea6e1829a3de89b299a783cb28b487e12dfb5e1c531156a26083c38f3d774664942a9390dac99f0171c7b2e031137d
7
- data.tar.gz: 856a8e8940b28ced56c3d02118dd1a819331d2eb16febbe08cf797e69e1099153456a3e3dcaec89d503a1b45a43a31f96f7287c740c81a9f4b22dd313983d460
6
+ metadata.gz: 4ac0b1b88d188ab1ac3995bee74c5c3213121c7cf1af9406a24fe48736f3cd0bce046ffdaaff6e8da0ed73f39d9b053d979b7b75b2ce3d7e8b7257a6e21890cb
7
+ data.tar.gz: e42b512dbd90a1fe8ef7b08625338514262c276340b4116fc0ae9f94e369d14d4a061ec7345b7680e94bfb0ef8963668e4ed8d63a160ceff9c2de6fd2cb290d9
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
- - 2.1.2
4
+ - 2.1.8
5
+ - 2.2.4
6
6
  - jruby
@@ -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
@@ -1,5 +1,3 @@
1
1
  # Contributing to Epics
2
2
 
3
- ## Before You Start
4
-
5
- Please contact team@railslove.com before working on Epics!
3
+ To get started, <a href="https://www.clahub.com/agreements/railslove/epics">sign the Contributor License Agreement</a>.
@@ -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
 
@@ -1,12 +1,23 @@
1
1
  class Epics::HAC < Epics::GenericRequest
2
2
  attr_accessor :from, :to
3
3
 
4
- def initialize(client, from, to)
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" => {
@@ -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" => {
@@ -1,3 +1,3 @@
1
1
  module Epics
2
- VERSION = "1.3.1"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -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
- subject { described_class.new(client, "2014-09-01", "2014-09-30") }
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
- describe '#to_xml' do
8
- specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
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
- end
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
@@ -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
- subject { described_class.new(client, "2014-09-01", "2014-09-30") }
4
+ context 'with date range' do
5
+ subject(:order) { described_class.new(client, "2014-09-01", "2014-09-30") }
6
6
 
7
- describe '#to_xml' do
8
- specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
9
- end
7
+ describe '#to_xml' do
8
+ specify { expect(order.to_xml).to be_a_valid_ebics_doc }
10
9
 
11
- describe '#to_receipt_xml' do
12
- before { subject.transaction_id = SecureRandom.hex(16) }
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
- specify { expect(subject.to_receipt_xml).to be_a_valid_ebics_doc }
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
- end
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.3.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-08-17 00:00:00.000000000 Z
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.8
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