No commit activity in last 3 years
No release in over 3 years
Encapsulates and validates the completeness of ebics credentials
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.10
~> 5
~> 10.0
~> 3
 Project Readme

EbicsCredentials

EbicsCredentials is a tiny wrapper for keeping together ebics credentials.

Installation

Add this line to your application's Gemfile:

gem 'ebics_credentials'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ebics_credentials

Usage

Feeding with a credentials hash

Take a credentials hash and initialize an EbicsCredentials instance with it.

credential_hash = {
  key:        "key",
  url:        "url",
  host_id:    "host_id",
  user_id:    "user_id",
  partner_id: "partner_id"
  passphrase: "passphrase",
}

credentials = EbicsCredentials.new(credential_hash)

At initialization, the completeness of the attributes will be validated. If they are invalid, EbicsCredentials::Error::Invalid will be raised.

Feeding with a base64 encoded json hash

To create an instance from a base64 encoded json string, use .from_encoded_json:

credential_hash = {
  key:        "key",
  url:        "url",
  host_id:    "host_id",
  user_id:    "user_id",
  partner_id: "partner_id"
  passphrase: "passphrase",
}

encoded_json = Base64.decode64(credential_hash.to_json)

credentials = EbicsCredentials.from_encoded_json(encoded_json)

When the given argument is not valid json, EbicsCredentials::Errors::Invalid will be raised.

Attribute accessors are provided:

credentials.key        # => "key"
credentials.host_id    # => "host_id"
credentials.partner_id # => "partner_id"
credentials.user_id    # => "user_id"
credentials.passphrase # => "passphrase"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/romanlehnert/ebics_credentials.

License

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