forked from Adyen/adyen-ruby-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
terminalCloudAPI.rb
38 lines (30 loc) · 1.09 KB
/
terminalCloudAPI.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require_relative './service'
module Adyen
class TerminalCloudAPI < Service
attr_accessor :service
def initialize(client)
super(client, nil ,'TerminalCloudAPI')
end
def connected_terminals(request, headers: {})
endpoint = '/connectedTerminals'.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 sync(request, headers: {})
endpoint = '/sync'.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 async(request, headers: {})
endpoint = '/async'.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