Class: SmileIdentityCore::AddressVerification

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
lib/smile-identity-core/address_verification.rb

Overview

The Address Verification Service allows you to verify address details provided by a user, by comparing the address details provided by the user to the address details on file with the authorities database. For more info visit docs.usesmileid.com/

Instance Method Summary collapse

Methods included from Validations

#validate_id_info, #validate_partner_params

Constructor Details

#initialize(partner_id, api_key, sid_server) ⇒ AddressVerification

Initialize Address Verification

Parameters:

  • :partner_id (String)

    A unique number assigned by Smile ID to your account. Can be found in the portal

  • :api_key (String)

    Your API key from the Smile Identity portal

  • :sid_server (String)

    Use 0 for the sandbox server, use 1 for production server



20
21
22
23
24
25
# File 'lib/smile-identity-core/address_verification.rb', line 20

def initialize(partner_id, api_key, sid_server)
  @api_key = api_key
  @partner_id = partner_id.to_s
  @sid_server = sid_server
  @url = SmileIdentityCore::ENV.determine_url(sid_server)
end

Instance Method Details

#submit_job(params) ⇒ Object

Submit Address Verification

Parameters:

  • params (Hash)

    the options to create a job with.

Options Hash (params):

  • :country (String) — default: required

    The user’s country (e.g., NG or ZA).

  • :address (String) — default: required

    The user’s address.

  • :utility_number (String) — default: required for NG

    The utility account number.

  • :utility_provider (String) — default: required for NG

    The utility provider.

  • :id_number (String) — default: required for ZA

    The national ID number.

  • :full_name (String) — default: optional

    The user’s full name.

  • :callback_url (String) — default: required

    The callback URL.



37
38
39
40
# File 'lib/smile-identity-core/address_verification.rb', line 37

def submit_job(params)
  @params = symbolize_keys(params)
  submit_requests
end