Sha256: d215c739f603f866eb278ae1bb2f1ccfdc426faf556e3bb9ab7d4e1698ac9d8b

Contents?: true

Size: 1.08 KB

Versions: 26

Compression:

Stored size: 1.08 KB

Contents

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

      def create(user_id, idempotency_key = nil)
        MangoPay.request(:post, url(user_id), {}, {}, idempotency_key)
      end

      # Fetches the Ubo declaration belonging to the given +user_id+ if given, with the given +id+.
      def fetch(user_id, id, idempotency_key = nil)
        url = (user_id) ? url(user_id, id) : "#{MangoPay.api_path}/kyc/ubodeclarations/#{CGI.escape(id.to_s)}"
        MangoPay.request(:get, url, {}, {}, idempotency_key)
      end

      def update(user_id, id, params = {}, idempotency_key = nil)
        request_params = {
            Status: params['Status'],
            Ubos: params['Ubos']
        }
        MangoPay.request(:put, url(user_id, id), request_params, {}, idempotency_key)
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mangopay-3.28.0 lib/mangopay/ubo_declaration.rb
mangopay-3.27.0 lib/mangopay/ubo_declaration.rb
mangopay-3.26.1 lib/mangopay/ubo_declaration.rb
mangopay-3.26.0 lib/mangopay/ubo_declaration.rb
mangopay-3.25.1 lib/mangopay/ubo_declaration.rb
mangopay-3.25.0 lib/mangopay/ubo_declaration.rb
mangopay-3.24.1 lib/mangopay/ubo_declaration.rb
mangopay-3.24.0 lib/mangopay/ubo_declaration.rb
mangopay-3.23.0 lib/mangopay/ubo_declaration.rb
mangopay-3.22.0 lib/mangopay/ubo_declaration.rb
mangopay-3.21.0 lib/mangopay/ubo_declaration.rb
mangopay-3.20.0 lib/mangopay/ubo_declaration.rb
mangopay-3.19.0 lib/mangopay/ubo_declaration.rb
mangopay-3.18.0 lib/mangopay/ubo_declaration.rb
mangopay-3.17.0 lib/mangopay/ubo_declaration.rb
mangopay-3.16.0 lib/mangopay/ubo_declaration.rb
mangopay-3.15.0 lib/mangopay/ubo_declaration.rb
mangopay-3.14.0 lib/mangopay/ubo_declaration.rb
mangopay-3.13.2 lib/mangopay/ubo_declaration.rb
mangopay-3.12.0 lib/mangopay/ubo_declaration.rb