ibandit 1.6.1 → 1.7.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: 0f995e05ca30bd3251936bb29b847699bab4082dbfbb7ad95560b6ff5dabd635
4
- data.tar.gz: 9efe26aa718fa7425a780c31e8d6477396e48db249e43b666f3fd3188d1f4260
3
+ metadata.gz: 3e78c332eaab4060b534f192fd94ab04e60fff177c7f92c9dcb825603e225bf1
4
+ data.tar.gz: 43424f52b17e29222857d1f0f661af2bb4d0efdd2cc3115b26798ec31987f2d3
5
5
  SHA512:
6
- metadata.gz: f87600f6e505a0c29ad2561184d17a4f072ec65d16c4c9459fcf648aeb0dbd30eae9719e04ba6c44da4b291228f64823b063e302e693fcd0c5d852e16e8ae193
7
- data.tar.gz: 47a39e9e920ddb1c2be38b43ad745ceac02341a6d027a4c69d8b04f56d32d785b8661651e438ec5745a42c800f1e64941807fee02e11a1fd4e4d04f6e06ce965
6
+ metadata.gz: edc049040b9b699cf4b3f75a755cab17c260c23d98e8c350f3f375d438c430125ad5ccd59d3567139caa141b559600ae3b062ba279841008f3bf681e72b8edf3
7
+ data.tar.gz: 9617d4a70ede223c98e991b93d3d24ac331f30ceb3d21a5d82ce84514b8eb9ac7258dce2e18dc8e04a3c084de8f78eaac00787796f89290c19861760523eaebb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.7.0 - Sept 8, 2021
2
+
3
+ - Stop padding out Australian account details to 10 digits
4
+
1
5
  ## 1.6.1 - Aug 13, 2021
2
6
 
3
7
  - Update BLZ data - BLZ_20210906
data/data/structures.yml CHANGED
@@ -983,9 +983,12 @@ EG:
983
983
  AU:
984
984
  :bank_code_length: 0
985
985
  :branch_code_length: 6
986
- :account_number_length: 10
986
+ :account_number_length: !ruby/range
987
+ begin: 5
988
+ end: 10
989
+ excl: false
987
990
  :branch_code_format: "\\d{6}"
988
- :account_number_format: "[A-Z0-9]{10}"
991
+ :account_number_format: "[A-Z0-9]{5,10}"
989
992
  :pseudo_iban_bank_code_length: 0
990
993
  :pseudo_iban_branch_code_length: 6
991
994
  :pseudo_iban_account_number_length: 10
@@ -68,14 +68,13 @@ module Ibandit
68
68
 
69
69
  def self.clean_au_details(local_details)
70
70
  # Account number may be up to 10 digits long.
71
- # Add leading zeros to account number if < 10 digits.
72
71
  #
73
72
  # Minimum account_number length is 5
74
73
  return {} unless local_details[:account_number].length >= 5
75
74
 
76
75
  {
77
76
  branch_code: local_details[:branch_code].delete("-"),
78
- account_number: local_details[:account_number].rjust(10, "0"),
77
+ account_number: local_details[:account_number],
79
78
  }
80
79
  end
81
80
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.6.1"
4
+ VERSION = "1.7.0"
5
5
  end
@@ -201,13 +201,13 @@ describe Ibandit::IBAN do
201
201
  its(:country_code) { is_expected.to eq("AU") }
202
202
  its(:bank_code) { is_expected.to be_nil }
203
203
  its(:branch_code) { is_expected.to eq("123456") }
204
- its(:account_number) { is_expected.to eq("0123456789") }
204
+ its(:account_number) { is_expected.to eq("123456789") }
205
205
  its(:swift_bank_code) { is_expected.to be_nil }
206
206
  its(:swift_branch_code) { is_expected.to eq("123456") }
207
- its(:swift_account_number) { is_expected.to eq("0123456789") }
207
+ its(:swift_account_number) { is_expected.to eq("123456789") }
208
208
  its(:swift_national_id) { is_expected.to eq("123456") }
209
209
  its(:iban) { is_expected.to be_nil }
210
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560123456789") }
210
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456_123456789") }
211
211
  its(:valid?) { is_expected.to eq(true) }
212
212
  its(:to_s) { is_expected.to eq("") }
213
213
  end
@@ -218,13 +218,13 @@ describe Ibandit::IBAN do
218
218
  its(:country_code) { is_expected.to eq("AU") }
219
219
  its(:bank_code) { is_expected.to be_nil }
220
220
  its(:branch_code) { is_expected.to eq("123456") }
221
- its(:account_number) { is_expected.to eq("0000012345") }
221
+ its(:account_number) { is_expected.to eq("12345") }
222
222
  its(:swift_bank_code) { is_expected.to be_nil }
223
223
  its(:swift_branch_code) { is_expected.to eq("123456") }
224
- its(:swift_account_number) { is_expected.to eq("0000012345") }
224
+ its(:swift_account_number) { is_expected.to eq("12345") }
225
225
  its(:swift_national_id) { is_expected.to eq("123456") }
226
226
  its(:iban) { is_expected.to be_nil }
227
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560000012345") }
227
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456_____12345") }
228
228
  its(:valid?) { is_expected.to eq(true) }
229
229
  its(:to_s) { is_expected.to eq("") }
230
230
  end
@@ -235,13 +235,13 @@ describe Ibandit::IBAN do
235
235
  its(:country_code) { is_expected.to eq("AU") }
236
236
  its(:bank_code) { is_expected.to be_nil }
237
237
  its(:branch_code) { is_expected.to eq("123456") }
238
- its(:account_number) { is_expected.to eq("0000123456") }
238
+ its(:account_number) { is_expected.to eq("123456") }
239
239
  its(:swift_bank_code) { is_expected.to be_nil }
240
240
  its(:swift_branch_code) { is_expected.to eq("123456") }
241
- its(:swift_account_number) { is_expected.to eq("0000123456") }
241
+ its(:swift_account_number) { is_expected.to eq("123456") }
242
242
  its(:swift_national_id) { is_expected.to eq("123456") }
243
243
  its(:iban) { is_expected.to be_nil }
244
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560000123456") }
244
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456____123456") }
245
245
  its(:valid?) { is_expected.to eq(true) }
246
246
  its(:to_s) { is_expected.to eq("") }
247
247
  end
@@ -269,13 +269,13 @@ describe Ibandit::IBAN do
269
269
  its(:country_code) { is_expected.to eq("AU") }
270
270
  its(:bank_code) { is_expected.to be_nil }
271
271
  its(:branch_code) { is_expected.to eq("123456") }
272
- its(:account_number) { is_expected.to eq("0XX1234567") }
272
+ its(:account_number) { is_expected.to eq("XX1234567") }
273
273
  its(:swift_bank_code) { is_expected.to be_nil }
274
274
  its(:swift_branch_code) { is_expected.to eq("123456") }
275
- its(:swift_account_number) { is_expected.to eq("0XX1234567") }
275
+ its(:swift_account_number) { is_expected.to eq("XX1234567") }
276
276
  its(:swift_national_id) { is_expected.to eq("123456") }
277
277
  its(:iban) { is_expected.to be_nil }
278
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560XX1234567") }
278
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456_XX1234567") }
279
279
  its(:valid?) { is_expected.to eq(true) }
280
280
  its(:to_s) { is_expected.to eq("") }
281
281
  end
@@ -303,13 +303,13 @@ describe Ibandit::IBAN do
303
303
  its(:country_code) { is_expected.to eq("AU") }
304
304
  its(:bank_code) { is_expected.to be_nil }
305
305
  its(:branch_code) { is_expected.to eq("123456") }
306
- its(:account_number) { is_expected.to eq("0000000000") }
306
+ its(:account_number) { is_expected.to eq("000000") }
307
307
  its(:swift_bank_code) { is_expected.to be_nil }
308
308
  its(:swift_branch_code) { is_expected.to eq("123456") }
309
- its(:swift_account_number) { is_expected.to eq("0000000000") }
309
+ its(:swift_account_number) { is_expected.to eq("000000") }
310
310
  its(:swift_national_id) { is_expected.to eq("123456") }
311
311
  its(:iban) { is_expected.to be_nil }
312
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560000000000") }
312
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456____000000") }
313
313
  its(:valid?) { is_expected.to eq(false) }
314
314
  its(:to_s) { is_expected.to eq("") }
315
315
  end
@@ -321,13 +321,13 @@ describe Ibandit::IBAN do
321
321
  its(:country_code) { is_expected.to eq("AU") }
322
322
  its(:bank_code) { is_expected.to be_nil }
323
323
  its(:branch_code) { is_expected.to eq("123456") }
324
- its(:account_number) { is_expected.to eq("0123456789") }
324
+ its(:account_number) { is_expected.to eq("123456789") }
325
325
  its(:swift_bank_code) { is_expected.to be_nil }
326
326
  its(:swift_branch_code) { is_expected.to eq("123456") }
327
- its(:swift_account_number) { is_expected.to eq("0123456789") }
327
+ its(:swift_account_number) { is_expected.to eq("123456789") }
328
328
  its(:swift_national_id) { is_expected.to eq("123456") }
329
329
  its(:iban) { is_expected.to be_nil }
330
- its(:pseudo_iban) { is_expected.to eq("AUZZ1234560123456789") }
330
+ its(:pseudo_iban) { is_expected.to eq("AUZZ123456_123456789") }
331
331
  its(:valid?) { is_expected.to eq(true) }
332
332
  its(:to_s) { is_expected.to eq("") }
333
333
 
@@ -358,7 +358,7 @@ describe Ibandit::IBAN do
358
358
  it "is invalid and has the correct errors" do
359
359
  expect(subject.valid?).to eq(false)
360
360
  expect(subject.errors).
361
- to eq(account_number: "is the wrong length (should be 10 characters)")
361
+ to eq(account_number: "is the wrong length (should be 5..10 characters)")
362
362
  end
363
363
  end
364
364
 
@@ -377,7 +377,7 @@ describe Ibandit::IBAN do
377
377
  it "is invalid and has the correct errors" do
378
378
  expect(subject.valid?).to eq(false)
379
379
  expect(subject.errors).to eq(
380
- account_number: "is the wrong length (should be 10 characters)",
380
+ account_number: "is the wrong length (should be 5..10 characters)",
381
381
  )
382
382
  end
383
383
  end
@@ -95,7 +95,7 @@ describe Ibandit::LocalDetailsCleaner do
95
95
  let(:branch_code) { "123-456" }
96
96
 
97
97
  its([:country_code]) { is_expected.to eq(country_code) }
98
- its([:account_number]) { is_expected.to eq("0123456789") }
98
+ its([:account_number]) { is_expected.to eq("123456789") }
99
99
  its([:branch_code]) { is_expected.to eq("123456") }
100
100
  end
101
101
 
@@ -103,7 +103,7 @@ describe Ibandit::LocalDetailsCleaner do
103
103
  let(:branch_code) { "123456" }
104
104
 
105
105
  its([:country_code]) { is_expected.to eq(country_code) }
106
- its([:account_number]) { is_expected.to eq("0123456789") }
106
+ its([:account_number]) { is_expected.to eq("123456789") }
107
107
  its([:branch_code]) { is_expected.to eq("123456") }
108
108
  end
109
109
  end
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: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gc_ruboconfig