bank_routing 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +3 -0
- data/.gitignore +6 -0
- data/.rspec +1 -0
- data/.travis.yml +6 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +4 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +1 -0
- data/README.md +27 -0
- data/Rakefile +38 -0
- data/bank_routing.gemspec +29 -0
- data/lib/bank_routing/FedACHdir.txt +20743 -0
- data/lib/bank_routing/mappings.json +368 -0
- data/lib/bank_routing/metadata.json +6 -0
- data/lib/bank_routing/routing_numbers.rb +334 -0
- data/lib/bank_routing/version.rb +4 -0
- data/lib/bank_routing.rb +2 -0
- data/spec/bank_routing_spec.rb +21 -0
- data/spec/spec_helper.rb +4 -0
- metadata +164 -0
@@ -0,0 +1,368 @@
|
|
1
|
+
{
|
2
|
+
"zip_ext": {
|
3
|
+
"0000": ""
|
4
|
+
},
|
5
|
+
"new_routing_number": {
|
6
|
+
"000000000": ""
|
7
|
+
},
|
8
|
+
"name": {
|
9
|
+
"J.P. MORGAN CHASE BANK, N.A.": "J.P. Morgan Chase",
|
10
|
+
"JP MORGAN CHASE BANK, N.A.": "J.P. Morgan Chase",
|
11
|
+
"JPMORGAN CHASE BANK, NA": "J.P. Morgan Chase",
|
12
|
+
"BANK OF AMERICA, N.A.": "Bank of America",
|
13
|
+
"BANK OF AMERICA": "Bank of America",
|
14
|
+
"WELLS FARGO BANK NA": "Wells Fargo",
|
15
|
+
"CITIBANK NA": "Citibank",
|
16
|
+
"U.S. BANK NATIONAL ASSOCIATION": "U.S. Bank",
|
17
|
+
"PNC BANK, NA": "PNC Bank",
|
18
|
+
"THE BANK OF NEW YORK MELLON": "BNY Mellon",
|
19
|
+
"TD BANK NA": "TD Bank",
|
20
|
+
"HSBC NATIONAL BANK USA": "HSBC Bank USA",
|
21
|
+
"SUNTRUST BANK": "Suntrust",
|
22
|
+
"STATE STREET BANK AND TRUST COMPANY": "State Street",
|
23
|
+
"BRANCH BANKING AND TRUST COMPANY": "BB&T",
|
24
|
+
"REGIONS BANK": "Regions",
|
25
|
+
"CAPITAL ONE, NATIONAL ASSOCIATION": "Capital One",
|
26
|
+
"FIA Card Services, National Association": "FIA Card Services",
|
27
|
+
"FIFTH THIRD BANK": "Fifth Third Bank",
|
28
|
+
"ING Bank, fsb": "ING",
|
29
|
+
"RBS CITIZENS, NATIONAL ASSOCIATION": "Citizens Bank",
|
30
|
+
"KeyBank National Association": "KeyBank",
|
31
|
+
"THE NORTHERN TRUST COMPANY": "Northern Trust",
|
32
|
+
"UNION BANK": "Union Bank",
|
33
|
+
"UNION BANK, NATIONAL ASSOCIATION": "Union Bank",
|
34
|
+
"MORGAN STANLEY BANK, NATIONAL ASSOCIATION": "Morgan Stanley",
|
35
|
+
"CHARLES SCHWAB BANK": "Charles Schwab",
|
36
|
+
"MANUFACTURERS & TRADERS TRUST CO.": "M&T Bank",
|
37
|
+
"CITIBANK (SOUTH DAKOTA), N.A.": "Citibank",
|
38
|
+
"SOVEREIGN BANK": "Sovereign Bank",
|
39
|
+
"COMPASS BANK": "BBVA Compass Bank",
|
40
|
+
"BBVA COMPASS BANK": "BBVA Compass Bank",
|
41
|
+
"USAA FEDERAL SAVINGS BANK": "USAA",
|
42
|
+
"COMERICA BANK": "Comerica",
|
43
|
+
"THE HUNTINGTON NATIONAL BANK": "Huntington",
|
44
|
+
"BANK OF THE WEST": "Bank of the West",
|
45
|
+
"M&I MARSHALL & ILSLEY BANK": "M&I Bank",
|
46
|
+
"BMO HARRIS BANK,N.A.": "BMO Harris Bank",
|
47
|
+
"ALLY BANK": "Ally",
|
48
|
+
"DISCOVER BANK": "Discover Bank",
|
49
|
+
"GOLDMAN SACHS BANK USA": "Goldman Sachs Bank",
|
50
|
+
"CAPITAL ONE BANK (USA), N.A.": "Capital One Bank",
|
51
|
+
"E*TRADE SECURITIES": "E*TRADE",
|
52
|
+
"E*TRADE Bank": "E*TRADE",
|
53
|
+
"UBS AG": "UBS Bank",
|
54
|
+
"UBS BANK USA": "UBS Bank USA",
|
55
|
+
"HUDSON CITY SAVINGS BANK": "Hudson City",
|
56
|
+
"CITIZENS BANK": "Citizens Bank",
|
57
|
+
"CITIZENS BANK OF PENNSYLVANIA": "Citizens Bank",
|
58
|
+
"DEUTSCHE BANK TRUST COMPANY, DE": "Deutsche Bank",
|
59
|
+
"SYNOVUS BANK": "Synovus Bank",
|
60
|
+
"RBC BANK (GA)": "RBC Bank",
|
61
|
+
"RBC BANK (USA)": "RBC Bank",
|
62
|
+
"BANCO POPULAR DE PUERTO RICO": "Popular",
|
63
|
+
"NEW YORK COMMUNITY BANK": "New York Community Bank",
|
64
|
+
"AMERICAN EXPRESS BANK FSB": "American Express",
|
65
|
+
"FIRST REPUBLIC BANK": "First Republic Bank",
|
66
|
+
"CITY NATIONAL BANK": "City National",
|
67
|
+
"PEOPLE'S UNITED BANK": "People's United Bank",
|
68
|
+
"BOKF, N.A.": "BOK Financial",
|
69
|
+
"FIRST-CITIZENS BANK & TRUST COMPANY": "First Citizens Bank",
|
70
|
+
"EAST WEST BANK": "East West Bank",
|
71
|
+
"COMMERCE BANK": "Commerce Bank",
|
72
|
+
"SILICON VALLEY BANK": "Silicon Valley Bank",
|
73
|
+
"FIRST TENNESSEE BANK": "First Tennessee Bank",
|
74
|
+
"ONEWEST BANK, FSB": "OneWest Bank",
|
75
|
+
"WELLS FARGO BANK": "Wells Fargo",
|
76
|
+
"FROST NATIONAL BANK": "Frost National Bank",
|
77
|
+
"ASSOCIATED BANK, NA": "Associated Bank",
|
78
|
+
"WEBSTER BANK": "Webster Bank",
|
79
|
+
"AMERICAN EXPRESS CENTURION BANK": "AMEX Centurion",
|
80
|
+
"GE MONEY BANK": "GE Capital",
|
81
|
+
"GE CAPITAL RETAIL BANK": "GE Capital",
|
82
|
+
"FIRST NIAGARA BANK, NA": "First Niagra",
|
83
|
+
"ZIONS FIRST NATIONAL BANK": "Zions Bank",
|
84
|
+
"TCF NATIONAL BANK": "TCF Bank",
|
85
|
+
"FIRSTBANK PUERTO RICO": "FirstBank",
|
86
|
+
"ASTORIA FEDERAL SAVINGS": "Astoria Federal Savings",
|
87
|
+
"FIRSTMERIT BANK N.A.": "FirstMerit Bank",
|
88
|
+
"BANCORPSOUTH BANK": "BancCorp South",
|
89
|
+
"FIRST HAWAIIAN BANK": "First Hawaiian",
|
90
|
+
"THE PRIVATEBANK AND TRUST COMPANY": "The PrivateBank",
|
91
|
+
"SIGNATURE BANK": "Signature Bank",
|
92
|
+
"FIRST NATIONAL BANK OF OMAHA": "First National Bank of Omaha",
|
93
|
+
"BANK OF HAWAII": "Bank of Hawaii",
|
94
|
+
"VALLEY NATIONAL BANK": "Valley National Bank",
|
95
|
+
"FIRSTBANK": "FirstBank",
|
96
|
+
"EVERBANK": "EverBank",
|
97
|
+
"STATE FARM BANK FSB": "State Farm",
|
98
|
+
"ARVEST BANK": "Arvest",
|
99
|
+
"UMPQUA BANK": "Umpqua Bank",
|
100
|
+
"METLIFE BANK, N.A.(METLIFE DIVISION)": "MetLife",
|
101
|
+
"SUSQUEHANNA BANK": "Susquehanna",
|
102
|
+
"CALIFORNIA BANK & TRUST": "California Bank & Trust",
|
103
|
+
"BNY MELLON-BPS": "BNY Mellon",
|
104
|
+
"UMB BANK": "UMB Bank",
|
105
|
+
"UMB BANK,N.A.": "UMB Bank",
|
106
|
+
"UMB BANK, NATIONAL ASSOCIATION": "UMB Bank",
|
107
|
+
"THIRD FEDERAL SAVINGS AND LOAN": "Third Federal",
|
108
|
+
"WASHINGTON FEDERAL": "Washington Federal",
|
109
|
+
"AMEGY BANK, NA": "Amegy Bank",
|
110
|
+
"BANK OF CHINA, NEW YORK": "Bank of China",
|
111
|
+
"BANK OF CHINA, LOS ANGELES BRANCH": "Bank of China",
|
112
|
+
"TD BANK N.A.": "TD Bank",
|
113
|
+
"IBERIABANK": "IBERIABANK",
|
114
|
+
"MB FINANCIAL BANK N.A.": "MB Financial Bank",
|
115
|
+
"FLAGSTAR BANK": "Flagstar",
|
116
|
+
"PROSPERITY BANK": "Prosperity Bank",
|
117
|
+
"RABOBANK NA": "Rabobank",
|
118
|
+
"FIRST NATIONAL BANK OF PENNSYLVANIA": "First National Bank of Pennsylvania",
|
119
|
+
"TRUSTMARK NATIONAL BANK": "Trustmark",
|
120
|
+
"FIRST CITIZENS BANK & TRUST COMPANY": "First Citizens Bank",
|
121
|
+
"SCOTTRADE BANK": "Scottrade",
|
122
|
+
"CATHAY BANK": "Cathay Bank",
|
123
|
+
"BANKUNITED, NATIONAL ASSOCIATION": "BankUnited",
|
124
|
+
"BANKUNITED": "BankUnited",
|
125
|
+
"EMIGRANT BANK": "Emigrant",
|
126
|
+
"BARCLAYS BANK DELAWARE": "Barclays Bank Delaware",
|
127
|
+
"STERLING SAVINGS BANK": "Sterling Bank",
|
128
|
+
"INVESTORS BANK": "Investors Bank",
|
129
|
+
"RAYMOND JAMES BANK, NA": "Raymond James Bank",
|
130
|
+
"UNITED COMMUNITY BANK": "United Community Bank",
|
131
|
+
"BANCO POPULAR NORTH AMERICA": "Popular",
|
132
|
+
"INTERNATIONAL BANK OF COMMERCE": "IBC",
|
133
|
+
"FIRST MIDWEST BANK": "First Midwest Bank",
|
134
|
+
"GREAT WESTERN BANK": "Great Western Bank",
|
135
|
+
"MIDFIRST BANK": "MidFirst Bank",
|
136
|
+
"FULTON BANK N.A.": "Fulton Bank",
|
137
|
+
"FULTON BANK": "Fulton Bank",
|
138
|
+
"FIRST BANK": "First Bank",
|
139
|
+
"BMW BANK OF NORTH AMERICA": "BMW",
|
140
|
+
"SALLIE MAE BANK": "Sallie Mae",
|
141
|
+
"NORTHWEST SAVINGS BANK": "Northwest Savings Bank",
|
142
|
+
"OLD NATIONAL BANK": "Old National Bank",
|
143
|
+
"EASTERN BANK": "Eastern Bank",
|
144
|
+
"NATIONAL PENN BANK": "National Penn",
|
145
|
+
"ISRAEL DISCOUNT BANK OF NEW YORK-LA": "IDB Bank",
|
146
|
+
"ISRAEL DISCOUNT BANK OF NEW YORK,MI": "IDB Bank",
|
147
|
+
"FIRST INTERSTATE BANK": "First Interstate Bank",
|
148
|
+
"APPLE BANK FOR SAVINGS": "Apple Bank",
|
149
|
+
"FIRST FINANCIAL BANK, NA": "First Financial Bank",
|
150
|
+
"CAPMARK BANK": "Capmark Bank",
|
151
|
+
"TEXAS CAPITAL BANK": "Texas Capital Bank",
|
152
|
+
"THE PROVIDENT BANK": "Provident Bank",
|
153
|
+
"CAPITOL FEDERAL SAVINGS BANK": "Capitol Federal",
|
154
|
+
"THE PARK NATIONAL BANK": "Park National Bank",
|
155
|
+
"DOLLAR BANK": "Dollar Bank",
|
156
|
+
"SANTA BARBARA BANK & TRUST NA": "Santa Barbara Bank & Trust",
|
157
|
+
"SANTA BARBARA BANK & TRUST": "Santa Barbara Bank & Trust",
|
158
|
+
"MERCANTIL COMMERCEBANK NATL ASSOC": "Mercantil Commercebank",
|
159
|
+
"BANCO SANTANDER,DE PR": "Banco Santander",
|
160
|
+
"BANCO SANTANDER DE PR": "Banco Santander",
|
161
|
+
"BANCO SANTANDER DE PUERTO RICO": "Banco Santander",
|
162
|
+
"CAPITALSOURCE BANK": "CapitalSource Bank",
|
163
|
+
"FIRST COMMONWEALTH BANK": "First Commonwealth",
|
164
|
+
"PACIFIC WESTERN BANK": "Pacific Western Bank",
|
165
|
+
"CITIZENS BUSINESS BANK": "Citizens Business Bank",
|
166
|
+
"BANCFIRST": "BancFirst",
|
167
|
+
"HANCOCK BANK": "Hancock Bank",
|
168
|
+
"CHEMICAL BANK": "Chemical Bank",
|
169
|
+
"CHEMICAL BANK SHORELINE": "Chemical Bank",
|
170
|
+
"CHEMICAL BANK NORTH": "Chemical Bank",
|
171
|
+
"CHEMICAL BANK KEY STATE": "Chemical Bank",
|
172
|
+
"CHEMICAL BANK CENTRAL": "Chemical Bank",
|
173
|
+
"CHEMICAL BANK THUMB AREA": "Chemical Bank",
|
174
|
+
"CHEMICAL BANK MICHIGAN": "Chemical Bank",
|
175
|
+
"CHEMICAL BANK WEST-EBS SERVICES": "Chemical Bank",
|
176
|
+
"CHEMICAL BANK MONTCALM": "Chemical Bank",
|
177
|
+
"CHEMICAL BANK & TRUST COMPANY": "Chemical Bank",
|
178
|
+
"DORAL BANK, FSB": "Doral Bank",
|
179
|
+
"DORAL BANK": "Doral Bank",
|
180
|
+
"CIT BANK": "CIT Bank",
|
181
|
+
"NBT BANK, NATIONAL ASSOCIATION": "NBT Bank",
|
182
|
+
"WESBANCO BANK INC": "Wesbanco",
|
183
|
+
"WESBANCO BANK WHEELING": "Wesbanco",
|
184
|
+
"WESBANCO BANK, INC": "Wesbanco",
|
185
|
+
"MUTUAL OF OMAHA BANK": "Mutual of Omaha Bank",
|
186
|
+
"STERLING BANK & TRUST FSB": "Sterling Bank",
|
187
|
+
"STERLING BANK": "Sterling Bank",
|
188
|
+
"BANK LEUMI USA": "Bank Leumi USA",
|
189
|
+
"WESTAMERICA BANK": "Westamerica Bank",
|
190
|
+
"PLAINSCAPITAL BANK": "PlainsCapital Bank",
|
191
|
+
"AMERICAN SAVINGS BANK, FSB": "American Savings Bank",
|
192
|
+
"COMMUNITY BANK, NA": "Community Bank, N.A.",
|
193
|
+
"BANKATLANTIC": "BankAtlantic",
|
194
|
+
"BENEFICIAL SAVINGS BANK": "Beneficial Bank",
|
195
|
+
"BENEFICIAL SAVING BANK": "Beneficial Bank",
|
196
|
+
"BENEFICIAL BANK": "Beneficial Bank",
|
197
|
+
"JOHNSON BANK": "Johnson Bank",
|
198
|
+
"PINNACLE NATIONAL BANK": "Pinnacle Bank",
|
199
|
+
"AMERIPRISE BANK, FSB": "Ameriprise Financial",
|
200
|
+
"RIDGEWOOD SAVINGS BANK": "Ridgewood Savings Bank",
|
201
|
+
"NATIONAL BANK OF ARIZONA": "National Bank of Arizona",
|
202
|
+
"RENASANT BANK": "Renasant Bank",
|
203
|
+
"STATE BANK OF INDIA": "State Bank of India",
|
204
|
+
"STATE BANK OF INDIA CALIFORNIA": "State Bank of India",
|
205
|
+
"STATE BANK OF INDIA (CALIFORNIA)": "State Bank of India",
|
206
|
+
"FIRST SOURCE BANK SOUTH BEND": "1st Source Bank",
|
207
|
+
"ROCKLAND TRUST COMPANY": "Rockland Trust",
|
208
|
+
"TRUSTCO BANK": "TrustCo Bank",
|
209
|
+
"NEVADA STATE BANK": "Nevada State Bank",
|
210
|
+
"COLUMBIA STATE BANK": "Columbia Bank",
|
211
|
+
"MIDDLESEX SAVINGS": "Middlesex Savings Bank",
|
212
|
+
"S & T BANK": "S&T Bank",
|
213
|
+
"SCOTIABANK DE PUERTO RICO": "Scotiabank de Puerto Rico",
|
214
|
+
"BANNER BANK": "Banner Bank",
|
215
|
+
"OCEAN BANK": "Ocean Bank",
|
216
|
+
"CARTER BANK & TRUST": "Carter Bank & Trust",
|
217
|
+
"SCBT": "SCBT",
|
218
|
+
"SAFRA NATIONAL BANK OF NEW YORK": "Safra National Bank of New York",
|
219
|
+
"FLUSHING SAVINGS BANK,FSB": "Flushing Bank",
|
220
|
+
"FLUSHING SAVINGS BANK, F.S.B.": "Flushing Bank",
|
221
|
+
"FLUSHING SAVINGS BANK": "Flushing Bank",
|
222
|
+
"WASHINGTON TRUST BANK": "Washington Trust Bank",
|
223
|
+
"FIRST MERCHANTS BANK": "First Merchants Bank",
|
224
|
+
"CENTRAL PACIFIC BANK": "Central Pacific Bank",
|
225
|
+
"UNION FIRST MARKET BANK": "Union First Market Bank",
|
226
|
+
"COLE TAYLOR BANK/YORKTOWN": "Cole Taylor Bank",
|
227
|
+
"COLE TAYLOR BANK ASHLAND": "Cole Taylor Bank",
|
228
|
+
"FARMERS AND MERCHANTS BANK": "Farmers & Merchants Bank",
|
229
|
+
"TOWNEBANK": "TowneBank",
|
230
|
+
"NATIONWIDE BANK": "Nationwide Bank",
|
231
|
+
"INTRUST BANK, NA": "INTRUST Bank",
|
232
|
+
"INTRUST BANK, N. A.": "INTRUST Bank",
|
233
|
+
"CENTENNIAL BANK": "Centennial Bank",
|
234
|
+
"LUTHER BURBANK SAVINGS": "Luther Burbank Savings",
|
235
|
+
"UNITED BANK": "United Bank",
|
236
|
+
"WOODFOREST NATIONAL BANK": "Woodforest National Bank",
|
237
|
+
"AMALGAMATED BANK": "Amalgamated Bank",
|
238
|
+
"BANCO BILBAO VIZCAYA ARGENTARIA": "Banco Bilbao Vizcaya Argentaria",
|
239
|
+
"BANCO BILBAO VIZCAYA ARGENTARIA PR": "Banco Bilbao Vizcaya Argentaria",
|
240
|
+
"FIRST SECURITY BANK": "First Security Bank",
|
241
|
+
"SUN NATIONAL BANK": "Sun National Bank",
|
242
|
+
"FIRST NATIONAL BANK": "First National Bank",
|
243
|
+
"BUSEY BANK": "Busey",
|
244
|
+
"BUSEY BANK, N.A.": "Busey",
|
245
|
+
"WILMINGTON SAVINGS FUND SOCIETY FSB": "WSFS Bank",
|
246
|
+
"CITY NATIONAL BANK OF FLORIDA": "City National Bank",
|
247
|
+
"COMMUNITY TRUST BANK, INC.": "Community Trust Bank",
|
248
|
+
"GREAT SOUTHERN BANK": "Great Southern",
|
249
|
+
"LIBERTY BANK": "Liberty Bank",
|
250
|
+
"ANCHORBANK S.S.B.": "AnchorBank",
|
251
|
+
"BOSTON PRIVATE BANK & TRUST COMPANY": "Boston Private Bank & Trust Company",
|
252
|
+
"BEAL BANK SSB": "Beal Bank",
|
253
|
+
"BEAL BANK": "Beal Bank",
|
254
|
+
"BEAL BANK USA": "Beal Bank",
|
255
|
+
"BANK HAPOALIM": "Bank Hapoalim",
|
256
|
+
"PINNACLE BANK": "Pinnacle Bank",
|
257
|
+
"SANDY SPRING BANK": "Sandy Spring Bank",
|
258
|
+
"THE BANCORP.COM": "The Bancorp Bank",
|
259
|
+
"THE BANCORP BANK": "The Bancorp Bank",
|
260
|
+
"BANK OF THE OZARKS": "Bank of the Ozarks",
|
261
|
+
"BANK OF THE OZARKS, WCA": "Bank of the Ozarks",
|
262
|
+
"AMERIS BANK": "Ameris Bank",
|
263
|
+
"AMERICAN BANKING CO DBA AMERIS BANK": "Ameris Bank",
|
264
|
+
"DIME SVG BK WILLIAMSBURGH": "Dime",
|
265
|
+
"ORIENTAL BANK AND TRUST": "Oriental",
|
266
|
+
"BANK MIDWEST NA": "Bank Midwest",
|
267
|
+
"BANK MIDWEST": "Bank Midwest",
|
268
|
+
"BANK MIDWEST, N.A.": "Bank Midwest",
|
269
|
+
"ENTERPRISE BANK & TRUST": "Enterprise Bank & Trust",
|
270
|
+
"ENTERPRISE BANK & TRUST CO.": "Enterprise Bank & Trust",
|
271
|
+
"HANMI BANK": "Hanmi Bank",
|
272
|
+
"HANMI BANK (FIRST GLOBAL BANK)": "Hanmi Bank",
|
273
|
+
"BANK OF NEVADA": "Bank of Nevada",
|
274
|
+
"STELLARONE BANK": "StellarOne",
|
275
|
+
"MECHANICS BANK": "Mechanics Bank",
|
276
|
+
"FIRST FEDERAL SAVINGS AND LOAN ASSO": "First Federal",
|
277
|
+
"FIRST FEDERAL SAVINGS AND LOAN": "First Federal",
|
278
|
+
"LAKE CITY BANK": "Lake City Bank",
|
279
|
+
"FIRST AMERICAN BANK": "First American Bank",
|
280
|
+
"FIRST AMERICAN BANK, N.A.": "First American Bank",
|
281
|
+
"WILSHIRE STATE BANK": "Wilshire State Bank",
|
282
|
+
"STATE BANK AND TRUST COMPANY": "State Bank & Trust Company",
|
283
|
+
"WHITNEY BANK": "Whitney Bank",
|
284
|
+
"VIRGINIA COMMERCE BANK": "Virginia Commerce Bank",
|
285
|
+
"FIRST PLACE BANK": "First Place Bank",
|
286
|
+
"HUDSON VALLEY BANK": "Hudson Valley Bank",
|
287
|
+
"BERKSHIRE BANK": "Berkshire Bank",
|
288
|
+
"AMARILLO NATIONAL BANK": "Amarillo National Bank",
|
289
|
+
"SUSQUEHANNA BANK": "Susquehanna",
|
290
|
+
"SUSQUEHANNA BANK DV": "Susquehanna",
|
291
|
+
"SUSQUEHANNA BANK PA": "Susquehanna",
|
292
|
+
"LAKELAND BANK": "Lakeland Bank",
|
293
|
+
"INDEPENDENT BANK": "Independent Bank",
|
294
|
+
"CITY NATIONAL BANK OF WEST VIRGINIA": "City National Bank",
|
295
|
+
"MAINSOURCE BANK": "MainSource",
|
296
|
+
"SOUTHSIDE BANK": "Southside Bank",
|
297
|
+
"AMERICAN STATE BANK": "Prosperity Bank",
|
298
|
+
"PRINCIPAL BANK": "Principal Bank",
|
299
|
+
"BBCN BANK": "BBCN Bank",
|
300
|
+
"BREMER BANK, NA": "Bremer Bank",
|
301
|
+
"BREMER BANK NA": "Bremer Bank",
|
302
|
+
"BREMER BANK, N.A. MARSHALL": "Bremer Bank",
|
303
|
+
"PEOPLES UNITED BANK": "People's United Bank",
|
304
|
+
"CAPITAL CITY BANK": "Capital City Bank",
|
305
|
+
"PARKWAY BANK AND TRUST COMPANY": "Parkway Bank",
|
306
|
+
"PARKWAY BANK ARIZONA": "Parkway Bank",
|
307
|
+
"KEARNY FEDERAL SAVINGS BANK": "Kearny Federal Savings",
|
308
|
+
"VIEWPOINT BANK": "ViewPoint Bank",
|
309
|
+
"VIEWPOINT BANK, NATIONAL ASSOCIATION": "ViewPoint Bank",
|
310
|
+
"BANK OF TOKYO-MITSUBISHI UFJ LTD": "Bank of Tokyo-Mitsubishi UFJ",
|
311
|
+
"THE BANK OF TOKYO-MITSUBISHI UFJ LTD": "Bank of Tokyo-Mitsubishi UFJ",
|
312
|
+
"PROVIDENT BANK": "Provident Bank",
|
313
|
+
"FREMONT BANK": "Fremont Bank",
|
314
|
+
"MORTON COMMUNITY BANK": "Morton Community Bank",
|
315
|
+
"HOMESTREET BANK": "HomeStreet Bank",
|
316
|
+
"CENTURY BANK & TRUST CO": "Century Bank",
|
317
|
+
"CENTURY BANK AND TRUST CO": "Century Bank",
|
318
|
+
"THE WASHINGTON TRUST COMPANY": "Washington Trust",
|
319
|
+
"WASHINGTON TRUST COMPANY": "Washington Trust",
|
320
|
+
"BANK MUTUAL": "Bank Mutual",
|
321
|
+
"BANK OF HAMPTON ROADS": "Bank of Hampton Roads",
|
322
|
+
"AMERICAN CHARTERED BANK": "American Chartered Bank",
|
323
|
+
"UNION BANK & TRUST COMPANY": "Union Bank & Trust Company",
|
324
|
+
"UNITED CENTRAL BANK": "United Central Bank",
|
325
|
+
"ALPINE BANK": "Alpine Bank",
|
326
|
+
"BANK OF INDIA": "Bank of India",
|
327
|
+
"BROADWAY NATIONAL BANK": "Broadway Bank",
|
328
|
+
"SABADELL UNITED BANK, NA": "Sabadell United Bank",
|
329
|
+
"FIVE STAR BANK": "Five Star Bank",
|
330
|
+
"STANDARD BANK & TRUST COMPANY": "Standard Bank",
|
331
|
+
"STANDARD BANK & TRUST CO.": "Standard Bank",
|
332
|
+
"STANDARD BANK & TRUST CO": "Standard Bank",
|
333
|
+
"CAPITAL BANK": "Capital Bank",
|
334
|
+
"LIBERTY BANK OF ARKANSAS": "Liberty Bank of Arkansas",
|
335
|
+
"REPUBLIC BANK & TRUST CO.": "Republic Bank",
|
336
|
+
"REPUBLIC BANK & TRUST CO": "Republic Bank",
|
337
|
+
"COBIZ BANK": "Colorado Business Bank",
|
338
|
+
"YADKIN VALLEY BANK & TRUST COMPANY": "Yadkin Valley Bank",
|
339
|
+
"STILLWATER NATL. BANK & TRUST CO.": "SNB",
|
340
|
+
"STILLWATER NATIONAL BANK": "SNB",
|
341
|
+
"STILLWATER NATIONAL BANK & TRUST CO.": "SNB",
|
342
|
+
"WEST COAST BANK": "West Coast Bank",
|
343
|
+
"WEST COAST BANK (CENTENNIAL BANK)": "West Coast Bank",
|
344
|
+
"WEST COAST BANK (BANK OF NEWPORT)": "West Coast Bank",
|
345
|
+
"WEST COAST BANK (THE COMMERCIAL BK)": "West Coast Bank",
|
346
|
+
"WEST COAST BANK (BANK OF VANCOUVER)": "West Coast Bank",
|
347
|
+
"COMMUNITY BANK": "Community Bank",
|
348
|
+
"BROOKLINE BANK": "Brookline Bank",
|
349
|
+
"METRO BANK": "Metro Bank",
|
350
|
+
"FIRSTRUST SVGS BANK": "Firstrust Bank",
|
351
|
+
"FIRSTRUST BANK": "Firstrust Bank",
|
352
|
+
"OLD SECOND NATL BK AURORA": "Old Second",
|
353
|
+
"OLD SECOND NATL BANK": "Old Second",
|
354
|
+
"UNION SAVINGS BANK": "Union Savings Bank",
|
355
|
+
"INTER NATIONAL BANK": "Inter National Bank",
|
356
|
+
"FIRST FINANCIAL BANK": "First Financial Bank",
|
357
|
+
"SALEM FIVE CENTS SAVINGS BANK": "Salem Five",
|
358
|
+
"SALEM FIVE CENTS SVGS BK": "Salem Five",
|
359
|
+
"VECTRA BANK COLORADO": "Vectra Bank Colorado",
|
360
|
+
"BANKTRUST": "BankTrust",
|
361
|
+
"BANK OF NORTH CAROLINA": "Bank of North Carolina",
|
362
|
+
"TRI COUNTIES BANK": "Tri Counties Bank",
|
363
|
+
"NEW YORK COMMERCIAL BANK": "New York Commercial Bank",
|
364
|
+
"BURKE & HERBERT BK & TR CO": "Burke & Herbert Bank",
|
365
|
+
"BURKE & HERBERT BK MERCHANT CAPTURE": "Burke & Herbert Bank",
|
366
|
+
"FIRST BANK & TRUST": "First Bank & Trust"
|
367
|
+
}
|
368
|
+
}
|
@@ -0,0 +1,334 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require 'yajl'
|
3
|
+
|
4
|
+
class RoutingNumber
|
5
|
+
|
6
|
+
class InvalidStore < StandardError; end
|
7
|
+
|
8
|
+
class StoreBase
|
9
|
+
|
10
|
+
def initialize(opts = {})
|
11
|
+
@options = opts
|
12
|
+
@logger = opts.delete(:logger)
|
13
|
+
end
|
14
|
+
|
15
|
+
def log
|
16
|
+
@logger ||= Logger.new(STDOUT)
|
17
|
+
end
|
18
|
+
|
19
|
+
def options
|
20
|
+
@options
|
21
|
+
end
|
22
|
+
|
23
|
+
def loaded?
|
24
|
+
@loaded
|
25
|
+
end
|
26
|
+
|
27
|
+
def loaded!
|
28
|
+
@loaded = true
|
29
|
+
end
|
30
|
+
|
31
|
+
def loading!
|
32
|
+
return false if loading?
|
33
|
+
@loading = true
|
34
|
+
end
|
35
|
+
|
36
|
+
def loading?
|
37
|
+
@loading
|
38
|
+
end
|
39
|
+
|
40
|
+
def done_loading!
|
41
|
+
@loading = false
|
42
|
+
loaded!
|
43
|
+
end
|
44
|
+
|
45
|
+
def save(num,obj)
|
46
|
+
puts "Don't know how to save!"
|
47
|
+
end
|
48
|
+
|
49
|
+
def get(num)
|
50
|
+
puts "Don't know how to get!"
|
51
|
+
end
|
52
|
+
|
53
|
+
def shutdown!
|
54
|
+
end
|
55
|
+
|
56
|
+
def reconnect!
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
class MemStore < StoreBase
|
62
|
+
|
63
|
+
def initialize(opts = {})
|
64
|
+
@options = opts
|
65
|
+
@vals = {}
|
66
|
+
end
|
67
|
+
|
68
|
+
def save(num,obj)
|
69
|
+
@vals[num.to_s] = obj
|
70
|
+
end
|
71
|
+
|
72
|
+
def get(num)
|
73
|
+
@vals[num.to_s]
|
74
|
+
end
|
75
|
+
|
76
|
+
def shutdown!
|
77
|
+
@vals = nil
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
class RedisStore < StoreBase
|
83
|
+
|
84
|
+
LOADED_KEY = "LoadedRoutingNumbers".freeze
|
85
|
+
LOADING_KEY = "#{LOADED_KEY}::loading".freeze
|
86
|
+
STORAGE_KEY = "RoutingNumberLookup"
|
87
|
+
|
88
|
+
def initialize(*args)
|
89
|
+
super(*args)
|
90
|
+
require 'redis'
|
91
|
+
end
|
92
|
+
|
93
|
+
def loaded?
|
94
|
+
store.exists(LOADED_KEY)
|
95
|
+
end
|
96
|
+
|
97
|
+
def loaded!
|
98
|
+
store.set(LOADED_KEY,"yes")
|
99
|
+
store.expire(LOADED_KEY,60*60*24*7)
|
100
|
+
end
|
101
|
+
|
102
|
+
def loading!
|
103
|
+
store.setnx(LOADING_KEY,"yup")
|
104
|
+
end
|
105
|
+
|
106
|
+
def loading?
|
107
|
+
loading!
|
108
|
+
end
|
109
|
+
|
110
|
+
def done_loading!
|
111
|
+
store.del(LOADING_KEY)
|
112
|
+
loaded!
|
113
|
+
end
|
114
|
+
|
115
|
+
def save(num,obj)
|
116
|
+
store.hset(STORAGE_KEY,num.to_s,Yajl::Encoder.encode(obj))
|
117
|
+
end
|
118
|
+
|
119
|
+
def get(num)
|
120
|
+
if cnt = store.hget(STORAGE_KEY,num.to_s)
|
121
|
+
Yajl::Parser.new(symbolize_keys: true).parse(cnt)
|
122
|
+
else
|
123
|
+
nil
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def store
|
128
|
+
@store ||= (
|
129
|
+
log.info "Connecting to Redis."
|
130
|
+
log.debug "Connection settings: #{options.inspect}"
|
131
|
+
Redis.new(options)
|
132
|
+
)
|
133
|
+
end
|
134
|
+
|
135
|
+
def reconnect!
|
136
|
+
@store = nil
|
137
|
+
store
|
138
|
+
end
|
139
|
+
|
140
|
+
def shutdown!
|
141
|
+
@store = nil
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
# class MemcacheStore < StoreBase
|
147
|
+
#
|
148
|
+
#
|
149
|
+
#
|
150
|
+
# end
|
151
|
+
|
152
|
+
Stores = {
|
153
|
+
default: MemStore,
|
154
|
+
memory: MemStore,
|
155
|
+
redis: RedisStore,
|
156
|
+
# memcached: MemcachedStore
|
157
|
+
}
|
158
|
+
|
159
|
+
class << self
|
160
|
+
|
161
|
+
FORMAT = [
|
162
|
+
[:route,9],
|
163
|
+
[:office_code,1],
|
164
|
+
[:servicing_frb_number,9],
|
165
|
+
[:record_type_code,1],
|
166
|
+
[:change_date,6],
|
167
|
+
[:new_routing_number,9],
|
168
|
+
[:name,36],
|
169
|
+
[:address,36],
|
170
|
+
[:city,20],
|
171
|
+
[:state,2],
|
172
|
+
[:zip,5],
|
173
|
+
[:zip_ext,4],
|
174
|
+
[:phone_area,3],
|
175
|
+
[:phone_prefix,3],
|
176
|
+
[:phone_suffix,4],
|
177
|
+
[:institution_status_code,1],
|
178
|
+
[:data_view_code,1],
|
179
|
+
[:filler,5]
|
180
|
+
].freeze
|
181
|
+
|
182
|
+
DefaultOptions = {
|
183
|
+
store_in: :memory,
|
184
|
+
routing_data_url: "https://www.fededirectory.frb.org/FedACHdir.txt",
|
185
|
+
routing_data_file: File.expand_path(File.dirname(__FILE__)) + "/FedACHdir.txt",
|
186
|
+
fetch_fed_data: false,
|
187
|
+
store_opts: {},
|
188
|
+
mapping_file: File.expand_path(File.dirname(__FILE__) + "/mappings.json"),
|
189
|
+
metadata_file: File.expand_path(File.dirname(__FILE__) + "/metadata.json")
|
190
|
+
}.freeze
|
191
|
+
|
192
|
+
def init!(opts = {})
|
193
|
+
return if @initted
|
194
|
+
@options = options.merge(opts)
|
195
|
+
if options[:store_in]
|
196
|
+
store_in options[:store_in], options[:store_opts]
|
197
|
+
end
|
198
|
+
unless store.loaded?
|
199
|
+
log.info "Loading routing numbers..."
|
200
|
+
load_routing_numbers
|
201
|
+
log.info "Done loading routing numbers."
|
202
|
+
end
|
203
|
+
@initted = true
|
204
|
+
end
|
205
|
+
|
206
|
+
def options=(opts)
|
207
|
+
@options = options.merge(opts)
|
208
|
+
end
|
209
|
+
|
210
|
+
def get(num)
|
211
|
+
init!(options)
|
212
|
+
if cnt = store.get(num.to_s)
|
213
|
+
cnt
|
214
|
+
else
|
215
|
+
nil
|
216
|
+
end
|
217
|
+
end
|
218
|
+
alias_method :[], :get
|
219
|
+
alias_method :find, :get
|
220
|
+
|
221
|
+
def store_in(name, opts={})
|
222
|
+
raise InvalidStore unless s_cls = Stores[name.to_sym]
|
223
|
+
return if @store.is_a?(s_cls)
|
224
|
+
@store.shutdown! if @store
|
225
|
+
@store = s_cls.new(opts.merge(logger: log))
|
226
|
+
@initted = false
|
227
|
+
options[:store_in] = name.to_sym
|
228
|
+
options[:store_opts] = opts
|
229
|
+
init!
|
230
|
+
end
|
231
|
+
|
232
|
+
def reconnect!
|
233
|
+
log.info "Reconnecting!"
|
234
|
+
store.reconnect!
|
235
|
+
end
|
236
|
+
|
237
|
+
private
|
238
|
+
|
239
|
+
def store
|
240
|
+
@store ||= default_store
|
241
|
+
end
|
242
|
+
|
243
|
+
def default_store
|
244
|
+
Stores[:default].new(logger: log)
|
245
|
+
end
|
246
|
+
|
247
|
+
def options
|
248
|
+
@options ||= DefaultOptions.dup
|
249
|
+
end
|
250
|
+
|
251
|
+
def get_raw_data
|
252
|
+
unless options[:fetch_fed_data]
|
253
|
+
log.info "Using routing data from local file at: #{options[:routing_data_file]}"
|
254
|
+
File.new(options[:routing_data_file])
|
255
|
+
else
|
256
|
+
log.info "Getting new bank routing data from: #{options[:routing_data_url]}"
|
257
|
+
require 'typhoeus'
|
258
|
+
Typhoeus::Request.get(options[:routing_data_url], :ssl_verifypeer => false).body
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
def load_routing_numbers(data=get_raw_data)
|
263
|
+
if store.loading!
|
264
|
+
loading!
|
265
|
+
data.each_line do |line|
|
266
|
+
process_line line
|
267
|
+
end
|
268
|
+
store.done_loading!
|
269
|
+
done_loading!
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
def process_line(line)
|
274
|
+
obj = unpack_line(line)
|
275
|
+
rt = obj.delete(:route)
|
276
|
+
store.save rt, obj.merge(:routingnumber_id => rt.to_s).merge(@metadata[rt.to_s] || {})
|
277
|
+
@cur += 1
|
278
|
+
if @cur % 10 == 0
|
279
|
+
tm = Time.now - @st_time
|
280
|
+
print "\r #{@cur} loaded (#{tm.round(2)} seconds ~ #{tm > 0 ? (@cur / tm).round(0) : "?"}/sec) "
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
def pretty_maps
|
285
|
+
@pretty_maps
|
286
|
+
end
|
287
|
+
|
288
|
+
def loading!
|
289
|
+
@cur = 0
|
290
|
+
@st_time = Time.now
|
291
|
+
@pretty_maps = Yajl::Parser.parse(IO.read(options[:mapping_file]))
|
292
|
+
@metadata = Yajl::Parser.parse(IO.read(options[:metadata_file]))
|
293
|
+
end
|
294
|
+
|
295
|
+
def done_loading!
|
296
|
+
tm = Time.now - @st_time
|
297
|
+
print "\r #{@cur} loaded (#{tm.round(2)} seconds ~ #{tm > 0 ? (@cur / tm).round(0) : "?"}/sec) \n"
|
298
|
+
@cur = @st_time = @pretty_maps = @metadata = nil
|
299
|
+
end
|
300
|
+
|
301
|
+
def unpack_line(line)
|
302
|
+
vals = line.unpack(unpack_template)
|
303
|
+
obj = {}
|
304
|
+
FORMAT.each_with_index do |(name,length),i|
|
305
|
+
val = vals[i]
|
306
|
+
obj[name] = converted(name,val)
|
307
|
+
end
|
308
|
+
obj[:zip] = "#{obj.delete(:zip)}#{(ext = obj.delete(:zip_ext)) and ext.size > 0 ? "-#{ext}" : ""}"
|
309
|
+
obj[:phone] = "#{obj.delete(:phone_area)}-#{obj.delete(:phone_prefix)}-#{obj.delete(:phone_suffix)}"
|
310
|
+
obj.delete(:garbage)
|
311
|
+
obj
|
312
|
+
end
|
313
|
+
|
314
|
+
def converted(name,val)
|
315
|
+
if pretty_maps[name.to_s] and (v = pretty_maps[name.to_s][val])
|
316
|
+
v
|
317
|
+
else
|
318
|
+
val
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
def unpack_template
|
323
|
+
@unpack_format ||= FORMAT.map do |(name,length)|
|
324
|
+
"A#{length}"
|
325
|
+
end.join
|
326
|
+
end
|
327
|
+
|
328
|
+
def log
|
329
|
+
@logger ||= Logger.new(STDOUT)
|
330
|
+
end
|
331
|
+
|
332
|
+
end
|
333
|
+
|
334
|
+
end
|