Class: Adyen::AccountStoreLevelApi

Inherits:
Service
  • Object
show all
Defined in:
lib/adyen/services/management/account_store_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) ⇒ AccountStoreLevelApi

Returns a new instance of AccountStoreLevelApi.



8
9
10
11
12
# File 'lib/adyen/services/management/account_store_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/account_store_level_api.rb', line 6

def service
  @service
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

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



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

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

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



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

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

#get_store(merchantId, storeId, headers: {}) ⇒ Object



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

def get_store(merchantId, storeId, headers: {} )
  """
  Get a store
  """
  endpoint = "/merchants/{merchantId}/stores/{storeId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId,storeId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#get_store_by_id(storeId, headers: {}) ⇒ Object



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

def get_store_by_id(storeId, headers: {} )
  """
  Get a store
  """
  endpoint = "/stores/{storeId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [storeId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_stores(headers: {}, queryParams: {}) ⇒ Object



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

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

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



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

def list_stores_by_merchant_id(merchantId, headers: {} , queryParams: {})
  """
  Get a list of stores
  """
  endpoint = "/merchants/{merchantId}/stores".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_store(request, merchantId, storeId, headers: {}) ⇒ Object



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

def update_store(request, merchantId, storeId, headers: {} )
  """
  Update a store
  """
  endpoint = "/merchants/{merchantId}/stores/{storeId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [merchantId,storeId]
  
  action = { method: "patch", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#update_store_by_id(request, storeId, headers: {}) ⇒ Object



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

def update_store_by_id(request, storeId, headers: {} )
  """
  Update a store
  """
  endpoint = "/stores/{storeId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [storeId]
  
  action = { method: "patch", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end