sepa_king 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +50 -0
- data/.gitignore +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +10 -11
- data/gemfiles/{Gemfile-activemodel-4.1.x → Gemfile-activemodel-6.1.x} +1 -1
- data/gemfiles/{Gemfile-activemodel-3.1.x → Gemfile-activemodel-7.0.x} +1 -1
- data/lib/sepa_king/message/credit_transfer.rb +1 -1
- data/lib/sepa_king/message/direct_debit.rb +1 -1
- data/lib/sepa_king/message.rb +2 -2
- data/lib/sepa_king/validator.rb +11 -6
- data/lib/sepa_king/version.rb +1 -1
- data/sepa_king.gemspec +6 -7
- data/spec/credit_transfer_spec.rb +12 -12
- data/spec/direct_debit_spec.rb +9 -9
- data/spec/validator_spec.rb +23 -5
- metadata +17 -43
- data/.travis.yml +0 -37
- data/gemfiles/Gemfile-activemodel-3.2.x +0 -5
- data/gemfiles/Gemfile-activemodel-4.0.x +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e3b76466f9a0fa80b6b9580abbf8cfdc8c1e530914d833848f16962bf49f1c0
|
4
|
+
data.tar.gz: '08059bad5cd7a74208fad02c15769de2cb5e84b3ae7cb622165af5081bc8a4df'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7f07f705f9afb8c6bcd0e91c3371b4f496e0649dd93b3dab85b5167223393d428d652cbf90147aa415ec63af3d9a01ac6f416a13c4190d28276b49d4a79b30
|
7
|
+
data.tar.gz: 20670910d9fe37671c90dc4189756757ed109b3110429631726b3b479e9ed625927db391002b6f9a01af4ba2e87ea921cd28c5c6e628daa3ec73483f7aa34904
|
@@ -0,0 +1,50 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
ruby: [ '2.7', '3.0', '3.1' ]
|
15
|
+
rails: [ '4.2', '5.0', '5.1', '5.2', '6.0', '6.1', '7.0' ]
|
16
|
+
exclude:
|
17
|
+
- ruby: '2.7'
|
18
|
+
rails: '4.2'
|
19
|
+
- ruby: '3.0'
|
20
|
+
rails: '4.2'
|
21
|
+
- ruby: '3.0'
|
22
|
+
rails: '5.0'
|
23
|
+
- ruby: '3.0'
|
24
|
+
rails: '5.1'
|
25
|
+
- ruby: '3.0'
|
26
|
+
rails: '5.2'
|
27
|
+
- ruby: '3.1'
|
28
|
+
rails: '4.2'
|
29
|
+
- ruby: '3.1'
|
30
|
+
rails: '5.0'
|
31
|
+
- ruby: '3.1'
|
32
|
+
rails: '5.1'
|
33
|
+
- ruby: '3.1'
|
34
|
+
rails: '5.2'
|
35
|
+
|
36
|
+
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
|
37
|
+
env:
|
38
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile-activemodel-${{ matrix.rails }}.x
|
39
|
+
|
40
|
+
steps:
|
41
|
+
- uses: actions/checkout@v3
|
42
|
+
|
43
|
+
- name: Setup Ruby
|
44
|
+
uses: ruby/setup-ruby@v1
|
45
|
+
with:
|
46
|
+
ruby-version: ${{ matrix.ruby }}
|
47
|
+
bundler-cache: true # 'bundle install' and cache gems
|
48
|
+
|
49
|
+
- name: RSpec
|
50
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# Ruby gem for creating SEPA XML files
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://github.com/salesking/sepa_king/workflows/Test/badge.svg?branch=master)](https://github.com/salesking/sepa_king/actions)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/salesking/sepa_king/badges/gpa.svg)](https://codeclimate.com/github/salesking/sepa_king)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/salesking/sepa_king/badge.svg?branch=master)](https://coveralls.io/r/salesking/sepa_king?branch=master)
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/sepa_king.svg)](http://badge.fury.io/rb/sepa_king)
|
7
|
-
[![Dependency Status](https://gemnasium.com/salesking/sepa_king.svg)](https://gemnasium.com/salesking/sepa_king)
|
8
7
|
|
9
8
|
We love building payment applications! So after developing the [DTAUS library for Ruby](https://github.com/salesking/king_dtaus) we move on with SEPA.
|
10
9
|
|
@@ -16,15 +15,15 @@ This gem implements the following two messages out of the ISO 20022 standard:
|
|
16
15
|
* Credit Transfer Initiation (`pain.001.003.03`, `pain.001.002.03` and `pain.001.001.03`)
|
17
16
|
* Direct Debit Initiation (`pain.008.003.02`, `pain.008.002.02` and `pain.008.001.02`)
|
18
17
|
|
19
|
-
It handles the _Specification of Data Formats_
|
18
|
+
It handles the _Specification of Data Formats_ v3.3 (2019-11-17).
|
20
19
|
|
21
20
|
BTW: **pain** is a shortcut for **Pa**yment **In**itiation.
|
22
21
|
|
23
22
|
|
24
23
|
## Requirements
|
25
24
|
|
26
|
-
* Ruby 2.
|
27
|
-
* ActiveModel
|
25
|
+
* Ruby 2.7 or newer
|
26
|
+
* ActiveModel 4.2 or newer (including 7.0)
|
28
27
|
|
29
28
|
|
30
29
|
## Installation
|
@@ -146,8 +145,8 @@ sdd.add_transaction(
|
|
146
145
|
sdd.add_transaction ...
|
147
146
|
|
148
147
|
# Last: create XML string
|
149
|
-
xml_string = sdd.to_xml
|
150
|
-
xml_string = sdd.to_xml('pain.008.002.02') # Use
|
148
|
+
xml_string = sdd.to_xml # Use schema pain.008.001.02
|
149
|
+
xml_string = sdd.to_xml('pain.008.002.02') # Use schema pain.008.002.02
|
151
150
|
```
|
152
151
|
|
153
152
|
|
@@ -237,8 +236,8 @@ sct.add_transaction(
|
|
237
236
|
sct.add_transaction ...
|
238
237
|
|
239
238
|
# Last: create XML string
|
240
|
-
xml_string = sct.to_xml
|
241
|
-
xml_string = sct.to_xml('pain.001.002.03') # Use
|
239
|
+
xml_string = sct.to_xml # Use schema pain.001.001.03
|
240
|
+
xml_string = sct.to_xml('pain.001.002.03') # Use schema pain.001.002.03
|
242
241
|
```
|
243
242
|
|
244
243
|
## Validations
|
@@ -286,7 +285,7 @@ https://github.com/salesking/sepa_king/graphs/contributors
|
|
286
285
|
|
287
286
|
## Resources
|
288
287
|
|
289
|
-
*
|
288
|
+
* https://www.ebics.de/de/datenformate
|
290
289
|
* SalesKing: http://salesking.eu
|
291
290
|
|
292
291
|
|
@@ -294,4 +293,4 @@ https://github.com/salesking/sepa_king/graphs/contributors
|
|
294
293
|
|
295
294
|
Released under the MIT license
|
296
295
|
|
297
|
-
Copyright (c) 2013-
|
296
|
+
Copyright (c) 2013-2022 Georg Leciejewski (SalesKing), Georg Ledermann (https://github.com/ledermann)
|
@@ -5,7 +5,7 @@ module SEPA
|
|
5
5
|
self.account_class = DebtorAccount
|
6
6
|
self.transaction_class = CreditTransferTransaction
|
7
7
|
self.xml_main_tag = 'CstmrCdtTrfInitn'
|
8
|
-
self.known_schemas = [
|
8
|
+
self.known_schemas = [ PAIN_001_001_03, PAIN_001_001_03_CH_02, PAIN_001_003_03, PAIN_001_002_03 ]
|
9
9
|
|
10
10
|
private
|
11
11
|
# Find groups of transactions which share the same values of some attributes
|
@@ -5,7 +5,7 @@ module SEPA
|
|
5
5
|
self.account_class = CreditorAccount
|
6
6
|
self.transaction_class = DirectDebitTransaction
|
7
7
|
self.xml_main_tag = 'CstmrDrctDbtInitn'
|
8
|
-
self.known_schemas = [ PAIN_008_003_02, PAIN_008_002_02
|
8
|
+
self.known_schemas = [ PAIN_008_001_02, PAIN_008_003_02, PAIN_008_002_02 ]
|
9
9
|
|
10
10
|
validate do |record|
|
11
11
|
if record.transactions.map(&:local_instrument).uniq.size > 1
|
data/lib/sepa_king/message.rb
CHANGED
@@ -75,7 +75,7 @@ module SEPA
|
|
75
75
|
raise ArgumentError.new('message_identification must be a string!') unless value.is_a?(String)
|
76
76
|
|
77
77
|
regex = /\A([A-Za-z0-9]|[\+|\?|\/|\-|\:|\(|\)|\.|\,|\'|\ ]){1,35}\z/
|
78
|
-
raise ArgumentError.new("message_identification does not match #{regex}!") unless value.match(regex)
|
78
|
+
raise ArgumentError.new("message_identification does not match #{regex}!") unless value.match?(regex)
|
79
79
|
|
80
80
|
@message_identification = value
|
81
81
|
end
|
@@ -91,7 +91,7 @@ module SEPA
|
|
91
91
|
raise ArgumentError.new('creation_date_time must be a string!') unless value.is_a?(String)
|
92
92
|
|
93
93
|
regex = /[0-9]{4}[-][0-9]{2,2}[-][0-9]{2,2}(?:\s|T)[0-9]{2,2}[:][0-9]{2,2}[:][0-9]{2,2}/
|
94
|
-
raise ArgumentError.new("creation_date_time does not match #{regex}!") unless value.match(regex)
|
94
|
+
raise ArgumentError.new("creation_date_time does not match #{regex}!") unless value.match?(regex)
|
95
95
|
|
96
96
|
@creation_date_time = value
|
97
97
|
end
|
data/lib/sepa_king/validator.rb
CHANGED
@@ -8,7 +8,7 @@ module SEPA
|
|
8
8
|
field_name = options[:field_name] || :iban
|
9
9
|
value = record.send(field_name).to_s
|
10
10
|
|
11
|
-
unless IBANTools::IBAN.valid?(value) && value.match(REGEX)
|
11
|
+
unless IBANTools::IBAN.valid?(value) && value.match?(REGEX)
|
12
12
|
record.errors.add(field_name, :invalid, message: options[:message])
|
13
13
|
end
|
14
14
|
end
|
@@ -31,7 +31,12 @@ module SEPA
|
|
31
31
|
end
|
32
32
|
|
33
33
|
class CreditorIdentifierValidator < ActiveModel::Validator
|
34
|
-
REGEX =
|
34
|
+
REGEX = %r{\A
|
35
|
+
[a-zA-Z]{2} # ISO country code
|
36
|
+
[0-9]{2} # Check digits
|
37
|
+
[A-Za-z0-9]{3} # Creditor business code
|
38
|
+
[A-Za-z0-9+?/:().,'-]{1,28} # National identifier
|
39
|
+
\z}x
|
35
40
|
|
36
41
|
def validate(record)
|
37
42
|
field_name = options[:field_name] || :creditor_identifier
|
@@ -43,9 +48,9 @@ module SEPA
|
|
43
48
|
end
|
44
49
|
|
45
50
|
def valid?(creditor_identifier)
|
46
|
-
if ok = creditor_identifier.to_s.match(REGEX)
|
51
|
+
if ok = creditor_identifier.to_s.match?(REGEX)
|
47
52
|
# In Germany, the identifier has to be exactly 18 chars long
|
48
|
-
if creditor_identifier[0..1].match(/DE/i)
|
53
|
+
if creditor_identifier[0..1].match?(/DE/i)
|
49
54
|
ok = creditor_identifier.length == 18
|
50
55
|
end
|
51
56
|
end
|
@@ -54,13 +59,13 @@ module SEPA
|
|
54
59
|
end
|
55
60
|
|
56
61
|
class MandateIdentifierValidator < ActiveModel::Validator
|
57
|
-
REGEX =
|
62
|
+
REGEX = %r{\A[A-Za-z0-9 +?/:().,'-]{1,35}\z}
|
58
63
|
|
59
64
|
def validate(record)
|
60
65
|
field_name = options[:field_name] || :mandate_id
|
61
66
|
value = record.send(field_name)
|
62
67
|
|
63
|
-
unless value.to_s.match(REGEX)
|
68
|
+
unless value.to_s.match?(REGEX)
|
64
69
|
record.errors.add(field_name, :invalid, message: options[:message])
|
65
70
|
end
|
66
71
|
end
|
data/lib/sepa_king/version.rb
CHANGED
data/sepa_king.gemspec
CHANGED
@@ -7,25 +7,24 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.name = 'sepa_king'
|
8
8
|
s.version = SEPA::VERSION
|
9
9
|
s.authors = ['Georg Leciejewski', 'Georg Ledermann']
|
10
|
-
s.email = ['gl@salesking.eu', '
|
11
|
-
s.description = 'Implemention of
|
10
|
+
s.email = ['gl@salesking.eu', 'georg@ledermann.dev']
|
11
|
+
s.description = 'Implemention of Payments Initiation (ISO 20022)'
|
12
12
|
s.summary = 'Ruby gem for creating SEPA XML files'
|
13
|
-
s.homepage = '
|
13
|
+
s.homepage = 'https://github.com/salesking/sepa_king'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split($/)
|
17
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
18
17
|
s.require_paths = ['lib']
|
19
18
|
|
20
|
-
s.required_ruby_version = '>= 2.
|
19
|
+
s.required_ruby_version = '>= 2.7'
|
21
20
|
|
22
|
-
s.add_runtime_dependency 'activemodel', '>=
|
21
|
+
s.add_runtime_dependency 'activemodel', '>= 4.2'
|
23
22
|
s.add_runtime_dependency 'nokogiri'
|
24
23
|
s.add_runtime_dependency 'iban-tools'
|
25
24
|
|
26
25
|
s.add_development_dependency 'bundler'
|
27
26
|
s.add_development_dependency 'rspec'
|
28
|
-
s.add_development_dependency '
|
27
|
+
s.add_development_dependency 'coveralls_reborn'
|
29
28
|
s.add_development_dependency 'simplecov'
|
30
29
|
s.add_development_dependency 'rake'
|
31
30
|
end
|
@@ -38,7 +38,7 @@ describe SEPA::CreditTransfer do
|
|
38
38
|
it 'should fail' do
|
39
39
|
expect {
|
40
40
|
SEPA::CreditTransfer.new.to_xml
|
41
|
-
}.to raise_error(SEPA::Error)
|
41
|
+
}.to raise_error(SEPA::Error, /Name is too short/)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -62,7 +62,7 @@ describe SEPA::CreditTransfer do
|
|
62
62
|
sct
|
63
63
|
end
|
64
64
|
|
65
|
-
it 'should validate against pain.001.003.
|
65
|
+
it 'should validate against pain.001.003.03' do
|
66
66
|
expect(subject.to_xml(SEPA::PAIN_001_003_03)).to validate_against('pain.001.003.03.xsd')
|
67
67
|
end
|
68
68
|
end
|
@@ -90,7 +90,7 @@ describe SEPA::CreditTransfer do
|
|
90
90
|
sct
|
91
91
|
end
|
92
92
|
|
93
|
-
it 'should validate against pain.001.001.
|
93
|
+
it 'should validate against pain.001.001.03' do
|
94
94
|
expect(subject.to_xml(SEPA::PAIN_001_001_03)).to validate_against('pain.001.001.03.xsd')
|
95
95
|
end
|
96
96
|
end
|
@@ -112,19 +112,19 @@ describe SEPA::CreditTransfer do
|
|
112
112
|
end
|
113
113
|
|
114
114
|
it 'should create valid XML file' do
|
115
|
-
expect(subject.to_xml).to validate_against('pain.001.003.03.xsd')
|
115
|
+
expect(subject.to_xml(SEPA::PAIN_001_003_03)).to validate_against('pain.001.003.03.xsd')
|
116
116
|
end
|
117
117
|
|
118
118
|
it 'should fail for pain.001.001.03' do
|
119
119
|
expect {
|
120
120
|
subject.to_xml(SEPA::PAIN_001_001_03)
|
121
|
-
}.to raise_error(SEPA::Error)
|
121
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
122
122
|
end
|
123
123
|
|
124
124
|
it 'should fail for pain.001.002.03' do
|
125
125
|
expect {
|
126
126
|
subject.to_xml(SEPA::PAIN_001_002_03)
|
127
|
-
}.to raise_error(SEPA::Error)
|
127
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
@@ -143,7 +143,7 @@ describe SEPA::CreditTransfer do
|
|
143
143
|
end
|
144
144
|
|
145
145
|
it 'should validate against pain.001.001.03' do
|
146
|
-
expect(subject.to_xml
|
146
|
+
expect(subject.to_xml).to validate_against('pain.001.001.03.xsd')
|
147
147
|
end
|
148
148
|
|
149
149
|
it 'should validate against pain.001.002.03' do
|
@@ -176,7 +176,7 @@ describe SEPA::CreditTransfer do
|
|
176
176
|
end
|
177
177
|
|
178
178
|
it 'should create valid XML file' do
|
179
|
-
expect(subject).to validate_against('pain.001.
|
179
|
+
expect(subject).to validate_against('pain.001.001.03.xsd')
|
180
180
|
end
|
181
181
|
|
182
182
|
it 'should have message_identification' do
|
@@ -344,7 +344,7 @@ describe SEPA::CreditTransfer do
|
|
344
344
|
end
|
345
345
|
|
346
346
|
it 'should create valid XML file' do
|
347
|
-
expect(subject).to validate_against('pain.001.
|
347
|
+
expect(subject).to validate_against('pain.001.001.03.xsd')
|
348
348
|
end
|
349
349
|
|
350
350
|
it 'should contain <InstrId>' do
|
@@ -381,13 +381,13 @@ describe SEPA::CreditTransfer do
|
|
381
381
|
it 'should fail for pain.001.002.03' do
|
382
382
|
expect {
|
383
383
|
subject.to_xml(SEPA::PAIN_001_002_03)
|
384
|
-
}.to raise_error(SEPA::Error)
|
384
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
385
385
|
end
|
386
386
|
|
387
387
|
it 'should fail for pain.001.003.03' do
|
388
388
|
expect {
|
389
389
|
subject.to_xml(SEPA::PAIN_001_003_03)
|
390
|
-
}.to raise_error(SEPA::Error)
|
390
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
@@ -409,7 +409,7 @@ describe SEPA::CreditTransfer do
|
|
409
409
|
it 'should fail for pain.001.002.03' do
|
410
410
|
expect {
|
411
411
|
subject.to_xml(SEPA::PAIN_001_002_03)
|
412
|
-
}.to raise_error(SEPA::Error)
|
412
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
413
413
|
end
|
414
414
|
|
415
415
|
it 'should validate against pain.001.003.03' do
|
data/spec/direct_debit_spec.rb
CHANGED
@@ -70,7 +70,7 @@ describe SEPA::DirectDebit do
|
|
70
70
|
it 'should fail' do
|
71
71
|
expect {
|
72
72
|
SEPA::DirectDebit.new.to_xml
|
73
|
-
}.to raise_error(SEPA::Error)
|
73
|
+
}.to raise_error(SEPA::Error, /Name is too short/)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -158,7 +158,7 @@ describe SEPA::DirectDebit do
|
|
158
158
|
it 'should fail for pain.008.002.02' do
|
159
159
|
expect {
|
160
160
|
subject.to_xml(SEPA::PAIN_008_002_02)
|
161
|
-
}.to raise_error(SEPA::Error)
|
161
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
162
162
|
end
|
163
163
|
|
164
164
|
it 'should validate against pain.008.001.02' do
|
@@ -256,7 +256,7 @@ describe SEPA::DirectDebit do
|
|
256
256
|
end
|
257
257
|
|
258
258
|
it 'should create valid XML file' do
|
259
|
-
expect(subject).to validate_against('pain.008.
|
259
|
+
expect(subject).to validate_against('pain.008.001.02.xsd')
|
260
260
|
end
|
261
261
|
|
262
262
|
it 'should have creditor identifier' do
|
@@ -385,7 +385,7 @@ describe SEPA::DirectDebit do
|
|
385
385
|
it 'should raise error on XML generation' do
|
386
386
|
expect {
|
387
387
|
subject.to_xml
|
388
|
-
}.to raise_error(SEPA::Error)
|
388
|
+
}.to raise_error(SEPA::Error, /CORE, COR1 AND B2B must not be mixed in one message/)
|
389
389
|
end
|
390
390
|
end
|
391
391
|
|
@@ -516,7 +516,7 @@ describe SEPA::DirectDebit do
|
|
516
516
|
end
|
517
517
|
|
518
518
|
it 'should create valid XML file' do
|
519
|
-
expect(subject).to validate_against('pain.008.
|
519
|
+
expect(subject).to validate_against('pain.008.001.02.xsd')
|
520
520
|
end
|
521
521
|
|
522
522
|
it 'should contain <InstrId>' do
|
@@ -533,7 +533,7 @@ describe SEPA::DirectDebit do
|
|
533
533
|
end
|
534
534
|
|
535
535
|
it 'should fail as the payment identification becomes too large' do
|
536
|
-
expect { subject.to_xml }.to raise_error(SEPA::Error)
|
536
|
+
expect { subject.to_xml }.to raise_error(SEPA::Error, /The value has a length of '37'; this exceeds the allowed maximum length of '35'/)
|
537
537
|
end
|
538
538
|
end
|
539
539
|
|
@@ -546,7 +546,7 @@ describe SEPA::DirectDebit do
|
|
546
546
|
sct
|
547
547
|
end
|
548
548
|
|
549
|
-
it 'should validate against pain.
|
549
|
+
it 'should validate against pain.008.001.02' do
|
550
550
|
expect(subject.to_xml(SEPA::PAIN_008_001_02)).to validate_against('pain.008.001.02.xsd')
|
551
551
|
end
|
552
552
|
|
@@ -562,13 +562,13 @@ describe SEPA::DirectDebit do
|
|
562
562
|
it 'should fail for pain.008.002.02' do
|
563
563
|
expect {
|
564
564
|
subject.to_xml(SEPA::PAIN_008_002_02)
|
565
|
-
}.to raise_error(SEPA::Error)
|
565
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
566
566
|
end
|
567
567
|
|
568
568
|
it 'should fail for pain.008.003.02' do
|
569
569
|
expect {
|
570
570
|
subject.to_xml(SEPA::PAIN_008_003_02)
|
571
|
-
}.to raise_error(SEPA::Error)
|
571
|
+
}.to raise_error(SEPA::Error, /Incompatible with schema/)
|
572
572
|
end
|
573
573
|
end
|
574
574
|
end
|
data/spec/validator_spec.rb
CHANGED
@@ -61,11 +61,29 @@ describe SEPA::CreditorIdentifierValidator do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'should accept valid creditor_identifier' do
|
64
|
-
expect(Validatable).to accept(
|
64
|
+
expect(Validatable).to accept(
|
65
|
+
'DE98ZZZ09999999999',
|
66
|
+
'CH0712300000012345',
|
67
|
+
'SE97ZZZ1234567890',
|
68
|
+
'PL97ZZZ0123456789',
|
69
|
+
'NO97ZZZ123456785',
|
70
|
+
'HU74111A12345676',
|
71
|
+
'BG32ZZZ100064095',
|
72
|
+
'AT12ZZZ00000000001',
|
73
|
+
'FR12ZZZ123456',
|
74
|
+
'NL97ZZZ123456780001',
|
75
|
+
for: [:creditor_identifier, :crid]
|
76
|
+
)
|
65
77
|
end
|
66
78
|
|
67
79
|
it 'should not accept an invalid creditor_identifier' do
|
68
|
-
expect(Validatable).not_to accept(
|
80
|
+
expect(Validatable).not_to accept(
|
81
|
+
'',
|
82
|
+
'xxx',
|
83
|
+
'DE98ZZZ099999999990',
|
84
|
+
'DE98---09999999999',
|
85
|
+
for: [:creditor_identifier, :crid]
|
86
|
+
)
|
69
87
|
end
|
70
88
|
|
71
89
|
it "should customize error message" do
|
@@ -88,12 +106,12 @@ describe SEPA::MandateIdentifierValidator do
|
|
88
106
|
end
|
89
107
|
|
90
108
|
it 'should not accept an invalid mandate_identifier' do
|
91
|
-
expect(Validatable).not_to accept(nil, '', 'X' * 36, '
|
109
|
+
expect(Validatable).not_to accept(nil, '', 'X' * 36, '#/*', 'Ümläüt', for: [:mandate_id, :mid])
|
92
110
|
end
|
93
111
|
|
94
112
|
it "should customize error message" do
|
95
|
-
v = Validatable.new(:mandate_id => '
|
113
|
+
v = Validatable.new(:mandate_id => '*** 123')
|
96
114
|
v.valid?
|
97
|
-
expect(v.errors[:mandate_id]).to eq(['
|
115
|
+
expect(v.errors[:mandate_id]).to eq(['*** 123 seems wrong'])
|
98
116
|
end
|
99
117
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepa_king
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Leciejewski
|
8
8
|
- Georg Ledermann
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '4.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '4.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: nokogiri
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
85
|
+
name: coveralls_reborn
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - ">="
|
@@ -123,31 +123,29 @@ dependencies:
|
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
-
description: Implemention of
|
126
|
+
description: Implemention of Payments Initiation (ISO 20022)
|
127
127
|
email:
|
128
128
|
- gl@salesking.eu
|
129
|
-
-
|
129
|
+
- georg@ledermann.dev
|
130
130
|
executables: []
|
131
131
|
extensions: []
|
132
132
|
extra_rdoc_files: []
|
133
133
|
files:
|
134
|
+
- ".github/workflows/main.yml"
|
134
135
|
- ".gitignore"
|
135
136
|
- ".rspec"
|
136
|
-
- ".travis.yml"
|
137
137
|
- CONTRIBUTING.md
|
138
138
|
- Gemfile
|
139
139
|
- LICENSE.txt
|
140
140
|
- README.md
|
141
141
|
- Rakefile
|
142
|
-
- gemfiles/Gemfile-activemodel-3.1.x
|
143
|
-
- gemfiles/Gemfile-activemodel-3.2.x
|
144
|
-
- gemfiles/Gemfile-activemodel-4.0.x
|
145
|
-
- gemfiles/Gemfile-activemodel-4.1.x
|
146
142
|
- gemfiles/Gemfile-activemodel-4.2.x
|
147
143
|
- gemfiles/Gemfile-activemodel-5.0.x
|
148
144
|
- gemfiles/Gemfile-activemodel-5.1.x
|
149
145
|
- gemfiles/Gemfile-activemodel-5.2.x
|
150
146
|
- gemfiles/Gemfile-activemodel-6.0.x
|
147
|
+
- gemfiles/Gemfile-activemodel-6.1.x
|
148
|
+
- gemfiles/Gemfile-activemodel-7.0.x
|
151
149
|
- lib/schema/pain.001.001.03.ch.02.xsd
|
152
150
|
- lib/schema/pain.001.001.03.xsd
|
153
151
|
- lib/schema/pain.001.002.03.xsd
|
@@ -196,11 +194,11 @@ files:
|
|
196
194
|
- spec/transaction_spec.rb
|
197
195
|
- spec/validation_spec.rb
|
198
196
|
- spec/validator_spec.rb
|
199
|
-
homepage:
|
197
|
+
homepage: https://github.com/salesking/sepa_king
|
200
198
|
licenses:
|
201
199
|
- MIT
|
202
200
|
metadata: {}
|
203
|
-
post_install_message:
|
201
|
+
post_install_message:
|
204
202
|
rdoc_options: []
|
205
203
|
require_paths:
|
206
204
|
- lib
|
@@ -208,39 +206,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
206
|
requirements:
|
209
207
|
- - ">="
|
210
208
|
- !ruby/object:Gem::Version
|
211
|
-
version: '2.
|
209
|
+
version: '2.7'
|
212
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
211
|
requirements:
|
214
212
|
- - ">="
|
215
213
|
- !ruby/object:Gem::Version
|
216
214
|
version: '0'
|
217
215
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
219
|
-
signing_key:
|
216
|
+
rubygems_version: 3.3.11
|
217
|
+
signing_key:
|
220
218
|
specification_version: 4
|
221
219
|
summary: Ruby gem for creating SEPA XML files
|
222
|
-
test_files:
|
223
|
-
- spec/account_spec.rb
|
224
|
-
- spec/converter_spec.rb
|
225
|
-
- spec/credit_transfer_spec.rb
|
226
|
-
- spec/credit_transfer_transaction_spec.rb
|
227
|
-
- spec/creditor_account_spec.rb
|
228
|
-
- spec/debtor_account_spec.rb
|
229
|
-
- spec/debtor_address_spec.rb
|
230
|
-
- spec/direct_debit_spec.rb
|
231
|
-
- spec/direct_debit_transaction_spec.rb
|
232
|
-
- spec/examples/pain.001.001.03.ch.02.xml
|
233
|
-
- spec/examples/pain.001.001.03.xml
|
234
|
-
- spec/examples/pain.001.002.03.xml
|
235
|
-
- spec/examples/pain.001.003.03.xml
|
236
|
-
- spec/examples/pain.008.002.02.xml
|
237
|
-
- spec/examples/pain.008.003.02.xml
|
238
|
-
- spec/message_spec.rb
|
239
|
-
- spec/spec_helper.rb
|
240
|
-
- spec/support/active_model.rb
|
241
|
-
- spec/support/custom_matcher.rb
|
242
|
-
- spec/support/factories.rb
|
243
|
-
- spec/support/validations.rb
|
244
|
-
- spec/transaction_spec.rb
|
245
|
-
- spec/validation_spec.rb
|
246
|
-
- spec/validator_spec.rb
|
220
|
+
test_files: []
|
data/.travis.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
rvm:
|
2
|
-
- 2.2.10
|
3
|
-
- 2.3.8
|
4
|
-
- 2.4.6
|
5
|
-
- 2.5.5
|
6
|
-
- 2.6.3
|
7
|
-
gemfile:
|
8
|
-
- gemfiles/Gemfile-activemodel-3.1.x
|
9
|
-
- gemfiles/Gemfile-activemodel-3.2.x
|
10
|
-
- gemfiles/Gemfile-activemodel-4.0.x
|
11
|
-
- gemfiles/Gemfile-activemodel-4.1.x
|
12
|
-
- gemfiles/Gemfile-activemodel-4.2.x
|
13
|
-
- gemfiles/Gemfile-activemodel-5.0.x
|
14
|
-
- gemfiles/Gemfile-activemodel-5.1.x
|
15
|
-
- gemfiles/Gemfile-activemodel-5.2.x
|
16
|
-
- gemfiles/Gemfile-activemodel-6.0.x
|
17
|
-
matrix:
|
18
|
-
exclude:
|
19
|
-
- rvm: 2.2.10
|
20
|
-
gemfile: gemfiles/Gemfile-activemodel-6.0.x
|
21
|
-
- rvm: 2.3.8
|
22
|
-
gemfile: gemfiles/Gemfile-activemodel-6.0.x
|
23
|
-
- rvm: 2.4.6
|
24
|
-
gemfile: gemfiles/Gemfile-activemodel-4.1.x
|
25
|
-
- rvm: 2.4.6
|
26
|
-
gemfile: gemfiles/Gemfile-activemodel-4.2.x
|
27
|
-
- rvm: 2.4.6
|
28
|
-
gemfile: gemfiles/Gemfile-activemodel-6.0.x
|
29
|
-
- rvm: 2.5.5
|
30
|
-
gemfile: gemfiles/Gemfile-activemodel-4.1.x
|
31
|
-
- rvm: 2.5.5
|
32
|
-
gemfile: gemfiles/Gemfile-activemodel-4.2.x
|
33
|
-
- rvm: 2.6.3
|
34
|
-
gemfile: gemfiles/Gemfile-activemodel-4.1.x
|
35
|
-
- rvm: 2.6.3
|
36
|
-
gemfile: gemfiles/Gemfile-activemodel-4.2.x
|
37
|
-
sudo: false
|