Class: Adyen::AllowedOriginsCompanyLevelApi

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

Returns a new instance of AllowedOriginsCompanyLevelApi.



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

def service
  @service
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

#create_allowed_origin(request, companyId, apiCredentialId, headers: {}) ⇒ Object



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

def create_allowed_origin(request, companyId, apiCredentialId, headers: {} )
  """
  Create an allowed origin
  """
  endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [companyId,apiCredentialId]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#delete_allowed_origin(companyId, apiCredentialId, originId, headers: {}) ⇒ Object



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

def delete_allowed_origin(companyId, apiCredentialId, originId, headers: {} )
  """
  Delete an allowed origin
  """
  endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [companyId,apiCredentialId,originId]
  
  action = { method: "delete", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#get_allowed_origin(companyId, apiCredentialId, originId, headers: {}) ⇒ Object



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

def get_allowed_origin(companyId, apiCredentialId, originId, headers: {} )
  """
  Get an allowed origin
  """
  endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [companyId,apiCredentialId,originId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#list_allowed_origins(companyId, apiCredentialId, headers: {}) ⇒ Object



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

def list_allowed_origins(companyId, apiCredentialId, headers: {} )
  """
  Get a list of allowed origins
  """
  endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [companyId,apiCredentialId]
  
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end