Sha256: f685f64dff14a7de03bf75e8af4c0a60cd093f5b85ac37b329f85a1c49d4c1a6

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

require 'rest-client'
require_relative './client'
require_relative './signature'
require_relative 'paginated'

RestClient.add_before_execution_proc do |req, params|
  next unless params[:url].include?('bunq.com')
  req['X-Bunq-Client-Request-Id'] = params[:headers][:'X-Bunq-Client-Request-Id'] = SecureRandom.uuid

  # can't sign the creation of an installation
  # see https://doc.bunq.com/api/1/call/installation/method/post
  next if params[:url].end_with?('/installation') && req.method == 'POST'
  req['X-Bunq-Client-Signature'] = Bunq.signature.create(
    params[:method].upcase,
    req.path,
    params[:headers],
    params[:payload]
  )
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bunq-client-0.1.1 lib/bunq/bunq.rb
bunq-client-0.1.0 lib/bunq/bunq.rb