Class: Adyen::ClientKeyCompanyLevelApi

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

Returns a new instance of ClientKeyCompanyLevelApi.



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

def version
  @version
end

Instance Method Details

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



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

def generate_new_client_key(companyId, apiCredentialId, headers: {} )
  """
  Generate new client key
  """
  endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [companyId,apiCredentialId]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end