Class: PersonaApi::SelfieVerificationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/persona_api/resources/selfie_verifications.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#delete_request, #get_request, #handle_response, #initialize, #patch_request, #post_request, #put_request

Constructor Details

This class inherits a constructor from PersonaApi::Resource

Instance Method Details

#create(**attributes) ⇒ Object



3
4
5
6
7
# File 'lib/persona_api/resources/selfie_verifications.rb', line 3

def create(**attributes)
  # Selfie attributes must include a 'verification-template-id' as well as other fields as laid out
  # in the documentation https://docs.withpersona.com/reference/create-a-selfie-verification
  SelfieVerification.new post_request("verification/selfies", body: attributes).body.dig("data")
end

#retrieve(ver_id:) ⇒ Object



9
10
11
# File 'lib/persona_api/resources/selfie_verifications.rb', line 9

def retrieve(ver_id:)
  SelfieVerification.new get_request("verification/selfies/#{ver_id}").body.dig("data")
end

#submit(ver_id:, **attributes) ⇒ Object



13
14
15
# File 'lib/persona_api/resources/selfie_verifications.rb', line 13

def submit(ver_id:, **attributes)
  SelfieVerification.new post_request("verification/selfies/#{ver_id}/submit", body: attributes).body.dig("data")
end