Class: Adyen::PosTerminalManagement

Inherits:
Service
  • Object
show all
Defined in:
lib/adyen/services/posTerminalManagement.rb

Constant Summary collapse

DEFAULT_VERSION =
1

Instance Attribute Summary collapse

Attributes inherited from Service

#create_query_string

Instance Method Summary collapse

Methods inherited from Service

action_for_method_name

Constructor Details

#initialize(client, version = DEFAULT_VERSION) ⇒ PosTerminalManagement

Returns a new instance of PosTerminalManagement.



9
10
11
12
13
# File 'lib/adyen/services/posTerminalManagement.rb', line 9

def initialize(client, version = DEFAULT_VERSION)
  @service = "PosTerminalManagement"
  @client = client
  @version = version
end

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/adyen/services/posTerminalManagement.rb', line 6

def service
  @service
end

#versionObject

Returns the value of attribute version.



6
7
8
# File 'lib/adyen/services/posTerminalManagement.rb', line 6

def version
  @version
end

Instance Method Details

#assign_terminals(request, headers: {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/adyen/services/posTerminalManagement.rb', line 15

def assign_terminals(request, headers: {} )
  """
  Assign terminals
  """
  endpoint = "/assignTerminals".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#find_terminal(request, headers: {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/adyen/services/posTerminalManagement.rb', line 27

def find_terminal(request, headers: {} )
  """
  Get the account or store of a terminal
  """
  endpoint = "/findTerminal".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#get_stores_under_account(request, headers: {}) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/adyen/services/posTerminalManagement.rb', line 39

def (request, headers: {} )
  """
  Get the stores of an account
  """
  endpoint = "/getStoresUnderAccount".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#get_terminal_details(request, headers: {}) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/adyen/services/posTerminalManagement.rb', line 51

def get_terminal_details(request, headers: {} )
  """
  Get the details of a terminal
  """
  endpoint = "/getTerminalDetails".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#get_terminals_under_account(request, headers: {}) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/adyen/services/posTerminalManagement.rb', line 63

def (request, headers: {} )
  """
  Get the list of terminals
  """
  endpoint = "/getTerminalsUnderAccount".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end