Sha256: e53e91daeb3e2fa0f5e5d883096e0df1fc2f5d1f805b94c538d930514b72b221

Contents?: true

Size: 770 Bytes

Versions: 9

Compression:

Stored size: 770 Bytes

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)
        MangoPay.request(:post, url(user_id))
      end

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

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