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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f8f92719cd4de9683bfd0c36a84550b67a0ab89f99ae760f6f2105f9b5ddd62
4
- data.tar.gz: 0b1e3547051b10705bfbc75e924611875170b2324085f1db509060ec84c59890
3
+ metadata.gz: 59b71293c8cd665cfb42ceee4f5216553d32246a17a30df647bd7f084c8d8cb1
4
+ data.tar.gz: b1e0709ad2457b23e89936ece46e70c8f7779b9bbaefb80a23cbad9dae57b3fe
5
5
  SHA512:
6
- metadata.gz: b368ac91d2fa12f4691a165b0de4150a23e8c5a0a14b04b9ac17d4cc496d594a9cbf0308fec594afccbfed262bb8557bceabfe1a453c11df5e24093fa970783a
7
- data.tar.gz: 591482c2f7f33c37515214084c708a061cedce5d0575f20a1fd63bc642b53b7a3a223785640ae7b8736a40ee9de5a0ab30828b0b2d4c27e40f5187f2f38ecfb7
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.24.0"
4
+ VERSION = "1.25.0"
5
5
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.0
4
+ version: 1.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless