Class: PersonaApi::GovernmentIdVerificationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/persona_api/resources/government_id_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/government_id_verifications.rb', line 3

def create(**attributes)
  # Gov ID 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-government-id-verification
  GovernmentIdVerification.new post_request("verification/government-ids", body: attributes).body.dig("data")
end

#retrieve(ver_id:) ⇒ Object



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

def retrieve(ver_id:)
  GovernmentIdVerification.new get_request("verification/government-ids/#{ver_id}").body.dig("data")
end

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



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

def submit(ver_id:, **attributes)
  GovernmentIdVerification.new post_request("verification/government-ids/#{ver_id}/submit", body: attributes).body.dig("data")
end