Sha256: f8d433c715a44e2f293f30b4539492584058adfa0efac62090ed73a1bea5c6aa

Contents?: true

Size: 852 Bytes

Versions: 9

Compression:

Stored size: 852 Bytes

Contents

module MangoPay
  # Provides API methods for the UBO entity.
  class Ubo < Resource
    class << self
      def url(user_id, ubo_declaration_id, id = nil)
        if id
          "#{MangoPay.api_path}/users/#{user_id}/kyc/ubodeclarations/#{ubo_declaration_id}/ubos/#{id}"
        else
          "#{MangoPay.api_path}/users/#{user_id}/kyc/ubodeclarations/#{ubo_declaration_id}/ubos"
        end
      end

      def create(user_id, ubo_declaration_id, params)
        MangoPay.request(:post, url(user_id, ubo_declaration_id), params)
      end

      def fetch(user_id, ubo_declaration_id, ubo_id)
        MangoPay.request(:get, url(user_id, ubo_declaration_id, ubo_id))
      end

      def update(user_id, ubo_declaration_id, ubo_id, params)
        MangoPay.request(:put, url(user_id, ubo_declaration_id, ubo_id), params)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mangopay-3.2.0 lib/mangopay/ubo.rb
mangopay-3.1.0 lib/mangopay/ubo.rb
mangopay-3.0.38 lib/mangopay/ubo.rb
mangopay-3.0.37 lib/mangopay/ubo.rb
mangopay-3.0.36 lib/mangopay/ubo.rb
mangopay-3.0.35 lib/mangopay/ubo.rb
mangopay-3.0.34 lib/mangopay/ubo.rb
mangopay-3.0.33 lib/mangopay/ubo.rb
mangopay-3.0.32 lib/mangopay/ubo.rb