require_relative '../service' module Adyen class TerminalsTerminalLevelApi < Service attr_accessor :service, :version def initialize(client, version = DEFAULT_VERSION) super(client, version, 'Management') end def list_terminals(headers: {}, query_params: {}) endpoint = '/terminals'.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 reassign_terminal(request, terminal_id, headers: {}) endpoint = '/terminals/{terminalId}/reassign'.gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(%r{^/}, '') endpoint = format(endpoint, terminal_id) action = { method: 'post', url: endpoint } @client.call_adyen_api(@service, action, request, headers, @version) end end end