Gem was moved to Gibbon repository
A wrapper for ibanrechner.de API. It allows converting bank account data from legacy syntax to new SEPA IBAN/BIC.
Add this line to your application's Gemfile:
gem 'iban_calculator', git: 'https://github.com/getsurance/iban_calculator'
And then execute:
$ bundle
In order to use this gem, you first need to create an account at iban-bic.com.
Configuration can be done with a block:
IbanCalculator.configure do |config|
config.user = 'username',
config.password = 'password'
config.logger = Logger.new(STDERR)
end
You can validate an IBAN:
IbanCalculator.validate_iban('AL90208110080000001039531801')
You can validate bank info:
IbanCalculator.validate_bank_info(country: 'DE', account_number: '123', bank_code: '456')
Example data can be found at: http://www.iban-bic.com/sample_accounts.html
Validations return a IbanCalculator::Response
object that can be queried:
response = IbanCalculator.validate_iban('AL90208110080000001039531801')
response.valid? # true or false
response.conclusive? # if the response is valid but not conclusive you might want to check it manually.
- Fork it ( https://github.com/[my-github-username]/iban_calculator/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request