Sha256: 9d1987c4604737e46926a44ba6aa68fb537664aced385b3aa6923907efd6cc09

Contents?: true

Size: 1.99 KB

Versions: 14

Compression:

Stored size: 1.99 KB

Contents

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

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

    def create_allowed_origin(request, merchant_id, api_credential_id, headers: {})
      endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, merchant_id, api_credential_id)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    def delete_allowed_origin(merchant_id, api_credential_id, origin_id, headers: {})
      endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, merchant_id, api_credential_id, origin_id)
      
      action = { method: 'delete', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_allowed_origin(merchant_id, api_credential_id, origin_id, headers: {})
      endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, merchant_id, api_credential_id, origin_id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def list_allowed_origins(merchant_id, api_credential_id, headers: {})
      endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, merchant_id, api_credential_id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adyen-ruby-api-library-10.0.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.9.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.8.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.7.1 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.7.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.6.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.5.2 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.5.1 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.5.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.3.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.2.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.1.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-9.0.0 lib/adyen/services/management/allowed_origins_merchant_level_api.rb
adyen-ruby-api-library-8.0.1 lib/adyen/services/management/allowed_origins_merchant_level_api.rb