ibandit 0.11.24 → 0.11.25
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 +8 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25eea6c456d9782856e5600061dc8414d90f651a
|
4
|
+
data.tar.gz: c81156af68d0817c88dd9faad9a908a7a75bab2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 343b1bf9e56d78bc6ee805e75d260f20596770d3ff7b9ce6107579cad1dee21d9cbdec714fa7b7c0c4fd59f2facd8ab5e290ccfe4238cba82fca014f321b3511
|
7
|
+
data.tar.gz: 45ddb672d2b7db64b3c2dec6bceb6e3b87be62dda0cca036b0f55d77f9e9756e6ad454fd257ab3610d98d1de9206786fb31022816dae13fa61e2e97ad491ec95
|
data/CHANGELOG.md
CHANGED
data/lib/ibandit/iban.rb
CHANGED
@@ -373,7 +373,7 @@ module Ibandit
|
|
373
373
|
def valid_australian_details?
|
374
374
|
return true unless country_code == "AU"
|
375
375
|
|
376
|
-
bsb_check?
|
376
|
+
bsb_check? && account_number_not_all_zeros?
|
377
377
|
end
|
378
378
|
|
379
379
|
def bsb_check?
|
@@ -512,5 +512,12 @@ module Ibandit
|
|
512
512
|
return false if input.nil?
|
513
513
|
input.slice(2, 2) == Constants::PSEUDO_IBAN_CHECK_DIGITS
|
514
514
|
end
|
515
|
+
|
516
|
+
def account_number_not_all_zeros?
|
517
|
+
return true if @swift_account_number.to_s.chars.uniq != ["0"]
|
518
|
+
|
519
|
+
@errors[:account_number] = Ibandit.translate(:is_invalid)
|
520
|
+
false
|
521
|
+
end
|
515
522
|
end
|
516
523
|
end
|
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -273,6 +273,23 @@ describe Ibandit::IBAN do
|
|
273
273
|
its(:valid?) { is_expected.to eq(true) }
|
274
274
|
its(:to_s) { is_expected.to eq("") }
|
275
275
|
end
|
276
|
+
|
277
|
+
context "and an account number that is all zero" do
|
278
|
+
let(:account_number) { "000000" }
|
279
|
+
|
280
|
+
its(:country_code) { is_expected.to eq("AU") }
|
281
|
+
its(:bank_code) { is_expected.to be_nil }
|
282
|
+
its(:branch_code) { is_expected.to eq("123456") }
|
283
|
+
its(:account_number) { is_expected.to eq("0000000000") }
|
284
|
+
its(:swift_bank_code) { is_expected.to be_nil }
|
285
|
+
its(:swift_branch_code) { is_expected.to eq("123456") }
|
286
|
+
its(:swift_account_number) { is_expected.to eq("0000000000") }
|
287
|
+
its(:swift_national_id) { is_expected.to eq("123456") }
|
288
|
+
its(:iban) { is_expected.to be_nil }
|
289
|
+
its(:pseudo_iban) { is_expected.to eq("AUZZ1234560000000000") }
|
290
|
+
its(:valid?) { is_expected.to eq(false) }
|
291
|
+
its(:to_s) { is_expected.to eq("") }
|
292
|
+
end
|
276
293
|
end
|
277
294
|
|
278
295
|
context "when the IBAN was created from an Australian pseudo-IBAN" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibandit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
212
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.6.14
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Convert national banking details into IBANs, and vice-versa.
|