Sha256: 3e9c41f1042f32c7674234905a17893ea44d8b357a4e32a210bd3dfd79afcc9a

Contents?: true

Size: 1.72 KB

Versions: 13

Compression:

Stored size: 1.72 KB

Contents

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

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

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

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

    def get_terms_of_service_information_for_legal_entity(id, headers: {})
      endpoint = '/legalEntities/{id}/termsOfServiceAcceptanceInfos'.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_terms_of_service_status(id, headers: {})
      endpoint = '/legalEntities/{id}/termsOfServiceStatus'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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