A Ruby client for the bunq API.
Add this line to your application's Gemfile:
gem 'bunq'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bunq
Bunq.configure do |config|
config.api_key = '...'
config.url = 'https://api.bunq.com'
# config.url = 'https://sandbox.public.api.bunq.com' # Sandbox
config.version = 'v1'
end
To create an installation.
# Create keypair
keys = Bunq::KeyPair.generate
client = Bunq::Client.new do |config|
config.api_key = '...'
config.private_key = keys.private_key
end
# Create installation
installation = client.installations.create(keys.public_key)
# Configure installation
client.installation_token = installation.token
client.server_public_key = installation.server_public_key
client = Bunq::Client.new do |config|
config.api_key = '...'
config.private_key = keys.private_key
config.installation_token = '...'
config.server_public_key = '...'
end
To create a device server.
device_server = client.device_servers.create("My server")
device_server.id
To create a session server.
session_server = client.session_servers.create
session_server.token
Get a list of all available users.
users = client.users.list
Get a specific user.
user = client.users.get(1)
Get a list of monetary account bank for a given user.
user = client.users.get(1)
monetary_accounts = user.monetary_account_bank.list
Get a list of all payments done for a given monetary account.
user = client.users.get(1)
monetary_account = user.monetary_account_bank.get(1)
payments = monetary_account.payments.list type: "IDEAL"
Bug reports and pull requests are welcome on GitHub at https://github.com/BeginRescue/bunq. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.