Class: KYCAID::Verification

Inherits:
Response
  • Object
show all
Extended by:
Client
Defined in:
lib/kycaid/verification.rb

Overview

Verification is wrapper for KYCAID Verifications endpoints.

Class Method Summary collapse

Methods included from Client

conn, file_payload, file_post, file_put, get, multipart_conn, patch, post, sandbox?

Methods inherited from Response

#handle_error, #initialize, respond

Constructor Details

This class inherits a constructor from KYCAID::Response

Class Method Details

.create(params) ⇒ Object

Create a verification.

  • :applicant_id - required The applicant unique identificator that received in response of Applicant#create.

  • :types - required The verification types. Valid values are: DOCUMENT, FACIAL, ADDRESS, AML, FINANCIAL, VIDEO, COMPANY.

  • :callback_url - required URL on which the result will come.

  • :form_id - optional The form unique identificator. Used for inheritance of form configuration like ACR and email templates.

See docs.kycaid.com/#create-a-verification for more info.

Returns Response object, conatining verification_id.



15
16
17
18
# File 'lib/kycaid/verification.rb', line 15

def self.create(params)
  protected_params = params.slice(:applicant_id, :types, :callback_url, :form_id)
  respond(post("/verifications", protected_params))
end

.fetch(verification_id) ⇒ Object

Retrieve a verification by it’s id.

Returns Response object, conatining:

  • :verification_id - The verification’s unique identificator.

  • :status - Status of verification. Possible values: unused, pending, completed.

  • :verified - Result of verification. Possible values: true or false.

  • :verifications - VerificationsList object.

See docs.kycaid.com/#retrieve-a-verification for more info.



29
30
31
# File 'lib/kycaid/verification.rb', line 29

def self.fetch(verification_id)
  respond(get("/verifications/#{verification_id}"))
end