Added birthday ident verification

This commit is contained in:
tsoganov 2025-01-27 16:26:20 +02:00
parent 34da6f250d
commit 55848e1000
5 changed files with 41 additions and 17 deletions

View file

@ -17,7 +17,7 @@ module Eeid
return render_invalid_signature unless valid_hmac_signature?(request.headers['X-HMAC-Signature'])
contact = Contact.find_by_code(permitted_params[:reference])
poi = catch_poi
poi = catch_poi(contact)
verify_contact(contact)
inform_registrar(contact, poi)
render json: { status: 'success' }, status: :ok
@ -55,8 +55,8 @@ module Eeid
end
end
def catch_poi
ident_service = Eeid::IdentificationService.new
def catch_poi(contact)
ident_service = Eeid::IdentificationService.new(contact.ident_type)
response = ident_service.get_proof_of_identity(permitted_params[:identification_request_id])
raise StandardError, response[:error] if response[:error].present?