ibandit 1.24.0 → 1.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ibandit/iban.rb +1 -0
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b71293c8cd665cfb42ceee4f5216553d32246a17a30df647bd7f084c8d8cb1
|
4
|
+
data.tar.gz: b1e0709ad2457b23e89936ece46e70c8f7779b9bbaefb80a23cbad9dae57b3fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e5cd5a8c6be145321f15cbb55da328828df5f089b524e74c33eca4216202fed477e4d881a1d111a53287a22988f828e94fee1ce758c5197781590f5c003b878
|
7
|
+
data.tar.gz: dbe36b9e0396322e9b168647e74cbe86af65c5fb4fcc160385c842db6886ba8932278cd0f3808669734da5f45cfb8aea24484a038349ec3e147c23b59f67288e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.25.0 - February 18, 2025
|
2
|
+
|
3
|
+
- `SE` pseudo-ibans no longer fail validation due to the `ZZ` check digit.
|
4
|
+
|
1
5
|
## 1.24.0 - February 18, 2025
|
2
6
|
|
3
7
|
- Fix validation for SE IBANs where the account number starts with a 0 and the clearing number is not included in the IBAN
|
data/lib/ibandit/iban.rb
CHANGED
@@ -128,6 +128,7 @@ module Ibandit
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def valid_check_digits?
|
131
|
+
return true if source == :pseudo_iban && check_digits == Constants::PSEUDO_IBAN_CHECK_DIGITS
|
131
132
|
return unless decomposable? && valid_characters?
|
132
133
|
|
133
134
|
expected_check_digits = CheckDigit.iban(country_code, bban)
|
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -183,6 +183,7 @@ describe Ibandit::IBAN do
|
|
183
183
|
its(:iban) { is_expected.to eq("SE5412000000012810105723") }
|
184
184
|
its(:pseudo_iban) { is_expected.to eq("SEZZX1281XXX0105723") }
|
185
185
|
its(:to_s) { is_expected.to eq("SE5412000000012810105723") }
|
186
|
+
its(:valid?) { is_expected.to eq(true) }
|
186
187
|
|
187
188
|
context "and the clearing code is not part of the IBAN" do
|
188
189
|
context "and the branch code allows for zero-filling of short account numbers" do
|
@@ -266,9 +267,17 @@ describe Ibandit::IBAN do
|
|
266
267
|
its(:iban) { is_expected.to eq("SE5412000000012810105723") }
|
267
268
|
its(:pseudo_iban) { is_expected.to eq("SEZZX1281XXX0105723") }
|
268
269
|
its(:to_s) { is_expected.to eq("SE5412000000012810105723") }
|
270
|
+
its(:valid?) { is_expected.to eq(true) }
|
269
271
|
end
|
270
272
|
|
271
273
|
context "when the IBAN was created from a Swedish IBAN" do
|
274
|
+
context "with check digits that make it look like a pseudo-IBAN" do
|
275
|
+
let(:arg) { "SEZZ30000000031231234567" }
|
276
|
+
|
277
|
+
its(:country_code) { is_expected.to eq("SE") }
|
278
|
+
its(:valid?) { is_expected.to eq(false) }
|
279
|
+
end
|
280
|
+
|
272
281
|
context "where the clearing code is part of the account number" do
|
273
282
|
let(:arg) { "SE4730000000031231234567" }
|
274
283
|
|