sepa_king 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/gemfiles/Gemfile-activemodel-5.0.x +1 -1
- data/lib/sepa_king/converter.rb +2 -6
- data/lib/sepa_king/version.rb +1 -1
- data/lib/sepa_king.rb +0 -3
- data/sepa_king.gemspec +2 -3
- data/spec/converter_spec.rb +3 -3
- data/spec/direct_debit_spec.rb +5 -5
- data/spec/spec_helper.rb +0 -4
- metadata +9 -26
- data/lib/sepa_king/core_ext/string.rb +0 -27
- data/spec/core_ext/string_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55e01a727d2ad4cb40cc2f284f1e77149781359
|
4
|
+
data.tar.gz: f8a2b539e05d97d6630a260b91362c7ecc7fb2b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a4b696964158725ee468d65a00839bb37d0e7d2939bccb17d0ccb25e24ad14b2160ec7acb22c1ba045e0047f6a5866bf96602e3b26406436b2120bb6c11639
|
7
|
+
data.tar.gz: c78387d1c6fd870f045b1ae37eb8b3d7a1aae21ec68604e00b00c75b0ad8cc584a55872534890e525d2d1e37183fc0d7bf27818def85ea7d8fc6f7fe0688eba4
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ This gem implements the following two messages out of the ISO 20022 standard:
|
|
16
16
|
* Credit Transfer Initiation (`pain.001.003.03`, `pain.001.002.03` and `pain.001.001.03`)
|
17
17
|
* Direct Debit Initiation (`pain.008.003.02`, `pain.008.002.02` and `pain.008.001.02`)
|
18
18
|
|
19
|
-
|
19
|
+
It handles the _Specification of Data Formats_ v2.7 (2013-11-04).
|
20
20
|
|
21
21
|
BTW: **pain** is a shortcut for **Pa**yment **In**itiation.
|
22
22
|
|
data/lib/sepa_king/converter.rb
CHANGED
@@ -20,20 +20,16 @@ module SEPA
|
|
20
20
|
|
21
21
|
value.to_s.
|
22
22
|
# Replace some special characters described as "Best practices" in Chapter 6.2 of this document:
|
23
|
-
# http://www.europeanpaymentscouncil.eu/index.cfm/knowledge-bank/epc-documents/sepa-requirements-for-an-extended-character-set-unicode-subset-best-practices/
|
23
|
+
# http://www.europeanpaymentscouncil.eu/index.cfm/knowledge-bank/epc-documents/sepa-requirements-for-an-extended-character-set-unicode-subset-best-practices/
|
24
24
|
gsub('€','E').
|
25
25
|
gsub('@','(at)').
|
26
|
-
gsub('&', '+').
|
27
26
|
gsub('_','-').
|
28
27
|
|
29
|
-
# Replace non-ASCII characters with an ASCII approximation
|
30
|
-
i18n_transliterate.
|
31
|
-
|
32
28
|
# Replace linebreaks by spaces
|
33
29
|
gsub(/\n+/,' ').
|
34
30
|
|
35
31
|
# Remove all invalid characters
|
36
|
-
gsub(/[^a-zA-Z0-9
|
32
|
+
gsub(/[^a-zA-Z0-9ÄÖÜäöüß&*$%\ \'\:\?\,\-\(\+\.\)\/]/, '').
|
37
33
|
|
38
34
|
# Remove leading and trailing spaces
|
39
35
|
strip
|
data/lib/sepa_king/version.rb
CHANGED
data/lib/sepa_king.rb
CHANGED
data/sepa_king.gemspec
CHANGED
@@ -21,14 +21,13 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.required_ruby_version = '>= 1.9.3'
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'activemodel', '>= 3.0.0'
|
24
|
-
s.add_runtime_dependency 'i18n'
|
25
24
|
s.add_runtime_dependency 'builder'
|
26
25
|
s.add_runtime_dependency 'iban-tools'
|
27
26
|
|
28
27
|
s.add_development_dependency 'bundler'
|
29
|
-
s.add_development_dependency 'rspec'
|
28
|
+
s.add_development_dependency 'rspec'
|
30
29
|
s.add_development_dependency 'coveralls'
|
31
|
-
s.add_development_dependency 'simplecov', '~> 0.11.
|
30
|
+
s.add_development_dependency 'simplecov', '~> 0.11.2'
|
32
31
|
s.add_development_dependency 'rake'
|
33
32
|
s.add_development_dependency 'nokogiri'
|
34
33
|
end
|
data/spec/converter_spec.rb
CHANGED
@@ -6,14 +6,14 @@ describe SEPA::Converter do
|
|
6
6
|
|
7
7
|
describe :convert_text do
|
8
8
|
it 'should convert special chars' do
|
9
|
-
expect(convert_text('GmbH & Co. KG')).to eq('GmbH + Co. KG')
|
10
9
|
expect(convert_text('10€')).to eq('10E')
|
11
10
|
expect(convert_text('info@bundesbank.de')).to eq('info(at)bundesbank.de')
|
12
11
|
expect(convert_text('abc_def')).to eq('abc-def')
|
13
12
|
end
|
14
13
|
|
15
|
-
it 'should
|
16
|
-
expect(convert_text('üöäÜÖÄß')).to eq('
|
14
|
+
it 'should not change allowed special character' do
|
15
|
+
expect(convert_text('üöäÜÖÄß')).to eq('üöäÜÖÄß')
|
16
|
+
expect(convert_text('&*$%')).to eq('&*$%')
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'should convert line breaks' do
|
data/spec/direct_debit_spec.rb
CHANGED
@@ -198,7 +198,7 @@ describe SEPA::DirectDebit do
|
|
198
198
|
end
|
199
199
|
|
200
200
|
it 'should contain <Cdtr>' do
|
201
|
-
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/Cdtr/Nm', '
|
201
|
+
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/Cdtr/Nm', 'Gläubiger GmbH')
|
202
202
|
end
|
203
203
|
|
204
204
|
it 'should contain <CdtrAcct>' do
|
@@ -239,8 +239,8 @@ describe SEPA::DirectDebit do
|
|
239
239
|
end
|
240
240
|
|
241
241
|
it 'should contain <Dbtr>' do
|
242
|
-
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[1]/Dbtr/Nm', 'Zahlemann
|
243
|
-
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[2]/Dbtr/Nm', 'Meier
|
242
|
+
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[1]/Dbtr/Nm', 'Zahlemann & Söhne GbR')
|
243
|
+
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[2]/Dbtr/Nm', 'Meier & Schulze oHG')
|
244
244
|
end
|
245
245
|
|
246
246
|
it 'should contain <DbtrAcct>' do
|
@@ -250,7 +250,7 @@ describe SEPA::DirectDebit do
|
|
250
250
|
|
251
251
|
it 'should contain <RmtInf>' do
|
252
252
|
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[1]/RmtInf/Ustrd', 'Unsere Rechnung vom 10.08.2013')
|
253
|
-
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[2]/RmtInf/Ustrd', 'Vielen Dank
|
253
|
+
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf/DrctDbtTxInf[2]/RmtInf/Ustrd', 'Vielen Dank für Ihren Einkauf')
|
254
254
|
end
|
255
255
|
end
|
256
256
|
|
@@ -387,7 +387,7 @@ describe SEPA::DirectDebit do
|
|
387
387
|
end
|
388
388
|
|
389
389
|
it 'should contain two payment_informations with <Cdtr>' do
|
390
|
-
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf[1]/Cdtr/Nm', '
|
390
|
+
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf[1]/Cdtr/Nm', 'Gläubiger GmbH')
|
391
391
|
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/PmtInf[2]/Cdtr/Nm', 'Creditor Inc.')
|
392
392
|
end
|
393
393
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -16,10 +16,6 @@ end
|
|
16
16
|
|
17
17
|
require 'sepa_king'
|
18
18
|
|
19
|
-
if I18n.respond_to?(:enforce_available_locales=)
|
20
|
-
I18n.enforce_available_locales = false
|
21
|
-
end
|
22
|
-
|
23
19
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
24
20
|
# in spec/support/ and its subdirectories.
|
25
21
|
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepa_king
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Leciejewski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -25,20 +25,6 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 3.0.0
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: i18n
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: builder
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,16 +71,16 @@ dependencies:
|
|
85
71
|
name: rspec
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
87
73
|
requirements:
|
88
|
-
- - "
|
74
|
+
- - ">="
|
89
75
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
76
|
+
version: '0'
|
91
77
|
type: :development
|
92
78
|
prerelease: false
|
93
79
|
version_requirements: !ruby/object:Gem::Requirement
|
94
80
|
requirements:
|
95
|
-
- - "
|
81
|
+
- - ">="
|
96
82
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
83
|
+
version: '0'
|
98
84
|
- !ruby/object:Gem::Dependency
|
99
85
|
name: coveralls
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,14 +101,14 @@ dependencies:
|
|
115
101
|
requirements:
|
116
102
|
- - "~>"
|
117
103
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.11.
|
104
|
+
version: 0.11.2
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
108
|
requirements:
|
123
109
|
- - "~>"
|
124
110
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.11.
|
111
|
+
version: 0.11.2
|
126
112
|
- !ruby/object:Gem::Dependency
|
127
113
|
name: rake
|
128
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,7 +171,6 @@ files:
|
|
185
171
|
- lib/sepa_king/account/creditor_account.rb
|
186
172
|
- lib/sepa_king/account/debtor_account.rb
|
187
173
|
- lib/sepa_king/converter.rb
|
188
|
-
- lib/sepa_king/core_ext/string.rb
|
189
174
|
- lib/sepa_king/message.rb
|
190
175
|
- lib/sepa_king/message/credit_transfer.rb
|
191
176
|
- lib/sepa_king/message/direct_debit.rb
|
@@ -197,7 +182,6 @@ files:
|
|
197
182
|
- sepa_king.gemspec
|
198
183
|
- spec/account_spec.rb
|
199
184
|
- spec/converter_spec.rb
|
200
|
-
- spec/core_ext/string_spec.rb
|
201
185
|
- spec/credit_transfer_spec.rb
|
202
186
|
- spec/credit_transfer_transaction_spec.rb
|
203
187
|
- spec/creditor_account_spec.rb
|
@@ -238,14 +222,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
222
|
version: '0'
|
239
223
|
requirements: []
|
240
224
|
rubyforge_project:
|
241
|
-
rubygems_version: 2.6.
|
225
|
+
rubygems_version: 2.6.6
|
242
226
|
signing_key:
|
243
227
|
specification_version: 4
|
244
228
|
summary: Ruby gem for creating SEPA XML files
|
245
229
|
test_files:
|
246
230
|
- spec/account_spec.rb
|
247
231
|
- spec/converter_spec.rb
|
248
|
-
- spec/core_ext/string_spec.rb
|
249
232
|
- spec/credit_transfer_spec.rb
|
250
233
|
- spec/credit_transfer_transaction_spec.rb
|
251
234
|
- spec/creditor_account_spec.rb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# Extend String class to use I18n.transliterate as an instance method
|
4
|
-
#
|
5
|
-
# To have a better ASCII approximation for some languages, it's strongly
|
6
|
-
# recommended to add custom rules in your I18n dictionary like this
|
7
|
-
# example for Germany:
|
8
|
-
#
|
9
|
-
# de:
|
10
|
-
# i18n:
|
11
|
-
# transliterate:
|
12
|
-
# rule:
|
13
|
-
# Ä: 'Ae'
|
14
|
-
# Ö: 'Oe'
|
15
|
-
# Ü: 'Ue'
|
16
|
-
# ä: 'ae'
|
17
|
-
# ö: 'oe'
|
18
|
-
# ü: 'ue'
|
19
|
-
# ß: 'ss'
|
20
|
-
#
|
21
|
-
# Because this stuff is out of scope of this gem, we don't include the rules here
|
22
|
-
|
23
|
-
String.class_eval do
|
24
|
-
def i18n_transliterate(replacement='?')
|
25
|
-
I18n.transliterate(self, replacement)
|
26
|
-
end
|
27
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe String do
|
5
|
-
describe :i18n_transliterate do
|
6
|
-
it 'should use I18n.transliterate' do
|
7
|
-
expect('Ærøskøbing'.i18n_transliterate).to eq('AEroskobing')
|
8
|
-
expect('Jürgen'.i18n_transliterate).to eq('Jurgen')
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|