Sha256: c77ac9bdabdfc61c439262c6fa6ee5e90a9ef732fb7617d612720f836af5fe49

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 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, idempotency_key)
        MangoPay.request(:post, url(user_id), {}, {}, idempotency_key)
      end

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

      def update(user_id, id, params = {}, idempotency_key)
        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

2 entries across 2 versions & 1 rubygems

Version Path
mangopay-3.4.0 lib/mangopay/ubo_declaration.rb
mangopay-3.3.0 lib/mangopay/ubo_declaration.rb