Module: Bunq

Defined in:
lib/bunq/client.rb,
lib/bunq/card.rb,
lib/bunq/user.rb,
lib/bunq/cards.rb,
lib/bunq/errors.rb,
lib/bunq/payment.rb,
lib/bunq/version.rb,
lib/bunq/payments.rb,
lib/bunq/resource.rb,
lib/bunq/encryptor.rb,
lib/bunq/paginated.rb,
lib/bunq/signature.rb,
lib/bunq/user_person.rb,
lib/bunq/installation.rb,
lib/bunq/user_company.rb,
lib/bunq/installations.rb,
lib/bunq/device_servers.rb,
lib/bunq/qr_code_content.rb,
lib/bunq/session_servers.rb,
lib/bunq/monetary_account.rb,
lib/bunq/monetary_accounts.rb,
lib/bunq/certificate_pinned.rb,
lib/bunq/draft_share_invite_bank.rb,
lib/bunq/notification_filter_url.rb,
lib/bunq/draft_share_invite_banks.rb,
lib/bunq/attachment_public_content.rb

Overview

Usage

Bunq.configure do |config|
  config.api_key = 'YOUR_APIKEY'
  config.installation_token = 'YOUR_INSTALLATION_TOKEN'
  config.private_key = 'YOUR PRIVATE KEY'
  config.server_public_key = 'SERVER PUBLIC KEY'
end

client = Bunq.client
number_of_accounts = client.me_as_user.monetary_accounts.index.to_a.count
puts "User has #{number_of_accounts} accounts"

Defined Under Namespace

Classes: AbsentResponseSignature, AttachmentPublicContent, Card, Cards, CertificatePinned, Client, Configuration, DeviceServers, DraftShareInviteBank, DraftShareInviteBanks, Encryptor, Installation, Installations, MaintenanceResponse, MissingPaginationObject, MonetaryAccount, MonetaryAccounts, NoSessionCache, NotificationFilterUrl, Paginated, Payment, Payments, QrCodeContent, RequestSignatureRequired, Resource, ResourceNotFound, ResponseError, SessionServers, Signature, ThreadSafeSessionCache, Timeout, TooManyRequestsResponse, UnauthorisedResponse, UnexpectedResponse, User, UserCompany, UserPerson

Constant Summary collapse

VERSION =
"0.6.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



39
40
41
# File 'lib/bunq/client.rb', line 39

def configuration
  @configuration
end

Class Method Details

.clientObject

Returns a new instance of Client with the current configuration.



55
56
57
58
# File 'lib/bunq/client.rb', line 55

def client
  fail "No configuration! Call Bunq.configure first." unless configuration
  Client.new(configuration.dup)
end

.configure {|configuration| ... } ⇒ Object

Yields:



41
42
43
44
45
46
# File 'lib/bunq/client.rb', line 41

def configure
  self.configuration ||= Configuration.new
  yield(configuration)

  configuration.base_url = Configuration::SANDBOX_BASE_URL if configuration.sandbox
end

.reset_configurationObject



48
49
50
# File 'lib/bunq/client.rb', line 48

def reset_configuration
  self.configuration = nil
end