ibandit 1.32.0 → 1.34.0

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.
@@ -35,7 +35,7 @@ NZ:
35
35
  :account_number_length: 10
36
36
  :bank_code_format: "\\d{2}"
37
37
  :branch_code_format: "\\d{4}"
38
- :account_number_format: "\\d{7}\\d{3}"
38
+ :account_number_format: "\\d{7}0\\d{2}"
39
39
  :pseudo_iban_bank_code_length: 2
40
40
  :pseudo_iban_branch_code_length: 4
41
41
  :pseudo_iban_account_number_length: 10
data/data/structures.yml CHANGED
@@ -1598,7 +1598,7 @@ NZ:
1598
1598
  :account_number_length: 10
1599
1599
  :bank_code_format: "\\d{2}"
1600
1600
  :branch_code_format: "\\d{4}"
1601
- :account_number_format: "\\d{7}\\d{3}"
1601
+ :account_number_format: "\\d{7}0\\d{2}"
1602
1602
  :pseudo_iban_bank_code_length: 2
1603
1603
  :pseudo_iban_branch_code_length: 4
1604
1604
  :pseudo_iban_account_number_length: 10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.32.0"
4
+ VERSION = "1.34.0"
5
5
  end
@@ -12,15 +12,6 @@
12
12
  { "bank_code": "10060198", "account_number" : "1" }
13
13
  ]
14
14
  },
15
- // {
16
- // "convertor": "000300",
17
- // "valid": [
18
- // { "bank_code": "51010800", "account_number" : "1" }
19
- // ],
20
- // "invalid": [
21
- // { "bank_code": "51010800", "account_number" : "6161604670" }
22
- // ]
23
- // },
24
15
  {
25
16
  "convertor": "000400",
26
17
  "valid": [
@@ -91,12 +82,6 @@
91
82
  {"bank_code":"51020000","account_number":"30009963","converted_bank_code":"50020200","converted_account_number":"30009963"}
92
83
  ]
93
84
  },
94
- // {
95
- // "convertor": "000900",
96
- // "valid": [
97
- // {"bank_code":"68351976","account_number":"1116232594","converted_bank_code":"68351557","converted_account_number":"3047232594"}
98
- // ]
99
- // },
100
85
  {
101
86
  "convertor": "001001",
102
87
  "valid": [
@@ -157,10 +142,4 @@
157
142
  { "bank_code": "30060010", "account_number": "12345678", "converted_account_number": "12345678" }
158
143
  ]
159
144
  }
160
- // {
161
- // "convertor": "001900",
162
- // "valid": [
163
- // { "bank_code": "50130100", "account_number": "556", "converted_bank_code": "50120383" }
164
- // ]
165
- // }
166
145
  ]
@@ -136,12 +136,6 @@
136
136
  { "bank_code": "10010010", "account_number" : "556", "converted_account_number": "0120440110" }
137
137
  ]
138
138
  },
139
- // {
140
- // "convertor": "001900",
141
- // "valid": [
142
- // { "bank_code": "10010010", "account_number" : "1234567890", "converted_bank_code": "50120383" }
143
- // ]
144
- // },
145
139
  {
146
140
  "convertor": "002002",
147
141
  "valid": [
@@ -764,23 +764,34 @@ describe Ibandit::IBAN do
764
764
  end
765
765
 
766
766
  context "with a 3 digit account number suffix" do
767
- let(:account_number) { "3333333-944" }
767
+ let(:account_number) { "3333333-044" }
768
768
 
769
769
  its(:country_code) { is_expected.to eq("NZ") }
770
770
  its(:bank_code) { is_expected.to eq("11") }
771
771
  its(:branch_code) { is_expected.to eq("2222") }
772
772
  its(:account_number) { is_expected.to eq("3333333") }
773
- its(:account_number_suffix) { is_expected.to eq("944") }
773
+ its(:account_number_suffix) { is_expected.to eq("044") }
774
774
  its(:swift_bank_code) { is_expected.to eq("11") }
775
775
  its(:swift_branch_code) { is_expected.to eq("2222") }
776
- its(:swift_account_number) { is_expected.to eq("3333333944") }
776
+ its(:swift_account_number) { is_expected.to eq("3333333044") }
777
777
  its(:swift_national_id) { is_expected.to eq("112222") }
778
778
  its(:iban) { is_expected.to be_nil }
779
- its(:pseudo_iban) { is_expected.to eq("NZZZ1122223333333944") }
779
+ its(:pseudo_iban) { is_expected.to eq("NZZZ1122223333333044") }
780
780
  its(:valid?) { is_expected.to eq(true) }
781
781
  its(:to_s) { is_expected.to eq("") }
782
782
  end
783
783
 
784
+ context "with a 3 digit account number suffix not starting with a zero" do
785
+ let(:account_number) { "3333333-500" }
786
+
787
+ its(:account_number_suffix) { is_expected.to eq("500") }
788
+
789
+ it "is invalid and has the correct errors" do
790
+ expect(subject.valid?).to eq(false)
791
+ expect(subject.errors).to eq(account_number: "format is invalid")
792
+ end
793
+ end
794
+
784
795
  context "with a 2 digit account number suffix" do
785
796
  let(:account_number) { "3333333-44" }
786
797
 
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.32.0
4
+ version: 1.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-07-02 00:00:00.000000000 Z
10
+ date: 2026-09-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: i18n