Class: KYCAID::Applicant

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

Overview

Applicant is wrapper for KYCAID Applicants 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

Creates new applicant, params is a Hash.

  • :type - required The applicant type. Valid values are PERSON or COMPANY.

  • :first_name - required The applicant’s first name.

  • :last_name - required The applicant’s last name.

  • :dob - required The applicant’s day of birth date. (ISO 8601, YYYY-MM-DD).

  • :residence_country - required The applicant’s current nationality. Example: GB (ISO 3166-2).

  • :email - required The applicant’s email address.

  • :phone - required The phone number of applicant.

Returns Response object, conatining applicant_id.



16
17
18
19
# File 'lib/kycaid/applicant.rb', line 16

def self.create(params)
  protected_params = params.slice(:type, :first_name, :last_name, :dob, :residence_country, :email, :phone)
  respond(post("/applicants", protected_params))
end

.fetch(applicant_id) ⇒ Object

Send get request to retrieve applicant by his ID.

Returns Response object, conatining:

  • :applicant_id

  • :first_name

  • :last_name

  • :dob

  • :residence_country

  • :email



30
31
32
# File 'lib/kycaid/applicant.rb', line 30

def self.fetch(applicant_id)
  respond(get("/applicants/#{applicant_id}"))
end