Sha256: fbba95f3be3f857b183df32d63b7811f3ae2602e6f12b7de01e3178bb89d053c

Contents?: true

Size: 648 Bytes

Versions: 9

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

module Onfido
  class LivePhoto < Resource
    # with open-uri the file can be a link or an actual file

    def create(applicant_id:, file:, **payload)
      validate_file!(file)
      payload[:applicant_id] = applicant_id
      payload[:file] = file

      post(path: 'live_photos', payload: payload, send_json: false)
    end

    def find(live_photo_id)
      get(path: "live_photos/#{live_photo_id}")
    end

    def download(live_photo_id)
      get(path: "live_photos/#{live_photo_id}/download")
    end

    def all(applicant_id)
      get(path: "live_photos?applicant_id=#{applicant_id}")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
onfido-2.9.0 lib/onfido/resources/live_photo.rb
onfido-2.8.0 lib/onfido/resources/live_photo.rb
onfido-2.7.0 lib/onfido/resources/live_photo.rb
onfido-2.6.0 lib/onfido/resources/live_photo.rb
onfido-2.5.0 lib/onfido/resources/live_photo.rb
onfido-2.4.0 lib/onfido/resources/live_photo.rb
onfido-2.3.0 lib/onfido/resources/live_photo.rb
onfido-2.2.0 lib/onfido/resources/live_photo.rb
onfido-2.1.1 lib/onfido/resources/live_photo.rb