Sha256: e5501e7fd8c16c29560f907b74ce1c363178a2501003dff62fd36739933dd234

Contents?: true

Size: 1.19 KB

Versions: 22

Compression:

Stored size: 1.19 KB

Contents

require_relative '../service'
module Adyen
  class CapitalApi < Service
    attr_accessor :service, :version

    def initialize(client, version = DEFAULT_VERSION)
      super(client, version, 'Transfers')
    end

    def get_capital_account(headers: {}, query_params: {})
      endpoint = '/grants'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      endpoint += create_query_string(query_params)
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_grant_reference_details(id, headers: {})
      endpoint = '/grants/{id}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def request_grant_payout(request, headers: {})
      endpoint = '/grants'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
adyen-ruby-api-library-7.0.3 lib/adyen/services/transfers/capital_api.rb
adyen-ruby-api-library-7.0.2 lib/adyen/services/transfers/capital_api.rb