Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 963 Bytes

README.md

File metadata and controls

41 lines (26 loc) · 963 Bytes

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