Sha256: df0dbbe58c8ad00e5ac11c9c151fa47e9855a62daaec32f6c8a1964fe804944d

Contents?: true

Size: 1.82 KB

Versions: 8

Compression:

Stored size: 1.82 KB

Contents

require_relative '../service'
module Adyen
  class APICredentialsCompanyLevelApi < Service
    attr_accessor :service, :version

    def initialize(client, version = DEFAULT_VERSION)
      super(client, version, 'Management')
    end

    def list_api_credentials(company_id, headers: {}, query_params: {})
      endpoint = '/companies/{companyId}/apiCredentials'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, company_id)
      endpoint += create_query_string(query_params)
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_api_credential(company_id, api_credential_id, headers: {})
      endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, company_id, api_credential_id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def update_api_credential(request, company_id, api_credential_id, headers: {})
      endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, company_id, api_credential_id)
      
      action = { method: 'patch', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    def create_api_credential(request, company_id, headers: {})
      endpoint = '/companies/{companyId}/apiCredentials'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, company_id)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
adyen-ruby-api-library-8.0.0 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-8.0.0.pre.beta.1 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.3.1 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.3.0 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.2.0 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.1.0 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.0.3 lib/adyen/services/management/api_credentials_company_level_api.rb
adyen-ruby-api-library-7.0.2 lib/adyen/services/management/api_credentials_company_level_api.rb