bsb 1.4.4 → 1.4.6

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: 40b65e738f21e724f7224d8a9ea13d0202abe324600e1611de0a851af748c317
4
- data.tar.gz: 606762e18f937e4dc1b7fb55066708e04e38c4d17304c17c31f231850f2ef7f4
3
+ metadata.gz: 7910cd142c3dc0a29e596a077f84e62dfc4b5941bef6a61a67bd1e2610b57523
4
+ data.tar.gz: 33208f642f7e6efabfdd8ad3bf5a08f1c4049db97bb8352a966c58567997b42c
5
5
  SHA512:
6
- metadata.gz: ff272cc8409a145cd2c16299b4638db604cd2293683b1ac0b2d6d1b45b4074f9ca9f75bc007c59dfc82f23171c24f260deee4b92d8bffe4eb706b799dbb59a75
7
- data.tar.gz: 782902dadf81d9201845f1540b034a325aafb8885cefe3ace81c8bb4259bfcd19fe347996153358fa49a117285860b275180eaadb34c87047e75d51c2155a74d
6
+ metadata.gz: 773b045898057cffe79b42f10fce39e260d7764d8b2507153b3935d981c60e43c42a87fd5cecda323785f40cb6226351de0784d7b5d02e0632b156f8523e6e44
7
+ data.tar.gz: 33e072f35bfb45da1c5c4e94771181a0d5019363ff4888f6021cdf9844404497f4d60165ab0ba4ce11acc583f38b6375412a6acad9d1dcd2a5d4bf5a3bbfafb3
@@ -19,11 +19,17 @@ jobs:
19
19
  with:
20
20
  bundler-cache: true
21
21
 
22
+ - name: Fetch latest key file
23
+ run: bundle exec rake bsb:fetch_key_file[./tmp/key.csv]
24
+
25
+ - name: Update BSB Bank List
26
+ run: bundle exec rake bsb:sync_bank_list[./tmp/key.csv]
27
+
22
28
  - name: Fetch latest contents
23
29
  run: bundle exec rake bsb:sync_bsb_db
24
30
 
25
31
  - name: Remove latest_update file
26
- run: rm -f config/latest_update.json
32
+ run: rm -f config/latest_update.json && rm -f ./tmp/key.csv
27
33
 
28
34
  - name: Create Pull Request
29
35
  uses: peter-evans/create-pull-request@v7
data/.gitignore CHANGED
@@ -15,5 +15,6 @@ mkmf.log
15
15
  *.gem
16
16
  .env
17
17
  AUTHOR
18
+ .DS_Store
18
19
 
19
20
  Gemfile.lock
@@ -1 +1 @@
1
- {".":"1.4.4"}
1
+ {".":"1.4.6"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.6](https://github.com/coinjar/bsb/compare/v1.4.5...v1.4.6) (2025-11-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Update BSB Database ([#112](https://github.com/coinjar/bsb/issues/112)) ([1027f3b](https://github.com/coinjar/bsb/commit/1027f3b447affd49a0791f912e8adfa9be2ac121))
9
+
10
+ ## [1.4.5](https://github.com/coinjar/bsb/compare/v1.4.4...v1.4.5) (2025-10-08)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * update BSB and bank list (Oct 2025) ([#110](https://github.com/coinjar/bsb/issues/110)) ([a9b5371](https://github.com/coinjar/bsb/commit/a9b5371fd1c674b6db49e357e566ef4d3e2ff84a))
16
+
3
17
  ## [1.4.4](https://github.com/coinjar/bsb/compare/v1.4.3...v1.4.4) (2025-10-01)
4
18
 
5
19
 
data/Gemfile CHANGED
@@ -9,7 +9,8 @@ gem 'bundler', '~> 2.0'
9
9
  gem 'csv'
10
10
  gem 'faraday'
11
11
  gem 'minitest-stub-const'
12
- gem 'net-ftp', '~> 0.1.3'
13
12
  gem 'rake', '~> 13.0'
14
13
  gem 'rubocop'
15
14
  gem 'vcr'
15
+
16
+ gem 'faraday-follow_redirects', '~> 0.4.0'
data/README.md CHANGED
@@ -63,22 +63,18 @@ Included in this gem is also a set of Rake tasks to generate the JSON-formatted
63
63
 
64
64
  Two data sources are used:
65
65
 
66
+ * APCA [Key to Abbreviations](https://bsb.auspaynet.com.au/) and BSB Number (Checked monthly, rarely changes)
66
67
  * APCA BSB directory (Updated monthly. This gem will track the changes and push gem updates as frequently as my time allows.)
67
- * APCA Key to Abbreviations and BSB Number (No regular updates)
68
68
 
69
69
  Other formats of APCA BSB data is available from http://bsb.apca.com.au.
70
70
 
71
71
  ## Update BSB Bank List
72
72
 
73
- At the moment BSB data is a manual download from the Auspaynet site [here](https://bsb.auspaynet.com.au/).
74
-
75
- You will need to download the Key to Abbreviations and BSB Number file and place it in `tmp/`:
76
- - `Reference Documents` button > `Key to Abbreviations and BSB Number` in CSV format.
77
-
78
73
  Run the sync task with the files to complete sync of the latest data:
79
74
 
80
75
  ```sh
81
- rake bsb:sync_bank_list['tmp/key to abbreviations and bsb numbers (august 2024).csv']
76
+ rake bsb:fetch_key_file['tmp/key.csv']
77
+ rake bsb:sync_bank_list['tmp/key.csv']
82
78
  ```
83
79
 
84
80
  Browse the list of database changes, make a few queries on the website to ensure the results are the same.
@@ -2,83 +2,93 @@
2
2
  "645": "Auswide Bank Ltd",
3
3
  "656": "Auswide Bank Ltd",
4
4
  "642": "Australian Military Bank Limited",
5
+ "610": "Adelaide Bank (a division of Bendigo and Adelaide Bank Limited)",
6
+ "46": "Advance Bank Australia (a division of Westpac Banking Corp)",
7
+ "771": "AFT AU Pty Ltd",
8
+ "259": "Alex Bank Pty Ltd",
5
9
  "939": "AMP Bank Limited",
6
- "917": "Arab Bank Australia Limited",
7
10
  "01": "Australia & New Zealand Banking Group Limited",
8
- "15": "T&C Town & Country Bank (a division of Australia & New Zealand Banking Group Limited)",
9
11
  "90": "Australia Post (Money Orders)",
12
+ "917": "Arab Bank Australia Limited",
10
13
  "57": "Australian Settlements Limited",
11
- "259": "Alex Bank Pty Ltd",
12
14
  "890": "Avenue Bank Ltd",
13
15
  "632": "B&E Ltd trading as Bank of Us",
14
16
  "23": "Bank of America National Association",
15
- "35": "Bank of China",
17
+ "313": "Bank Australia Limited",
18
+ "633": "Bendigo and Adelaide Bank Limited",
16
19
  "980": "Bank of China (Australia) Limited",
17
- "818": "Bank of Communications Co., Ltd Sydney Branch",
18
- "12": "Bank of Queensland Limited",
19
- "639": "HOM Home Building Society (a division of Bank of Queensland Limited)",
20
- "653": "PPB Pioneer Permanent Building Society (a division of Bank of Queensland Limited)",
21
- "951": "INV BOQ Specialist (a division of Bank of Queensland Limited)",
22
- "944": "MEB Bank of Queensland Limited",
23
- "29": "MUFG Bank, Ltd.",
24
- "325": "Beyond Bank Australia Limited",
25
- "942": "Bank of Sydney Ltd",
20
+ "533": "Police & Nurses Limited",
26
21
  "252": "BC Payments Australia Pty Ltd",
27
- "633": "Bendigo and Adelaide Bank Limited",
28
- "610": "ADL Adelaide Bank (a division of Bendigo and Adelaide Bank Limited)",
22
+ "55": "Bank of Melbourne (a division of Westpac Banking Corp)",
23
+ "369": "BNK Banking Corporation Ltd ",
24
+ "585": "Bano Pty Ltd",
29
25
  "22": "BNP Paribas",
30
- "255": "BPS BNP Paribas Securities Services",
26
+ "35": "Bank of China",
27
+ "19": "Bank of Melbourne (a division of Westpac Banking Corp)",
28
+ "29": "MUFG Bank, Ltd.",
29
+ "255": "BNP Paribas Securities Services",
30
+ "12": "Bank of Queensland Limited",
31
+ "10": "BankSA (a division of Westpac Banking Corp)",
32
+ "26": "Bankers Trust Australia (a division of Westpac Banking Corp)",
33
+ "30": "Bankwest (a division of Commonwealth Bank of Australia)",
34
+ "325": "Beyond Bank Australia Limited",
35
+ "599": "Corporate Alliance Group Pty Ltd",
31
36
  "813": "Capricornian Ltd (The)",
37
+ "06": "Commonwealth Bank of Australia",
38
+ "76": "Commonwealth Bank of Australia",
39
+ "47": "Challenge Bank (a division of Westpac Banking Corp)",
32
40
  "888": "China Construction Bank Corporation, Sydney Branch",
33
41
  "681": "China Everbright Bank Co Ltd",
34
42
  "512": "Community First Credit Union Limited",
43
+ "21": "JP Morgan Chase Bank, National Association",
35
44
  "510": "Citibank N.A.",
36
- "24": "CTI Citibank N.A.",
37
- "06": "Commonwealth Bank of Australia",
38
- "76": "Commonwealth Bank of Australia",
39
- "30": "BWA Bankwest (a division of Commonwealth Bank of Australia)",
40
- "40": "CST Commonwealth Bank of Australia",
41
- "42": "TBT Commonwealth Bank of Australia",
42
- "52": "TBT Commonwealth Bank of Australia",
43
- "814": "Credit Union Australia Ltd (trading as Great Southern Bank)",
44
- "834": "GSB Credit Union Australia Ltd (trading as Great Southern Bank)",
45
+ "818": "Bank of Communications Co., Ltd Sydney Branch",
45
46
  "80": "Cuscal Limited",
46
- "671": "HPC Cuscal Limited",
47
- "889": "DBS Bank Ltd. (Australia Branch)",
47
+ "855": "Credit Union SA Ltd",
48
+ "40": "Colonial State Bank",
49
+ "24": "Citibank N.A.",
50
+ "814": "Credit Union Australia Ltd (trading as Great Southern Bank)",
51
+ "70": "Indue Ltd",
48
52
  "41": "Deutsche Bank Aktiengesellschaft",
49
53
  "833": "Defence Bank Limited",
54
+ "889": "DBS Bank Ltd. (Australia Branch)",
50
55
  "823": "Australian Mutual Bank Limited",
51
- "611": "SEL Australian Mutual Bank Limited",
56
+ "850": "Paynow Technology Pty Ltd",
52
57
  "370": "Flash Partners Pty Ltd",
53
- "676": "Gateway Bank Ltd",
54
- "659": "G&C Mutual Bank Limited",
55
58
  "630": "Greater Bank (a division of Newcastle Greater Mutual Group Ltd)",
56
59
  "637": "Greater Bank (a division of Newcastle Greater Mutual Group Ltd)",
57
60
  "680": "Greater Bank (a division of Newcastle Greater Mutual Group Ltd)",
61
+ "659": "G&C Mutual Bank Limited",
62
+ "936": "ING Bank, NV (Sydney Branch)",
58
63
  "820": "Global Payments Australia 1 Pty Ltd",
64
+ "834": "Credit Union Australia Ltd (trading as Great Southern Bank)",
65
+ "676": "Gateway Bank Ltd",
59
66
  "636": "Cuscal Limited",
67
+ "34": "HSBC Bank Australia Limited",
60
68
  "638": "Heritage and People's Choice Limited",
61
69
  "880": "Heritage and People's Choice Limited",
70
+ "721": "Regional Australia Bank Limited",
71
+ "723": "Bank of Heritage Isle, a division of Police Bank Ltd",
72
+ "639": "Home Building Society (a division of Bank of Queensland Limited)",
73
+ "671": "Cuscal Limited",
62
74
  "985": "Hongkong & Shanghai Banking Corporation Limited (The), Australian Branch",
63
- "34": "HSBC Bank Australia Limited",
64
75
  "640": "Hume Bank Limited",
65
76
  "688": "International Bank of Australia Pty Limited",
77
+ "819": "Industrial and Commercial Bank of China Limited",
78
+ "931": "Mega International Commercial Bank Co, Ltd",
66
79
  "641": "IMB Ltd",
67
80
  "647": "IMB Ltd",
68
- "824": "STH IMB Ltd",
69
- "70": "Indue Ltd",
70
- "819": "Industrial and Commercial Bank of China Limited",
71
81
  "923": "ING Bank (Australia) Limited (trading as ING)",
72
- "936": "ING Bank, NV (Sydney Branch)",
73
- "21": "JP Morgan Chase Bank, National Association",
82
+ "951": "BOQ Specialist (a division of Bank of Queensland Limited)",
74
83
  "725": "Judo Bank Pty Ltd",
75
84
  "323": "KEB Hana Bank",
85
+ "942": "Bank of Sydney Ltd",
76
86
  "18": "Macquarie Bank Limited",
87
+ "918": "Mizuho Bank, Ltd",
88
+ "944": "Bank of Queensland Limited",
89
+ "48": "Norfina Limited",
77
90
  "646": "Maitland Mutual Limited trading as The Mutual Bank",
78
91
  "882": "Unity Bank Limited",
79
- "313": "Bank Australia Limited",
80
- "931": "Mega International Commercial Bank Co, Ltd",
81
- "918": "Mizuho Bank, Ltd",
82
92
  "257": "Monoova Payments Pty Ltd",
83
93
  "969": "Tyro Payments Limited",
84
94
  "08": "National Australia Bank Limited",
@@ -86,46 +96,43 @@
86
96
  "45": "Oversea-Chinese Banking Corporation Limited",
87
97
  "311": "in1bank Limited",
88
98
  "815": "Police Bank Ltd (trading as Police Bank)",
89
- "723": "Bank of Heritage Isle, a division of Police Bank Ltd",
90
- "777": "Police & Nurses Limited",
91
- "533": "BCC Police & Nurses Limited",
92
99
  "14": "Rabobank Australia Limited",
100
+ "777": "Police & Nurses Limited",
101
+ "653": "Pioneer Permanent Building Society (a division of Bank of Queensland Limited)",
93
102
  "654": "Queensland Country Bank Limited",
94
103
  "514": "Members Banking Group Limited Trading as RACQ Bank",
95
- "724": "Railways Credit Union Limited t/a MOVE Bank",
96
104
  "932": "Regional Australia Bank Limited",
97
- "721": "HCC Regional Australia Bank Limited",
98
105
  "09": "Reserve Bank of Australia",
106
+ "724": "Railways Credit Union Limited t/a MOVE Bank",
99
107
  "772": "Revolut Payments Australia Pty Ltd",
100
108
  "655": "MyState Bank Limited",
101
109
  "43": "Standard Chartered Bank, Australia Branch",
110
+ "728": "Summerland Financial Servces Limited (Trading as Summerland Bank)",
111
+ "611": "Australian Mutual Bank Limited",
112
+ "33": "St.George Bank (a division of Westpac Banking Corp)",
113
+ "635": "Australian Settlements Limited",
114
+ "825": "Australian Unity Bank Limited",
115
+ "911": "Sumitomo Mitsui Banking Corporation",
102
116
  "722": "Southern Cross Credit Union Ltd",
103
117
  "840": "Zepto Payments Pty Ltd",
104
118
  "913": "State Street Bank and Trust Company",
105
- "911": "Sumitomo Mitsui Banking Corporation",
106
- "728": "Summerland Financial Servces Limited (Trading as Summerland Bank)",
107
- "825": "Australian Unity Bank Limited",
108
- "48": "Norfina Limited (trading as Suncorp Bank)",
109
- "66": "SUN Norfina Limited (trading as Suncorp Bank)",
119
+ "11": "St.George Bank (a division of Westpac Banking Corp) ",
120
+ "824": "IMB Ltd",
121
+ "66": "Norfina Limited",
122
+ "15": "Town & Country Bank (a division of Australia & New Zealand Banking Group Limited)",
110
123
  "943": "Taiwan Business Bank, Sydney Branch",
124
+ "42": "Colonial Trust Bank",
125
+ "52": "Colonial Trust Bank",
111
126
  "812": "Teachers Mutual Bank Limited",
112
127
  "946": "UBS AG, Australia Branch",
113
- "922": "United Overseas Bank Limited",
114
128
  "634": "Uniting Financial Services",
129
+ "922": "United Overseas Bank Limited",
115
130
  "517": "Volt Bank Limited",
116
131
  "03": "Westpac Banking Corporation",
117
132
  "04": "Westpac Banking Corporation",
118
133
  "73": "Westpac Banking Corporation",
119
134
  "74": "Westpac Banking Corporation",
120
- "11": "STG St.George Bank (a division of Westpac Banking Corp) ",
121
- "10": "BSA BankSA (a division of Westpac Banking Corp)",
122
- "19": "BOM Bank of Melbourne (a division of Westpac Banking Corp)",
123
- "26": "BTA Bankers Trust Australia (a division of Westpac Banking Corp)",
124
- "33": "SGP St.George Bank (a division of Westpac Banking Corp)",
125
- "46": "ADV Advance Bank Australia (a division of Westpac Banking Corp)",
126
- "47": "CBL Challenge Bank (a division of Westpac Banking Corp)",
127
- "55": "BML Bank of Melbourne (a division of Westpac Banking Corp)",
128
- "817": "Warwick Credit Union Ltd",
135
+ "817": "Warwick Credit Union Ltd (Trading as Darling Downs Bank)",
129
136
  "774": "Wise Australia Pty Ltd",
130
137
  "670": "National Australia Bank Limited"
131
138
  }
@@ -7,7 +7,7 @@ module BSB
7
7
  class BankListGenerator < BaseGenerator
8
8
  def self.load_file(filename)
9
9
  hash = {}
10
- CSV.foreach(filename) do |row|
10
+ CSV.foreach(filename, headers: true) do |row|
11
11
  row[2].split(', ').each do |prefix|
12
12
  prefix = prefix.chomp.rjust(2, '0')
13
13
  hash[prefix] = row[1]
data/lib/bsb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BSB
4
- VERSION = '1.4.4'
4
+ VERSION = '1.4.6'
5
5
  end
@@ -4,6 +4,9 @@ require 'bsb'
4
4
  require 'bsb/database_generator'
5
5
  require 'bsb/bank_list_generator'
6
6
 
7
+ require 'fileutils'
8
+ require 'faraday/follow_redirects'
9
+
7
10
  namespace :bsb do
8
11
  desc 'Sync config/*.json.'
9
12
  task :sync_bsb_db_manual, [:bsbfile] do |_t, args|
@@ -17,6 +20,7 @@ namespace :bsb do
17
20
  end
18
21
  end
19
22
 
23
+ desc 'Sync bank list from a keyfile'
20
24
  task :sync_bank_list, [:keyfile] do |_t, args|
21
25
  bank_list_filename = args[:keyfile]
22
26
 
@@ -27,4 +31,29 @@ namespace :bsb do
27
31
  warn 'Missing bank list "KEY TO ABBREVIATIONS AND BSB NUMBERS"'
28
32
  end
29
33
  end
34
+
35
+ desc 'Fetch the BSB CSV from AusPayNet (default output: tmp/key.csv)'
36
+ task :fetch_key_file, [:output_path] do |_t, args|
37
+ args.with_defaults(output_path: 'tmp/key.csv')
38
+
39
+ url = 'https://bsb.auspaynet.com.au/Public/BSB_DB.NSF/getKeytoACSV?OpenAgent'
40
+ user_agent = 'CoinJarBSBUpdater/1.0 (https://github.com/coinjar/bsb)'
41
+
42
+ puts "Fetching CSV from #{url}..."
43
+
44
+ response = Faraday.new(url: url) do |f|
45
+ f.headers['User-Agent'] = user_agent
46
+ f.response :raise_error
47
+ f.response :follow_redirects
48
+ f.adapter Faraday.default_adapter
49
+ end.get
50
+
51
+ csv_data = response.body
52
+
53
+ output_path = args[:output_path]
54
+ FileUtils.mkdir_p(File.dirname(output_path))
55
+ File.binwrite(output_path, csv_data)
56
+
57
+ puts "Saved CSV to #{output_path}"
58
+ end
30
59
  end
@@ -0,0 +1,156 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://bsb.auspaynet.com.au/Public/BSB_DB.NSF/getKeytoACSV?OpenAgent
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - CoinJarBSBUpdater/1.0 (https://github.com/coinjar/bsb)
12
+ response:
13
+ status:
14
+ code: 302
15
+ message: Found
16
+ headers:
17
+ date:
18
+ - Fri, 07 Nov 2025 02:35:40 GMT
19
+ content-length:
20
+ - '0'
21
+ connection:
22
+ - keep-alive
23
+ server:
24
+ - cloudflare
25
+ location:
26
+ - https://bsb.auspaynet.com.au/Public/BSB_DB.NSF/0/9B80EBFA44A993E6CA2579650017682A/$File/key%20to%20abbreviations%20and%20bsb%20numbers%20(october%202025).csv
27
+ strict-transport-security:
28
+ - max-age=604800
29
+ x-frame-options:
30
+ - SAMEORIGIN
31
+ x-content-type-options:
32
+ - sniff
33
+ cf-cache-status:
34
+ - DYNAMIC
35
+ cf-ray:
36
+ - 99a9704cbf57e6ce-MEL
37
+ body:
38
+ encoding: UTF-8
39
+ string: ''
40
+ recorded_at: Fri, 07 Nov 2025 02:35:40 GMT
41
+ - request:
42
+ method: get
43
+ uri: https://bsb.auspaynet.com.au/Public/BSB_DB.NSF/0/9B80EBFA44A993E6CA2579650017682A/$File/key%20to%20abbreviations%20and%20bsb%20numbers%20(october%202025).csv
44
+ body:
45
+ encoding: US-ASCII
46
+ string: ''
47
+ headers:
48
+ User-Agent:
49
+ - CoinJarBSBUpdater/1.0 (https://github.com/coinjar/bsb)
50
+ response:
51
+ status:
52
+ code: 200
53
+ message: OK
54
+ headers:
55
+ date:
56
+ - Fri, 07 Nov 2025 02:35:41 GMT
57
+ content-type:
58
+ - application/octet-stream
59
+ content-length:
60
+ - '5719'
61
+ connection:
62
+ - keep-alive
63
+ server:
64
+ - cloudflare
65
+ last-modified:
66
+ - Sun, 02 Nov 2025 21:07:11 GMT
67
+ etag:
68
+ - W/"MTAtMDAwMi0wLUNBMjU4RDM2MDA3NDAzNUEtOUI4MEVCRkE0NEE5OTNFNkNBMjU3OTY1MDAxNzY4MkE="
69
+ strict-transport-security:
70
+ - max-age=604800
71
+ x-frame-options:
72
+ - SAMEORIGIN
73
+ x-content-type-options:
74
+ - sniff
75
+ cf-cache-status:
76
+ - DYNAMIC
77
+ cf-ray:
78
+ - 99a9704dadb89344-MEL
79
+ body:
80
+ encoding: UTF-8
81
+ string: "BSB Owner,Owner Name,BSB Prefix\r\nABA,Auswide Bank Ltd,645\r\nABA,Auswide
82
+ Bank Ltd,656\r\nADC,Australian Military Bank Limited,642\r\nADL,Adelaide Bank
83
+ (a division of Bendigo and Adelaide Bank Limited),610\r\nADV,Advance Bank
84
+ Australia (a division of Westpac Banking Corp),46\r\nAFT,AFT AU Pty Ltd,771\r\nALX,Alex
85
+ Bank Pty Ltd,259\r\nAMP,AMP Bank Limited,939\r\nANZ,Australia & New Zealand
86
+ Banking Group Limited,1\r\nAPO,Australia Post (Money Orders),90\r\nARA,Arab
87
+ Bank Australia Limited,917\r\nASL,Australian Settlements Limited,57\r\nAVE,Avenue
88
+ Bank Ltd,890\r\nBAE,B&E Ltd trading as Bank of Us,632\r\nBAL,Bank of America
89
+ National Association,23\r\nBAU,Bank Australia Limited,313\r\nBBL,Bendigo and
90
+ Adelaide Bank Limited,633\r\nBCA,Bank of China (Australia) Limited,980\r\nBCC,Police
91
+ & Nurses Limited,533\r\nBCP,BC Payments Australia Pty Ltd,252\r\nBML,Bank
92
+ of Melbourne (a division of Westpac Banking Corp),55\r\nBNK,BNK Banking Corporation
93
+ Ltd ,369\r\nBNO,Bano Pty Ltd,585\r\nBNP,BNP Paribas,22\r\nBOC,Bank of China,35\r\nBOM,Bank
94
+ of Melbourne (a division of Westpac Banking Corp),19\r\nBOT,\"MUFG Bank, Ltd.\",29\r\nBPS,BNP
95
+ Paribas Securities Services,255\r\nBQL,Bank of Queensland Limited,12\r\nBSA,BankSA
96
+ (a division of Westpac Banking Corp),10\r\nBTA,Bankers Trust Australia (a
97
+ division of Westpac Banking Corp),26\r\nBWA,Bankwest (a division of Commonwealth
98
+ Bank of Australia),30\r\nBYB,Beyond Bank Australia Limited,325\r\nCAG,Corporate
99
+ Alliance Group Pty Ltd,599\r\nCAP,Capricornian Ltd (The),813\r\nCBA,Commonwealth
100
+ Bank of Australia,6\r\nCBA,Commonwealth Bank of Australia,76\r\nCBL,Challenge
101
+ Bank (a division of Westpac Banking Corp),47\r\nCCB,\"China Construction Bank
102
+ Corporation, Sydney Branch\",888\r\nCEB,China Everbright Bank Co Ltd,681\r\nCFC,Community
103
+ First Credit Union Limited,512\r\nCMB,\"JP Morgan Chase Bank, National Association\",21\r\nCNA,Citibank
104
+ N.A.,510\r\nCOM,\"Bank of Communications Co., Ltd Sydney Branch\",818\r\nCRU,Cuscal
105
+ Limited,80\r\nCSA,Credit Union SA Ltd,855\r\nCST,Colonial State Bank,40\r\nCTI,Citibank
106
+ N.A.,24\r\nCUA,Credit Union Australia Ltd (trading as Great Southern Bank),814\r\nCUS,Indue
107
+ Ltd,70\r\nDBA,Deutsche Bank Aktiengesellschaft,41\r\nDBL,Defence Bank Limited,833\r\nDBS,DBS
108
+ Bank Ltd. (Australia Branch),889\r\nENC,Australian Mutual Bank Limited,823\r\nFMO,Paynow
109
+ Technology Pty Ltd,850\r\nFPX,Flash Partners Pty Ltd,370\r\nGBS,Greater Bank
110
+ (a division of Newcastle Greater Mutual Group Ltd),630\r\nGBS,Greater Bank
111
+ (a division of Newcastle Greater Mutual Group Ltd),637\r\nGBS,Greater Bank
112
+ (a division of Newcastle Greater Mutual Group Ltd),680\r\nGCB,G&C Mutual Bank
113
+ Limited,659\r\nGNI,\"ING Bank, NV (Sydney Branch)\",936\r\nGPA,Global Payments
114
+ Australia 1 Pty Ltd,820\r\nGSB,Credit Union Australia Ltd (trading as Great
115
+ Southern Bank),834\r\nGTW,Gateway Bank Ltd,676\r\nHAY,Cuscal Limited,636\r\nHBA,HSBC
116
+ Bank Australia Limited,34\r\nHBS,Heritage and People's Choice Limited,638\r\nHBS,Heritage
117
+ and People's Choice Limited,880\r\nHCC,Regional Australia Bank Limited,721\r\nHIC,\"Bank
118
+ of Heritage Isle, a division of Police Bank Ltd\",723\r\nHOM,Home Building
119
+ Society (a division of Bank of Queensland Limited),639\r\nHPC,Cuscal Limited,671\r\nHSB,\"Hongkong
120
+ & Shanghai Banking Corporation Limited (The), Australian Branch\",985\r\nHUM,Hume
121
+ Bank Limited,640\r\nIBA,International Bank of Australia Pty Limited,688\r\nIBK,Industrial
122
+ and Commercial Bank of China Limited,819\r\nICB,\"Mega International Commercial
123
+ Bank Co, Ltd\",931\r\nIMB,IMB Ltd,641\r\nIMB,IMB Ltd,647\r\nING,ING Bank (Australia)
124
+ Limited (trading as ING),923\r\nINV,BOQ Specialist (a division of Bank of
125
+ Queensland Limited),951\r\nJUD,Judo Bank Pty Ltd,725\r\nKEB,KEB Hana Bank,323\r\nLBA,Bank
126
+ of Sydney Ltd,942\r\nMBL,Macquarie Bank Limited,18\r\nMCB,\"Mizuho Bank, Ltd\",918\r\nMEB,Bank
127
+ of Queensland Limited,944\r\nMET,Norfina Limited,48\r\nMMB,Maitland Mutual
128
+ Limited trading as The Mutual Bank,646\r\nMMP,Unity Bank Limited,882\r\nMON,Monoova
129
+ Payments Pty Ltd,257\r\nMSL,Tyro Payments Limited,969\r\nNAB,National Australia
130
+ Bank Limited,8\r\nNEW,Newcastle Greater Mutual Group Ltd,650\r\nOCB,Oversea-Chinese
131
+ Banking Corporation Limited,45\r\nONE,in1bank Limited,311\r\nPCU,Police Bank
132
+ Ltd (trading as Police Bank),815\r\nPIB,Rabobank Australia Limited,14\r\nPNB,Police
133
+ & Nurses Limited,777\r\nPPB,Pioneer Permanent Building Society (a division
134
+ of Bank of Queensland Limited),653\r\nQCB,Queensland Country Bank Limited,654\r\nQTM,Members
135
+ Banking Group Limited Trading as RACQ Bank,514\r\nRAB,Regional Australia Bank
136
+ Limited,932\r\nRBA,Reserve Bank of Australia,9\r\nRCU,Railways Credit Union
137
+ Limited t/a MOVE Bank,724\r\nREV,Revolut Payments Australia Pty Ltd,772\r\nROK,MyState
138
+ Bank Limited,655\r\nSCB,\"Standard Chartered Bank, Australia Branch\",43\r\nSCU,Summerland
139
+ Financial Servces Limited (Trading as Summerland Bank),728\r\nSEL,Australian
140
+ Mutual Bank Limited,611\r\nSGP,St.George Bank (a division of Westpac Banking
141
+ Corp),33\r\nSHP,Australian Settlements Limited,635\r\nSKY,Australian Unity
142
+ Bank Limited,825\r\nSMB,Sumitomo Mitsui Banking Corporation,911\r\nSNX,Southern
143
+ Cross Credit Union Ltd,722\r\nSPL,Zepto Payments Pty Ltd,840\r\nSSB,State
144
+ Street Bank and Trust Company,913\r\nSTG,St.George Bank (a division of Westpac
145
+ Banking Corp) ,11\r\nSTH,IMB Ltd,824\r\nSUN,Norfina Limited,66\r\nT&C,Town
146
+ & Country Bank (a division of Australia & New Zealand Banking Group Limited),15\r\nTBB,\"Taiwan
147
+ Business Bank, Sydney Branch\",943\r\nTBT,Colonial Trust Bank,42\r\nTBT,Colonial
148
+ Trust Bank,52\r\nTCU,Teachers Mutual Bank Limited,812\r\nUBS,\"UBS AG, Australia
149
+ Branch\",946\r\nUFS,Uniting Financial Services,634\r\nUOB,United Overseas
150
+ Bank Limited,922\r\nVOL,Volt Bank Limited,517\r\nWBC,Westpac Banking Corporation,3\r\nWBC,Westpac
151
+ Banking Corporation,4\r\nWBC,Westpac Banking Corporation,73\r\nWBC,Westpac
152
+ Banking Corporation,74\r\nWCU,Warwick Credit Union Ltd (Trading as Darling
153
+ Downs Bank),817\r\nWSE,Wise Australia Pty Ltd,774\r\nYOU,National Australia
154
+ Bank Limited,670\r\n"
155
+ recorded_at: Fri, 07 Nov 2025 02:35:41 GMT
156
+ recorded_with: VCR 6.3.1
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+ require 'rake'
5
+ require 'fileutils'
6
+
7
+ describe 'bsb tasks rake task', type: :task do
8
+ before(:all) do
9
+ Rake.application.rake_require('../lib/tasks/bsb_tasks')
10
+ Rake::Task.define_task(:environment)
11
+ end
12
+
13
+ describe 'fetch_key_file' do
14
+ let(:task_name) { 'bsb:fetch_key_file' }
15
+ let(:task) { Rake::Task[task_name] }
16
+ let(:output_path) { 'tmp/test_key.csv' }
17
+
18
+ before do
19
+ FileUtils.rm_f(output_path)
20
+ task.reenable # so it can be invoked multiple times
21
+ end
22
+
23
+ after { FileUtils.rm_f(output_path) }
24
+
25
+ describe 'when fetching the CSV', :vcr do
26
+ it 'downloads and saves the file successfully' do
27
+ VCR.use_cassette('fetch_key_file') do
28
+ assert(!File.exist?(output_path))
29
+
30
+ output = capture_stdout { task.invoke(output_path) }
31
+
32
+ assert(output.include?('Fetching CSV'))
33
+ assert(File.exist?(output_path))
34
+
35
+ content = File.read(output_path)
36
+ assert(output.include?('BSB'))
37
+ assert(!content.empty?)
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ # Helper to capture puts output
44
+ def capture_stdout
45
+ original_stdout = $stdout
46
+ $stdout = StringIO.new
47
+ yield
48
+ $stdout.string
49
+ ensure
50
+ $stdout = original_stdout
51
+ end
52
+ end
data/test/test_helper.rb CHANGED
@@ -13,7 +13,9 @@ VCR.configure do |config|
13
13
  config.cassette_library_dir = 'test/fixtures/vcr_cassettes'
14
14
  config.hook_into :faraday
15
15
  config.filter_sensitive_data('<AUSPAYNET_SUB_KEY>') do |interaction|
16
- interaction.request.headers['Ocp-apim-subscription-key'][0]
16
+ if interaction.request.headers['Ocp-apim-subscription-key']
17
+ interaction.request.headers['Ocp-apim-subscription-key'][0]
18
+ end
17
19
  end
18
20
  end
19
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-02 00:00:00.000000000 Z
11
+ date: 2025-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -63,6 +63,8 @@ files:
63
63
  - test/bsb_test.rb
64
64
  - test/fixtures/bsb_db.json
65
65
  - test/fixtures/vcr_cassettes/auspaynet_fetch_all_bsbs.yml
66
+ - test/fixtures/vcr_cassettes/fetch_key_file.yml
67
+ - test/tasks/bsb_tasks_test.rb
66
68
  - test/tasks/sync_bsb_db_test.rb
67
69
  - test/test_helper.rb
68
70
  - test/tmp/.keep