Class: Adyen::APICredentialsMerchantLevelApi
- Defined in:
- lib/adyen/services/management/api_credentials_merchant_level_api.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Service
Instance Method Summary collapse
- #create_api_credential(request, merchantId, headers: {}) ⇒ Object
- #get_api_credential(merchantId, apiCredentialId, headers: {}) ⇒ Object
-
#initialize(client, version = DEFAULT_VERSION) ⇒ APICredentialsMerchantLevelApi
constructor
A new instance of APICredentialsMerchantLevelApi.
- #list_api_credentials(merchantId, headers: {}, queryParams: {}) ⇒ Object
- #update_api_credential(request, merchantId, apiCredentialId, headers: {}) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(client, version = DEFAULT_VERSION) ⇒ APICredentialsMerchantLevelApi
Returns a new instance of APICredentialsMerchantLevelApi.
8 9 10 11 12 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 8 def initialize(client, version = DEFAULT_VERSION) @service = "Management" @client = client @version = version end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 6 def service @service end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 6 def version @version end |
Instance Method Details
#create_api_credential(request, merchantId, headers: {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 50 def create_api_credential(request, merchantId, headers: {} ) """ Create an API credential """ endpoint = "/merchants/{merchantId}/apiCredentials".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [merchantId] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#get_api_credential(merchantId, apiCredentialId, headers: {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 26 def get_api_credential(merchantId, apiCredentialId, headers: {} ) """ Get an API credential """ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [merchantId,apiCredentialId] action = { method: "get", url: endpoint} @client.call_adyen_api(@service, action, {}, headers, @version) end |
#list_api_credentials(merchantId, headers: {}, queryParams: {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 14 def list_api_credentials(merchantId, headers: {} , queryParams: {}) """ Get a list of API credentials """ endpoint = "/merchants/{merchantId}/apiCredentials".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_api_credential(request, merchantId, apiCredentialId, headers: {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/adyen/services/management/api_credentials_merchant_level_api.rb', line 38 def update_api_credential(request, merchantId, apiCredentialId, headers: {} ) """ Update an API credential """ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [merchantId,apiCredentialId] action = { method: "patch", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |