Git Product home page Git Product logo

bank_routing's Introduction

bank_routing

Description

Getting information about bank routing numbers is a huge pain. The authoritative source for this information is the Federal Reserve, and they only offer this information in a size-delimited text file available from their web site (that, by the way, has an iffy SSL certificate). This gem allows access to all of that information, plus a bunch of translations (mostly prettifying bank names) and extra metadata about the numbers and their corresponding institutions. This is an ongoing effort, and contributions are encouraged either in the code or in the JSON-encoded mapping and metadata files included in this repository.

A snapshot copy of the ACH directory is included in this package for testing purposes - it is not recommended that you use the included file in production environments. It is best to set the system to download a new ACH file on startup. The most current Federal Reserve ACH directory can always be found at https://www.frbservices.org/EPaymentsDirectory/FedACHdir.txt .

Example

require 'bank_routing'
RoutingNumber.get(121000358)["name"] # => "Bank of America"

Install

$ gem install bank_routing

Configuration

By default, the routing number database is loaded from a local copy of the Federal Reserve dump file and stored in memory (it's not really that big). To change that behavior:

require 'bank_routing/storage/redis'
RoutingNumber.init!( store_in: :redis, store_opts: { db: 15 }, fetch_fed_data: true )

This will store the routing number database, after being loaded from the Federal Reserve website, into Redis in database number 15. Access works exactly the same.

You can also configure the service independently of loading the routing database. This works especially well in systems where there are child processes connecting to the same store (Redis, for example). In this case, the routing database will be loaded on first access (by the first child process of a Unicorn web server, for example) - it's essentially lazy-loaded, so a priming call is suggested after system startup. It is worth noting that if a shared data store is used (Redis), it will load the database only once, no matter how many processes attempt access.

require 'bank_routing/storage/redis'
RoutingNumber.options = {
	store_in: :redis,
	store_opts: {
		db: 15
	},
	fetch_fed_data: true
}

Copyright

Copyright (c) 2014 Cozy Services Ltd.

See {file:LICENSE.txt} for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.