epics 2.5.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.md +11 -1
- data/README.md +22 -7
- data/bin/console +8 -0
- data/bin/setup +6 -0
- data/epics.gemspec +4 -0
- data/lib/epics/cip.rb +13 -0
- data/lib/epics/client.rb +12 -4
- data/lib/epics/fdl.rb +23 -0
- data/lib/epics/header_request.rb +2 -4
- data/lib/epics/version.rb +1 -1
- data/lib/epics.rb +5 -1
- data/spec/client_spec.rb +1 -1
- data/spec/fixtures/xml/cip.xml +86 -0
- data/spec/fixtures/xml/htd_order_data.xml +7 -1
- data/spec/orders/cip_spec.rb +23 -0
- data/spec/orders/fdl_spec.rb +58 -0
- data/spec/support/ebics_matcher.rb +1 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a2a79b885cb022c062f828a88755b065c3e28610cf02b04520f8e3ec64379f
|
4
|
+
data.tar.gz: 741c01e277edb80130af0da516fb0353c9966800695c601693d1fb970566e1a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 010ce5ba5b9582007e4408fb7fb26857a7ce90632dcd8c48bda1a96d9093a8387cae8a5b59695f7ca535df0a63b2a90922362c8b96c5fc72b8ca3e03e93f03f9
|
7
|
+
data.tar.gz: 19c3bb2aab6ed308d3122609eb7bd94c4808e156cb2e9294ec77e5a94173af26977e6c8c28ca6dea8f64228cdf8a55a73db167f66dd6d48956bbc98644901d14
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
### Unreleased
|
2
2
|
|
3
|
+
### 2.7.0
|
4
|
+
|
5
|
+
- [ENHANCEMENT] Added FDL order type (thanks to @frantisekrokusek)
|
6
|
+
- [ENHANCEMENT] Added support for configuring locale and client/product name on initialization (thanks to @frantisekrokusek)
|
7
|
+
|
8
|
+
### 2.6.0
|
9
|
+
|
10
|
+
- [ENHANCEMENT] Added CIP order type (instant transfers)
|
11
|
+
- [ENHANCEMENT] Added gem metadata (thanks to @Nymuxyzo)
|
12
|
+
|
3
13
|
### 2.5.0
|
4
14
|
|
5
15
|
- [HOUSEKEEPING] Bump XML dependency requirements to more recent versions
|
@@ -7,7 +17,7 @@
|
|
7
17
|
- [HOUSEKEEPING] Bump ruby required version from 2.7 to 3.1
|
8
18
|
- [ENHANCEMENT] Request Header generation more generalized (thanks to @jplot)
|
9
19
|
- [ENHANCEMENT] Multi language support for initialization letter (thanks to @jplot)
|
10
|
-
- [
|
20
|
+
- [ENHANCEMENT] Added support for WSS and C5N order types (thanks to @kostja93)
|
11
21
|
|
12
22
|
### 2.4.0
|
13
23
|
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ It supports EBICS 2.5.
|
|
10
10
|
|
11
11
|
The client supports the complete initialization process comprising INI, HIA and HPB including the
|
12
12
|
INI letter generation. It offers support for the most common download and upload order types
|
13
|
-
(STA HAA HTD HPD PTK HAC HKD C52 C53 C54 CD1 CDB CDD CCT VMK).
|
13
|
+
(STA HAA HTD HPD PTK HAC HKD C52 C53 C54 CD1 CDB CDD CCT VMK FDL).
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -115,6 +115,15 @@ keys = File.read('/tmp/my.key')
|
|
115
115
|
e = Epics::Client.new(keys, 'passphrase', 'url', 'host', 'user', 'partner')
|
116
116
|
```
|
117
117
|
|
118
|
+
### Client Configuration
|
119
|
+
|
120
|
+
You can choose to configure some default values like this
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
# For default values see `lib/epics.rb`
|
124
|
+
e = Epics::Client.new(keys, 'passphrase', 'url', 'host', 'user', 'partner', locale: :fr, product_name: 'Mon Epic Client EBICS')
|
125
|
+
```
|
126
|
+
|
118
127
|
## Features
|
119
128
|
|
120
129
|
### Initialization
|
@@ -222,12 +231,13 @@ Used for example by the following tested institutions:
|
|
222
231
|
- Hypo Vereinsbank
|
223
232
|
- BAWAG P.S.K. (AT)
|
224
233
|
- Bank Frick (LI)
|
234
|
+
- BNP Paribas (FR)
|
225
235
|
|
226
236
|
Is Epics working with your institution? Please help us to grow this list of supported banks:
|
227
237
|
|
228
238
|
## Development
|
229
239
|
|
230
|
-
For development purposes, you may want to use a proxy server in order to have a
|
240
|
+
For development purposes, you may want to use a proxy server in order to have a convenient look into request and response data.
|
231
241
|
To do so, it's sufficient to define `http_proxy` in your environment.
|
232
242
|
Also you may want to disable SSL verification - simply set `EPICS_VERIFY_SSL` to `"false"`.
|
233
243
|
|
@@ -246,14 +256,19 @@ EPICS_VERIFY_SSL=false
|
|
246
256
|
- [Die Deutsche Kreditwirtschaft](http://www.die-deutsche-kreditwirtschaft.de/)
|
247
257
|
|
248
258
|
## Contributing
|
249
|
-
Railslove has a [Contributor License Agreement (CLA)](https://github.com/railslove/epics/blob/master/CONTRIBUTING.md) which clarifies the intellectual property rights for contributions from individuals or entities. To ensure every developer has signed the CLA, we use [CLA Assistant](https://cla-assistant.io/).
|
259
|
+
Railslove has a [Contributor License Agreement (CLA)](https://github.com/railslove/epics/blob/master/CONTRIBUTING.md) which clarifies the intellectual property rights for contributions from individuals or entities. To ensure every developer has signed the CLA, we use [CLA Assistant](https://cla-assistant.io/).
|
260
|
+
|
261
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
262
|
+
Then, run `rspec` to run the tests.
|
263
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
250
264
|
|
251
265
|
0. Contact team@railslove.com for information about the CLA
|
252
266
|
1. Fork it ( https://github.com/[my-github-username]/epics/fork )
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
267
|
+
2. Run `bin/setup`
|
268
|
+
3. Create your feature branch (`git checkout -b my-new-feature`)
|
269
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
270
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
271
|
+
6. Create a new Pull Request
|
257
272
|
|
258
273
|
## Contribution Credits
|
259
274
|
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/epics.gemspec
CHANGED
@@ -33,6 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
34
34
|
spec.require_paths = ['lib']
|
35
35
|
|
36
|
+
spec.metadata['changelog_uri'] = 'https://github.com/railslove/epics/blob/master/CHANGELOG.md'
|
37
|
+
spec.metadata['source_code_uri'] = 'https://github.com/railslove/epics'
|
38
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/railslove/epics/issues'
|
39
|
+
|
36
40
|
spec.post_install_message = "\n\e[32m" + ('*' * 60) + "\n\e[0m"
|
37
41
|
spec.post_install_message += "Thanks for using Epics - your epic EBICS client!\n"
|
38
42
|
spec.post_install_message += "Epics provides a full production-tested implementation of the Electronic Banking Internet Communication Standard.\n"
|
data/lib/epics/cip.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class Epics::CIP < Epics::GenericUploadRequest
|
2
|
+
def header
|
3
|
+
client.header_request.build(
|
4
|
+
nonce: nonce,
|
5
|
+
timestamp: timestamp,
|
6
|
+
order_type: 'CIP',
|
7
|
+
order_attribute: 'OZHNN',
|
8
|
+
order_params: {},
|
9
|
+
num_segments: 1,
|
10
|
+
mutable: { TransactionPhase: 'Initialisation' }
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
data/lib/epics/client.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
class Epics::Client
|
2
2
|
extend Forwardable
|
3
3
|
|
4
|
-
attr_accessor :passphrase, :url, :host_id, :user_id, :partner_id, :keys, :keys_content
|
4
|
+
attr_accessor :passphrase, :url, :host_id, :user_id, :partner_id, :keys, :keys_content, :locale, :product_name
|
5
5
|
attr_writer :iban, :bic, :name
|
6
|
-
attr_accessor :locale
|
7
6
|
|
8
7
|
def_delegators :connection, :post
|
9
8
|
|
10
|
-
def initialize(keys_content, passphrase, url, host_id, user_id, partner_id)
|
9
|
+
def initialize(keys_content, passphrase, url, host_id, user_id, partner_id, locale: Epics::DEFAULT_LOCALE, product_name: Epics::DEFAULT_PRODUCT_NAME)
|
11
10
|
self.keys_content = keys_content.respond_to?(:read) ? keys_content.read : keys_content if keys_content
|
12
11
|
self.passphrase = passphrase
|
13
12
|
self.keys = extract_keys if keys_content
|
@@ -15,7 +14,8 @@ class Epics::Client
|
|
15
14
|
self.host_id = host_id
|
16
15
|
self.user_id = user_id
|
17
16
|
self.partner_id = partner_id
|
18
|
-
self.locale =
|
17
|
+
self.locale = locale
|
18
|
+
self.product_name = product_name
|
19
19
|
end
|
20
20
|
|
21
21
|
def inspect
|
@@ -166,6 +166,10 @@ class Epics::Client
|
|
166
166
|
upload(Epics::CCT, document)
|
167
167
|
end
|
168
168
|
|
169
|
+
def CIP(document)
|
170
|
+
upload(Epics::CIP, document)
|
171
|
+
end
|
172
|
+
|
169
173
|
def CCS(document)
|
170
174
|
upload(Epics::CCS, document)
|
171
175
|
end
|
@@ -178,6 +182,10 @@ class Epics::Client
|
|
178
182
|
download(Epics::STA, from: from, to: to)
|
179
183
|
end
|
180
184
|
|
185
|
+
def FDL(format, from = nil, to = nil)
|
186
|
+
download(Epics::FDL, file_format: format, from: from, to: to )
|
187
|
+
end
|
188
|
+
|
181
189
|
def VMK(from = nil, to = nil)
|
182
190
|
download(Epics::VMK, from: from, to: to)
|
183
191
|
end
|
data/lib/epics/fdl.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Epics::FDL < Epics::GenericRequest
|
4
|
+
def header
|
5
|
+
fdl_order_params = Hash.new.tap do |params|
|
6
|
+
params[:DateRange] = {
|
7
|
+
Start: options[:from],
|
8
|
+
End: options[:to],
|
9
|
+
} if options[:from] && options[:to]
|
10
|
+
params[:FileFormat] = options[:file_format]
|
11
|
+
end
|
12
|
+
|
13
|
+
client.header_request.build(
|
14
|
+
nonce: nonce,
|
15
|
+
timestamp: timestamp,
|
16
|
+
order_type: 'FDL',
|
17
|
+
order_attribute: 'DZHNN',
|
18
|
+
order_id: 'A00A',
|
19
|
+
custom_order_params: { FDLOrderParams: fdl_order_params },
|
20
|
+
mutable: { TransactionPhase: 'Initialisation' }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
data/lib/epics/header_request.rb
CHANGED
@@ -2,9 +2,6 @@ class Epics::HeaderRequest
|
|
2
2
|
extend Forwardable
|
3
3
|
attr_accessor :client
|
4
4
|
|
5
|
-
PRODUCT_NAME = 'EPICS - a ruby ebics kernel'
|
6
|
-
PRODUCT_LANG = 'de'
|
7
|
-
|
8
5
|
def initialize(client)
|
9
6
|
self.client = client
|
10
7
|
end
|
@@ -22,13 +19,14 @@ class Epics::HeaderRequest
|
|
22
19
|
xml.Timestamp options[:timestamp] if options[:timestamp]
|
23
20
|
xml.PartnerID partner_id
|
24
21
|
xml.UserID user_id
|
25
|
-
xml.Product(
|
22
|
+
xml.Product(client.product_name, 'Language' => client.locale)
|
26
23
|
xml.OrderDetails {
|
27
24
|
xml.OrderType options[:order_type]
|
28
25
|
xml.OrderAttribute options[:order_attribute]
|
29
26
|
xml.StandardOrderParams {
|
30
27
|
build_attributes(xml, options[:order_params])
|
31
28
|
} if options[:order_params]
|
29
|
+
build_attributes(xml, options[:custom_order_params]) if options[:custom_order_params]
|
32
30
|
}
|
33
31
|
xml.BankPubKeyDigests {
|
34
32
|
xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256')
|
data/lib/epics/version.rb
CHANGED
data/lib/epics.rb
CHANGED
@@ -25,6 +25,7 @@ require "epics/hkd"
|
|
25
25
|
require "epics/htd"
|
26
26
|
require "epics/haa"
|
27
27
|
require "epics/sta"
|
28
|
+
require "epics/fdl"
|
28
29
|
require "epics/vmk"
|
29
30
|
require "epics/c52"
|
30
31
|
require "epics/c53"
|
@@ -40,6 +41,7 @@ require "epics/hpd"
|
|
40
41
|
require "epics/cd1"
|
41
42
|
require "epics/cct"
|
42
43
|
require "epics/ccs"
|
44
|
+
require "epics/cip"
|
43
45
|
require "epics/cdb"
|
44
46
|
require "epics/cdd"
|
45
47
|
require "epics/xe2"
|
@@ -59,6 +61,8 @@ require "epics/client"
|
|
59
61
|
I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'letter/locales', '*.yml')]
|
60
62
|
|
61
63
|
module Epics
|
62
|
-
|
64
|
+
DEFAULT_PRODUCT_NAME = 'EPICS - a ruby ebics kernel'
|
65
|
+
DEFAULT_LOCALE = :de
|
63
66
|
end
|
67
|
+
|
64
68
|
Ebics = Epics
|
data/spec/client_spec.rb
CHANGED
@@ -88,7 +88,7 @@ RSpec.describe Epics::Client do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'extracts the accessible order types of a subscriber' do
|
91
|
-
expect(subject.order_types).to match_array(%w(PTK HPD HTD STA HVD HPB HAA HVT HVU HVZ INI SPR PUB HIA HCA HSA HVE HVS CCS CCT CD1 CDB CDD))
|
91
|
+
expect(subject.order_types).to match_array(%w(PTK HPD HTD STA HVD HPB HAA HVT HVU HVZ INI SPR PUB HIA HCA HSA HVE HVS CCS CCT CIP CD1 CDB CDD))
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 pain.001.001.09.xsd">
|
3
|
+
<CstmrCdtTrfInitn>
|
4
|
+
<GrpHdr>
|
5
|
+
<MsgId>Message-ID-0815</MsgId>
|
6
|
+
<CreDtTm>2022-09-15T09:31:39.000Z</CreDtTm>
|
7
|
+
<NbOfTxs>2</NbOfTxs>
|
8
|
+
<CtrlSum>1122.33</CtrlSum>
|
9
|
+
<InitgPty>
|
10
|
+
<Nm>Initiator Name</Nm>
|
11
|
+
</InitgPty>
|
12
|
+
</GrpHdr>
|
13
|
+
<PmtInf>
|
14
|
+
<PmtInfId>Payment-Information-ID-0815</PmtInfId>
|
15
|
+
<PmtMtd>TRF</PmtMtd>
|
16
|
+
<BtchBookg>true</BtchBookg>
|
17
|
+
<NbOfTxs>2</NbOfTxs>
|
18
|
+
<CtrlSum>1122.33</CtrlSum>
|
19
|
+
<PmtTpInf>
|
20
|
+
<SvcLvl>
|
21
|
+
<Cd>SEPA</Cd>
|
22
|
+
</SvcLvl>
|
23
|
+
<LclInstrm>
|
24
|
+
<Cd>INST</Cd>
|
25
|
+
</LclInstrm>
|
26
|
+
</PmtTpInf>
|
27
|
+
<ReqdExctnDt>
|
28
|
+
<DtTm>2022-09-16T10:00:00</DtTm>
|
29
|
+
</ReqdExctnDt>
|
30
|
+
<Dbtr>
|
31
|
+
<Nm>Herr Schnellzahler</Nm>
|
32
|
+
</Dbtr>
|
33
|
+
<DbtrAcct>
|
34
|
+
<Id>
|
35
|
+
<IBAN>DE89370400440532013000</IBAN>
|
36
|
+
</Id>
|
37
|
+
</DbtrAcct>
|
38
|
+
<DbtrAgt>
|
39
|
+
<FinInstnId>
|
40
|
+
<Othr>
|
41
|
+
<Id>NOTPROVIDED</Id>
|
42
|
+
</Othr>
|
43
|
+
</FinInstnId>
|
44
|
+
</DbtrAgt>
|
45
|
+
<ChrgBr>SLEV</ChrgBr>
|
46
|
+
<CdtTrfTxInf>
|
47
|
+
<PmtId>
|
48
|
+
<EndToEndId>OriginID1</EndToEndId>
|
49
|
+
</PmtId>
|
50
|
+
<Amt>
|
51
|
+
<InstdAmt Ccy="EUR">1022.00</InstdAmt>
|
52
|
+
</Amt>
|
53
|
+
<Cdtr>
|
54
|
+
<Nm>John Dough</Nm>
|
55
|
+
</Cdtr>
|
56
|
+
<CdtrAcct>
|
57
|
+
<Id>
|
58
|
+
<IBAN>AT611904300234573201</IBAN>
|
59
|
+
</Id>
|
60
|
+
</CdtrAcct>
|
61
|
+
<RmtInf>
|
62
|
+
<Ustrd>Unstructured Remittance Information</Ustrd>
|
63
|
+
</RmtInf>
|
64
|
+
</CdtTrfTxInf>
|
65
|
+
<CdtTrfTxInf>
|
66
|
+
<PmtId>
|
67
|
+
<EndToEndId>OriginID2</EndToEndId>
|
68
|
+
</PmtId>
|
69
|
+
<Amt>
|
70
|
+
<InstdAmt Ccy="EUR">100.33</InstdAmt>
|
71
|
+
</Amt>
|
72
|
+
<Cdtr>
|
73
|
+
<Nm>Cookie Cutter</Nm>
|
74
|
+
</Cdtr>
|
75
|
+
<CdtrAcct>
|
76
|
+
<Id>
|
77
|
+
<IBAN>AT611904300234573201</IBAN>
|
78
|
+
</Id>
|
79
|
+
</CdtrAcct>
|
80
|
+
<RmtInf>
|
81
|
+
<Ustrd>Unstructured Remittance Information</Ustrd>
|
82
|
+
</RmtInf>
|
83
|
+
</CdtTrfTxInf>
|
84
|
+
</PmtInf>
|
85
|
+
</CstmrCdtTrfInitn>
|
86
|
+
</Document>
|
@@ -127,6 +127,12 @@
|
|
127
127
|
<Description>Credit Transfer Initiation</Description>
|
128
128
|
<NumSigRequired>1</NumSigRequired>
|
129
129
|
</OrderInfo>
|
130
|
+
<OrderInfo>
|
131
|
+
<OrderType>CIP</OrderType>
|
132
|
+
<TransferType>Upload</TransferType>
|
133
|
+
<Description>Instant Credit Transfer Initiation</Description>
|
134
|
+
<NumSigRequired>1</NumSigRequired>
|
135
|
+
</OrderInfo>
|
130
136
|
<OrderInfo>
|
131
137
|
<OrderType>CD1</OrderType>
|
132
138
|
<TransferType>Upload</TransferType>
|
@@ -153,7 +159,7 @@
|
|
153
159
|
<OrderTypes>PTK HPD HTD STA HVD HPB HAA HVT HVU HVZ</OrderTypes>
|
154
160
|
</Permission>
|
155
161
|
<Permission AuthorisationLevel="E">
|
156
|
-
<OrderTypes>INI SPR PUB HIA HCA HSA HVE HVS CCS CCT CD1 CDB CDD</OrderTypes>
|
162
|
+
<OrderTypes>INI SPR PUB HIA HCA HSA HVE HVS CCS CCT CIP CD1 CDB CDD</OrderTypes>
|
157
163
|
</Permission>
|
158
164
|
</UserInfo>
|
159
165
|
</HTDResponseOrderData>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
RSpec.describe Epics::CIP 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', 'cip.xml') ) }
|
5
|
+
subject { described_class.new(client, document) }
|
6
|
+
|
7
|
+
describe 'order attributes' do
|
8
|
+
it { expect(subject.header.to_s).to include('<OrderAttribute>OZHNN</OrderAttribute>') }
|
9
|
+
it { expect(subject.header.to_s).to include('<OrderType>CIP</OrderType>') }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#to_xml' do
|
13
|
+
specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#to_transfer_xml' do
|
17
|
+
before { subject.transaction_id = SecureRandom.hex(16) }
|
18
|
+
|
19
|
+
specify { expect(subject.to_transfer_xml).to be_a_valid_ebics_doc }
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
RSpec.describe Epics::FDL do
|
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') }
|
3
|
+
let(:file_format) { 'camt.xxx.cfonb120.stm.Oby' }
|
4
|
+
|
5
|
+
context 'with file_format' do
|
6
|
+
subject(:order) { described_class.new(client, file_format: file_format) }
|
7
|
+
|
8
|
+
describe '#to_xml' do
|
9
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
10
|
+
|
11
|
+
it 'does includes a date range as standard order parameter' do
|
12
|
+
expect(order.to_xml).to include('<FDLOrderParams><FileFormat>camt.xxx.cfonb120.stm.Oby</FileFormat></FDLOrderParams>')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#to_receipt_xml' do
|
17
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
18
|
+
|
19
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'with DateRange' do
|
23
|
+
subject(:order) { described_class.new(client, file_format: file_format, from: Date.new(2024, 1, 1), to: Date.new(2024, 1, 2)) }
|
24
|
+
|
25
|
+
describe '#to_xml' do
|
26
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
27
|
+
|
28
|
+
it 'does includes a date range as optional order parameter' do
|
29
|
+
expect(order.to_xml).to include('<FDLOrderParams><DateRange><Start>2024-01-01</Start><End>2024-01-02</End></DateRange><FileFormat>camt.xxx.cfonb120.stm.Oby</FileFormat></FDLOrderParams>')
|
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
|
40
|
+
|
41
|
+
context 'without file_format' do
|
42
|
+
subject(:order) { described_class.new(client) }
|
43
|
+
|
44
|
+
describe '#to_xml' do
|
45
|
+
specify { expect(order.to_xml).to be_a_valid_ebics_doc }
|
46
|
+
|
47
|
+
it 'does not include a standard order parameter' do
|
48
|
+
expect(order.to_xml).to include('<FDLOrderParams><FileFormat/></FDLOrderParams>')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#to_receipt_xml' do
|
53
|
+
before { order.transaction_id = SecureRandom.hex(16) }
|
54
|
+
|
55
|
+
specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
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: 2.
|
4
|
+
version: 2.7.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: 2024-
|
11
|
+
date: 2024-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -177,7 +177,9 @@ description: |2
|
|
177
177
|
CD1 CDD CCT CDB CDS CCS CDZ CRZ
|
178
178
|
email:
|
179
179
|
- lars@railslove.com
|
180
|
-
executables:
|
180
|
+
executables:
|
181
|
+
- console
|
182
|
+
- setup
|
181
183
|
extensions: []
|
182
184
|
extra_rdoc_files: []
|
183
185
|
files:
|
@@ -190,6 +192,8 @@ files:
|
|
190
192
|
- LICENSE.txt
|
191
193
|
- README.md
|
192
194
|
- Rakefile
|
195
|
+
- bin/console
|
196
|
+
- bin/setup
|
193
197
|
- epics.gemspec
|
194
198
|
- lib/epics.rb
|
195
199
|
- lib/epics/azv.rb
|
@@ -206,9 +210,11 @@ files:
|
|
206
210
|
- lib/epics/cdd.rb
|
207
211
|
- lib/epics/cds.rb
|
208
212
|
- lib/epics/cdz.rb
|
213
|
+
- lib/epics/cip.rb
|
209
214
|
- lib/epics/client.rb
|
210
215
|
- lib/epics/crz.rb
|
211
216
|
- lib/epics/error.rb
|
217
|
+
- lib/epics/fdl.rb
|
212
218
|
- lib/epics/generic_request.rb
|
213
219
|
- lib/epics/generic_upload_request.rb
|
214
220
|
- lib/epics/haa.rb
|
@@ -258,6 +264,7 @@ files:
|
|
258
264
|
- spec/fixtures/xml/cdb.xml
|
259
265
|
- spec/fixtures/xml/cdb_init_response.xml
|
260
266
|
- spec/fixtures/xml/cdb_transfer_response.xml
|
267
|
+
- spec/fixtures/xml/cip.xml
|
261
268
|
- spec/fixtures/xml/ebics_business_nok.xml
|
262
269
|
- spec/fixtures/xml/ebics_technical_nok.xml
|
263
270
|
- spec/fixtures/xml/haa.xml
|
@@ -298,7 +305,9 @@ files:
|
|
298
305
|
- spec/orders/cdb_spec.rb
|
299
306
|
- spec/orders/cdd_spec.rb
|
300
307
|
- spec/orders/cdz_spec.rb
|
308
|
+
- spec/orders/cip_spec.rb
|
301
309
|
- spec/orders/crz_spec.rb
|
310
|
+
- spec/orders/fdl_spec.rb
|
302
311
|
- spec/orders/haa_spec.rb
|
303
312
|
- spec/orders/hac_spec.rb
|
304
313
|
- spec/orders/hia_spec.rb
|
@@ -334,7 +343,10 @@ files:
|
|
334
343
|
homepage: https://github.com/railslove/epics
|
335
344
|
licenses:
|
336
345
|
- LGPL-3.0
|
337
|
-
metadata:
|
346
|
+
metadata:
|
347
|
+
changelog_uri: https://github.com/railslove/epics/blob/master/CHANGELOG.md
|
348
|
+
source_code_uri: https://github.com/railslove/epics
|
349
|
+
bug_tracker_uri: https://github.com/railslove/epics/issues
|
338
350
|
post_install_message: "\n\e[32m************************************************************\n\e[0mThanks
|
339
351
|
for using Epics - your epic EBICS client!\nEpics provides a full production-tested
|
340
352
|
implementation of the Electronic Banking Internet Communication Standard.\nRailslove
|
@@ -356,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
368
|
- !ruby/object:Gem::Version
|
357
369
|
version: '0'
|
358
370
|
requirements: []
|
359
|
-
rubygems_version: 3.5.
|
371
|
+
rubygems_version: 3.5.22
|
360
372
|
signing_key:
|
361
373
|
specification_version: 4
|
362
374
|
summary: a ruby implementation of the EBICS protocol
|
@@ -377,6 +389,7 @@ test_files:
|
|
377
389
|
- spec/fixtures/xml/cdb.xml
|
378
390
|
- spec/fixtures/xml/cdb_init_response.xml
|
379
391
|
- spec/fixtures/xml/cdb_transfer_response.xml
|
392
|
+
- spec/fixtures/xml/cip.xml
|
380
393
|
- spec/fixtures/xml/ebics_business_nok.xml
|
381
394
|
- spec/fixtures/xml/ebics_technical_nok.xml
|
382
395
|
- spec/fixtures/xml/haa.xml
|
@@ -417,7 +430,9 @@ test_files:
|
|
417
430
|
- spec/orders/cdb_spec.rb
|
418
431
|
- spec/orders/cdd_spec.rb
|
419
432
|
- spec/orders/cdz_spec.rb
|
433
|
+
- spec/orders/cip_spec.rb
|
420
434
|
- spec/orders/crz_spec.rb
|
435
|
+
- spec/orders/fdl_spec.rb
|
421
436
|
- spec/orders/haa_spec.rb
|
422
437
|
- spec/orders/hac_spec.rb
|
423
438
|
- spec/orders/hia_spec.rb
|