lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb
require_relative '../service'
module Adyen
class TransferInstrumentsApi < Service
attr_accessor :service, :version
def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'LegalEntityManagement')
end
def create_transfer_instrument(request, headers: {})
endpoint = '/transferInstruments'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)
action = { method: 'post', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end
def delete_transfer_instrument(id, headers: {})
endpoint = '/transferInstruments/{id}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
action = { method: 'delete', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end
def get_transfer_instrument(id, headers: {})
endpoint = '/transferInstruments/{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 update_transfer_instrument(request, id, headers: {})
endpoint = '/transferInstruments/{id}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
action = { method: 'patch', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end
end
end