Sha256: fa739ffdb247e00d307734deaa24bac2b6b8b3e9a0b24677da33f904242dcf75

Contents?: true

Size: 1.5 KB

Versions: 14

Compression:

Stored size: 1.5 KB

Contents

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

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

    def create_business_line(request, headers: {})
      endpoint = '/businessLines'.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 delete_business_line(id, headers: {})
      endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, id)
      
      action = { method: 'delete', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_business_line(id, headers: {})
      endpoint = '/businessLines/{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 update_business_line(request, id, headers: {})
      endpoint = '/businessLines/{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

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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