Class: Adyen::TerminalOrdersMerchantLevelApi

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

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) ⇒ TerminalOrdersMerchantLevelApi

Returns a new instance of TerminalOrdersMerchantLevelApi.



8
9
10
11
12
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 8

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

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



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

def service
  @service
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

#cancel_order(merchantId, orderId, headers: {}) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 122

def cancel_order(merchantId, orderId, headers: {} )
  """
  Cancel an order
  """
  endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}/cancel".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId,orderId]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#create_order(request, merchantId, headers: {}) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 110

def create_order(request, merchantId, headers: {} )
  """
  Create an order
  """
  endpoint = "/merchants/{merchantId}/terminalOrders".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#create_shipping_location(request, merchantId, headers: {}) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 98

def create_shipping_location(request, merchantId, headers: {} )
  """
  Create a shipping location
  """
  endpoint = "/merchants/{merchantId}/shippingLocations".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#get_order(merchantId, orderId, headers: {}) ⇒ Object



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

def get_order(merchantId, orderId, headers: {} )
  """
  Get an order
  """
  endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId,orderId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_billing_entities(merchantId, headers: {}, queryParams: {}) ⇒ Object



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

def list_billing_entities(merchantId, headers: {} , queryParams: {})
  """
  Get a list of billing entities
  """
  endpoint = "/merchants/{merchantId}/billingEntities".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_orders(merchantId, headers: {}, queryParams: {}) ⇒ Object



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

def list_orders(merchantId, headers: {} , queryParams: {})
  """
  Get a list of orders
  """
  endpoint = "/merchants/{merchantId}/terminalOrders".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_shipping_locations(merchantId, headers: {}, queryParams: {}) ⇒ Object



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

def list_shipping_locations(merchantId, headers: {} , queryParams: {})
  """
  Get a list of shipping locations
  """
  endpoint = "/merchants/{merchantId}/shippingLocations".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_terminal_models(merchantId, headers: {}) ⇒ Object



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

def list_terminal_models(merchantId, headers: {} )
  """
  Get a list of terminal models
  """
  endpoint = "/merchants/{merchantId}/terminalModels".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_terminal_products(merchantId, headers: {}, queryParams: {}) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 74

def list_terminal_products(merchantId, headers: {} , queryParams: {})
  """
  Get a list of terminal products
  """
  endpoint = "/merchants/{merchantId}/terminalProducts".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId]
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#update_order(request, merchantId, orderId, headers: {}) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/adyen/services/management/terminal_orders_merchant_level_api.rb', line 86

def update_order(request, merchantId, orderId, headers: {} )
  """
  Update an order
  """
  endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId,orderId]
  
  action = { method: "patch", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end