ibandit 1.26.0 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d22738b3515fcec3aaffd4be2e5b7bac071777a4208a54d517f1056da6004485
4
- data.tar.gz: 8ee04a84a15bd1ece8a3df16e860cf1dff856bacdeb49a0e62b36be55a14f1a5
3
+ metadata.gz: a99f67bf19bbafcd698958dbc738605c8b95a1ca09b7a2cda79d73de33eae869
4
+ data.tar.gz: 40211f0b48e6767d4c93b3a21917e7b344334242720e2d51e66363368ab460d2
5
5
  SHA512:
6
- metadata.gz: 77f04e2e1c130fb8b2922ef44f98fee14aed7b80fff374c2bc91e3b7833ffef87a03ef258663a646b71ade254a843b27d0979ee996717f294e755e34eeeb86cd
7
- data.tar.gz: dab649faa80c951a36b42502afa9391120d97d3f6a40f6b466dc0be657ba3903c086d480419a4489c412b3f87a7fcab2d54c0ecb6eca6c0b5dbc28c25b75e929
6
+ metadata.gz: 529427c565fb8d8a599f38a3dee0e1ed3e9a9897e3efd8d6e54fcde6538ff32fef85391a301fff1d63942d6e940783be97add81d3ae7918d5ba9354ff010be2d
7
+ data.tar.gz: 7f776180378e14d54a5d51bffb1c022a6a3e15920fd312fae7c54220c39740c4dbe440c34a06a70d7cb8635befb939a2d611dfe514e86f351e55d67cc3fcc7c5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.26.1 - July 4, 2025
2
+
3
+ - Gracefully fail validation for NZ accounts if no account number is provided
4
+
1
5
  ## 1.26.0 - July 1, 2025
2
6
 
3
7
  - Update BLZ data - BLZ_20250609
data/lib/ibandit/iban.rb CHANGED
@@ -56,12 +56,14 @@ module Ibandit
56
56
  end
57
57
 
58
58
  def account_number
59
+ return nil if @account_number.nil?
59
60
  return @account_number unless country_code == "NZ"
60
61
 
61
62
  @account_number[0..6]
62
63
  end
63
64
 
64
65
  def account_number_suffix
66
+ return nil if @account_number.nil?
65
67
  return nil unless country_code == "NZ"
66
68
 
67
69
  @account_number[7..]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.26.0"
4
+ VERSION = "1.26.1"
5
5
  end
@@ -799,6 +799,24 @@ describe Ibandit::IBAN do
799
799
  its(:to_s) { is_expected.to eq("") }
800
800
  end
801
801
 
802
+ context "with a nil account number" do
803
+ let(:account_number) { nil }
804
+
805
+ its(:country_code) { is_expected.to eq("NZ") }
806
+ its(:bank_code) { is_expected.to eq("11") }
807
+ its(:branch_code) { is_expected.to eq("2222") }
808
+ its(:account_number) { is_expected.to eq(nil) }
809
+ its(:account_number_suffix) { is_expected.to eq(nil) }
810
+ its(:swift_bank_code) { is_expected.to eq("11") }
811
+ its(:swift_branch_code) { is_expected.to eq("2222") }
812
+ its(:swift_account_number) { is_expected.to eq(nil) }
813
+ its(:swift_national_id) { is_expected.to eq("112222") }
814
+ its(:iban) { is_expected.to be_nil }
815
+ its(:pseudo_iban) { is_expected.to eq(nil) }
816
+ its(:valid?) { is_expected.to eq(false) }
817
+ its(:to_s) { is_expected.to eq("") }
818
+ end
819
+
802
820
  context "with bank and branch code embedded in account_number field" do
803
821
  let(:arg) do
804
822
  {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.26.0
4
+ version: 1.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-01 00:00:00.000000000 Z
10
+ date: 2025-07-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: i18n