Sha256: e022f9c874135c575d98aa5533f61e80d7a33f31a81cede42b7bd5d023c78e24

Contents?: true

Size: 1.89 KB

Versions: 8

Compression:

Stored size: 1.89 KB

Contents

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

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

    def get_legal_entity(id, headers: {})
      endpoint = '/legalEntities/{id}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_all_business_lines_under_legal_entity(id, headers: {})
      endpoint = '/legalEntities/{id}/businessLines'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def update_legal_entity(request, id, headers: {})
      endpoint = '/legalEntities/{id}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'patch', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

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

    def check_legal_entitys_verification_errors(id, headers: {})
      endpoint = '/legalEntities/{id}/checkVerificationErrors'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, {}, 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/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-8.0.0.pre.beta.1 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.3.1 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.3.0 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.2.0 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.1.0 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.0.3 lib/adyen/services/legalEntityManagement/legal_entities_api.rb
adyen-ruby-api-library-7.0.2 lib/adyen/services/legalEntityManagement/legal_entities_api.rb