oriolgual / clabe

Ruby gem to validate and get details from a CLABE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLABE validator

Installation

  • Add gem "clabe" to your application's Gemfile and then execute bundle.
  • Or install it yourself as: gem install clabe

Usage

Validate and serialize

Successfully validation

CLABE = '002114016003269412'
Clabe.validate(CLABE)
# returns { is_valid: true, bank_tag: 'BANAMEX', city: 'Huixtla' }

Invalid validation

CLABE = '002010077777777779'
Clabe.validate(CLABE)
# returns { is_valid: false, error: 'Must have a valid control digit' }

License

The gem is available as open source under the terms of the MIT License.

Contributing

Bug reports and pull requests are welcome on GitHub at yellowme/clabe.

Development

After checking out the repo. run rake spec to run the tests.

Extra

Strongly based on this JS version center-key/clabe-validator

About

Ruby gem to validate and get details from a CLABE

License:MIT License


Languages

Language:Ruby 100.0%