unit_ruby_sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +5 -3
- data/lib/unit/api_resources/application_resource.rb +51 -57
- data/lib/unit/api_resources/base_resource.rb +31 -25
- data/lib/unit/api_resources/customer_resource.rb +52 -50
- data/lib/unit/errors/unit_error.rb +11 -9
- data/lib/unit/models/application/create_business_application_request.rb +82 -0
- data/lib/unit/models/application/create_individual_application_request.rb +92 -0
- data/lib/unit/models/application/list_application_params.rb +42 -0
- data/lib/unit/models/application/patch_application_request.rb +33 -0
- data/lib/unit/models/application/upload_document_request.rb +27 -0
- data/lib/unit/models/customer/add_authorized_users_request.rb +31 -0
- data/lib/unit/models/customer/archive_customer_request.rb +30 -0
- data/lib/unit/models/customer/list_customer_params.rb +42 -0
- data/lib/unit/models/customer/patch_business_customer_request.rb +48 -0
- data/lib/unit/models/customer/patch_individual_customer_request.rb +49 -0
- data/lib/unit/models/customer/remove_authorized_users_request.rb +31 -0
- data/lib/unit/models/unit_resource.rb +13 -11
- data/lib/unit/models/unit_response.rb +10 -8
- data/lib/unit/types/address.rb +29 -25
- data/lib/unit/types/authorized_user.rb +24 -20
- data/lib/unit/types/beneficial_owner.rb +46 -42
- data/lib/unit/types/business_contact.rb +20 -16
- data/lib/unit/types/device_fingerprint.rb +17 -13
- data/lib/unit/types/evaluation_params.rb +15 -11
- data/lib/unit/types/full_name.rb +17 -13
- data/lib/unit/types/officer.rb +46 -42
- data/lib/unit/types/phone.rb +17 -13
- data/lib/unit/types/power_of_attorney_agent.rb +42 -38
- data/lib/unit/types/relationship.rb +15 -11
- data/lib/unit/types/relationship_array.rb +21 -16
- data/lib/unit/version.rb +1 -1
- data/lib/unit_ruby_sdk.rb +48 -2
- metadata +27 -13
- data/lib/unit/models/applications/create_business_application_request.rb +0 -78
- data/lib/unit/models/applications/create_individual_application_request.rb +0 -88
- data/lib/unit/models/applications/list_application_params.rb +0 -38
- data/lib/unit/models/applications/patch_application_request.rb +0 -29
- data/lib/unit/models/applications/upload_document_request.rb +0 -24
- data/lib/unit/models/customers/add_authorized_users_request.rb +0 -27
- data/lib/unit/models/customers/archive_customer_request.rb +0 -26
- data/lib/unit/models/customers/list_customer_params.rb +0 -38
- data/lib/unit/models/customers/patch_business_customer_request.rb +0 -44
- data/lib/unit/models/customers/patch_individual_customer_request.rb +0 -45
- data/lib/unit/models/customers/remove_authorized_users_request.rb +0 -27
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Creates request for uploading a document
|
4
|
+
# See: https://docs.unit.co/application-documents/#upload-document
|
5
|
+
module Unit
|
6
|
+
module Application
|
7
|
+
class UploadDocumentRequest
|
8
|
+
attr_reader :application_id, :document_id, :file, :file_type, :content_type, :is_back_side
|
9
|
+
|
10
|
+
# @param application_id [String] The application ID
|
11
|
+
# @param document_id [String] The document ID
|
12
|
+
# @param file [String] The file path
|
13
|
+
# @param file_type [String] The file type
|
14
|
+
# @option file_type [String] :pdf
|
15
|
+
# @option file_type [String] :jpg
|
16
|
+
# @option file_type [String] :png
|
17
|
+
# @param is_back_side [Boolean] The file is back side
|
18
|
+
def initialize(application_id, document_id, file, file_type, is_back_side: false)
|
19
|
+
@application_id = application_id
|
20
|
+
@document_id = document_id
|
21
|
+
@file = file
|
22
|
+
@file_type = file_type
|
23
|
+
@is_back_side = is_back_side
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Request to add authorized users to a project
|
4
|
+
# See: https://docs.unit.co/customers#add-authorized-users
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class AddAuthorizedUsersRequest
|
8
|
+
attr_reader :customer_id, :authorized_users
|
9
|
+
|
10
|
+
# @param customer_id [String] The id of customer
|
11
|
+
# @param authorized_users [Array<AuthorizedUser>] The authorized users
|
12
|
+
def initialize(customer_id, authorized_users)
|
13
|
+
@customer_id = customer_id
|
14
|
+
@authorized_users = authorized_users
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_json_api
|
18
|
+
payload = {
|
19
|
+
data: {
|
20
|
+
type: "addAuthorizedUsers",
|
21
|
+
attributes: {
|
22
|
+
authorizedUsers: authorized_users.map(&:represent)
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
payload[:data][:attributes].compact!
|
27
|
+
payload.to_json
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Request to archive customer
|
4
|
+
# See: https://docs.unit.co/customers#archive-customer
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class ArchiveCustomerRequest
|
8
|
+
attr_reader :customer_id, :reason
|
9
|
+
|
10
|
+
# @param customer_id [String] The id of customer
|
11
|
+
# @param optional reason [String] The reason for archiving the customer
|
12
|
+
# @option reason [String] Need to be one of the following: Inactive, FraudACHActivity, FraudCardActivity, FraudCheckActivity, FraudApplicationHistory, FraudAccountActivity, FraudClientIdentified, FraudLinkedToFraudulentCustomer.
|
13
|
+
def initialize(customer_id, reason = nil)
|
14
|
+
@customer_id = customer_id
|
15
|
+
@reason = reason
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_json_api
|
19
|
+
payload = {
|
20
|
+
data: {
|
21
|
+
type: "archiveCustomer",
|
22
|
+
attributes: { reason: reason }
|
23
|
+
}
|
24
|
+
}
|
25
|
+
payload[:data][:attributes].compact!
|
26
|
+
payload.to_json
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# params for listing customers
|
4
|
+
# See: https://docs.unit.co/customers#list-customers
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class ListCustomerParams
|
8
|
+
attr_reader :limit, :offset, :query, :email, :tags, :status, :sort
|
9
|
+
|
10
|
+
# @param optional limit [Integer] Maximum number of resources that will be returned. Maximum is 1000 resources.
|
11
|
+
# @param optional offset [Integer] Number of resources to skip. See pagination: https://docs.unit.co/#intro-pagination
|
12
|
+
# @param optional query [String] Search term according to the: https://docs.unit.co/#full-text-search
|
13
|
+
# @param optional email [String] Filter customers by email address (case sensitive).
|
14
|
+
# @param optional tags [Hash] Filter customers by tags. More information regarding tags: https://docs.unit.co/#tags
|
15
|
+
# @param optional status [String] Filter customers by status. One of: Active, Archived
|
16
|
+
# @param optional sort [String] Sorts the resources by the specified field.
|
17
|
+
# @option sort=createdAt for ascending order
|
18
|
+
# @option sort=-createdAt (leading minus sign) for descending order.
|
19
|
+
def initialize(limit = 100, offset = 0, query = nil, email = nil, tags = nil, status = nil,
|
20
|
+
sort = nil)
|
21
|
+
@limit = limit
|
22
|
+
@offset = offset
|
23
|
+
@query = query
|
24
|
+
@email = email
|
25
|
+
@tags = tags
|
26
|
+
@status = status
|
27
|
+
@sort = sort
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_hash
|
31
|
+
params = { "page[limit]": limit,
|
32
|
+
"page[offset]": offset,
|
33
|
+
"filter[query]": query,
|
34
|
+
"filter[email]": email,
|
35
|
+
"filter[tags]": tags,
|
36
|
+
"filter[status]": status,
|
37
|
+
"sort": sort }
|
38
|
+
params.compact!
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Update business customer information request
|
4
|
+
# See: https://docs.unit.co/customers#update-business-customer
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class PatchBusinessCustomerRequest
|
8
|
+
attr_reader :customer_id, :address, :phone, :contact, :authorized_users, :dba, :tags
|
9
|
+
|
10
|
+
# @param customer_id [String] The id of business
|
11
|
+
# @param optional address [Address] The address of business
|
12
|
+
# @param optional phone [Phone] The phone of business
|
13
|
+
# @param optional contact [BusinessContact] The primary contact of the business
|
14
|
+
# @param optional authorized_users [Array<AuthorizedUser>] The authorized users of business
|
15
|
+
# @param optional dba [String] The dba of business. To modify or add needed to specify the new dba name.
|
16
|
+
# @param optional tags [Hash] Provides opportunity to add, update or delete tags from resources with the tags attribute on the corresponding Update operation
|
17
|
+
# more information regarding tags: https://docs.unit.co/#updating-tags
|
18
|
+
def initialize(customer_id, address = nil, phone = nil, contact = nil,
|
19
|
+
authorized_users = nil, dba = nil, tags = nil)
|
20
|
+
@customer_id = customer_id
|
21
|
+
@address = address
|
22
|
+
@phone = phone
|
23
|
+
@contact = contact
|
24
|
+
@authorized_users = authorized_users
|
25
|
+
@dba = dba
|
26
|
+
@tags = tags
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_json_api
|
30
|
+
payload = {
|
31
|
+
data: {
|
32
|
+
type: "businessCustomer",
|
33
|
+
attributes: {
|
34
|
+
address: address&.represent,
|
35
|
+
phone: phone&.represent,
|
36
|
+
contact: contact&.represent,
|
37
|
+
authorized_users: authorized_users&.map(&:represent),
|
38
|
+
dba: dba,
|
39
|
+
tags: tags
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
payload[:data][:attributes].compact!
|
44
|
+
payload.to_json
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Update individual customer information request
|
4
|
+
# See: https://docs.unit.co/customers#update-individual-customer
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class PatchIndividualCustomerRequest
|
8
|
+
attr_reader :customer_id, :address, :phone, :email, :dba, :authorized_users, :tags, :jwt_subject
|
9
|
+
|
10
|
+
# @param customer_id [String] The id of individual customer
|
11
|
+
# @param optional address [Address] The address of individual customer
|
12
|
+
# @param optional phone [Phone] The phone of individual customer
|
13
|
+
# @param optional email [String] The email of individual customer
|
14
|
+
# @param optional dba [String] The dba of individual customer. If the individual is a sole proprietor who is doing business under a different name.
|
15
|
+
# @param optional authorized_users [Array<AuthorizedUser>] The authorized users of individual customer
|
16
|
+
# @param optional tags [Hash] Provides opportunity to add, update or delete tags from resources with the tags attribute on the corresponding Update operation
|
17
|
+
# @param optional jwt_subject [String] The subject of the JWT
|
18
|
+
# More information regarding JWTSubject: https://docs.unit.co/customer-api-tokens/#customers-create-customer-bearer-token-jwt
|
19
|
+
def initialize(customer_id, address = nil, phone = nil, email = nil, dba = nil, authorized_users = nil, tags = nil, jwt_subject = nil)
|
20
|
+
@customer_id = customer_id
|
21
|
+
@address = address
|
22
|
+
@phone = phone
|
23
|
+
@email = email
|
24
|
+
@dba = dba
|
25
|
+
@authorized_users = authorized_users
|
26
|
+
@tags = tags
|
27
|
+
@jwt_subject = jwt_subject
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_json_api
|
31
|
+
payload = {
|
32
|
+
data: {
|
33
|
+
type: "individualCustomer",
|
34
|
+
attributes: {
|
35
|
+
address: address&.represent,
|
36
|
+
phone: phone&.represent,
|
37
|
+
email: email,
|
38
|
+
dba: dba,
|
39
|
+
authorized_users: authorized_users&.map(&:represent),
|
40
|
+
tags: tags
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
payload[:data][:attributes].compact!
|
45
|
+
payload.to_json
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Request to remove authorized users from customer
|
4
|
+
# See: https://docs.unit.co/customers#remove-authorized-users
|
5
|
+
module Unit
|
6
|
+
module Customer
|
7
|
+
class RemoveAuthorizedUsersRequest
|
8
|
+
attr_reader :customer_id, :authorized_users_emails
|
9
|
+
|
10
|
+
# @param customer_id [String] The id of customer
|
11
|
+
# @param authorized_users_emails [Array<String>] The list of authorized users emails to remove from the customer.
|
12
|
+
def initialize(customer_id, authorized_users_emails)
|
13
|
+
@customer_id = customer_id
|
14
|
+
@authorized_users_emails = authorized_users_emails
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_json_api
|
18
|
+
payload = {
|
19
|
+
data: {
|
20
|
+
type: "removeAuthorizedUsers",
|
21
|
+
attributes: {
|
22
|
+
authorizedUsersEmails: authorized_users_emails
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
payload[:data][:attributes].compact!
|
27
|
+
payload.to_json
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -2,17 +2,19 @@
|
|
2
2
|
|
3
3
|
# class that represents objects that can be created
|
4
4
|
# Unit's resources include applications, customers, cards, accounts, transactions
|
5
|
-
|
6
|
-
|
5
|
+
module Unit
|
6
|
+
class UnitResource
|
7
|
+
attr_reader :id, :type, :attributes, :relationships
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
# @param id [String] The resource's ID
|
10
|
+
# @param type [String] The type of the resource
|
11
|
+
# @param attributes [Hash] The attributes
|
12
|
+
# @param relationships [Hash] The relationships
|
13
|
+
def initialize(id, type, attributes, relationships)
|
14
|
+
@id = id
|
15
|
+
@type = type
|
16
|
+
@attributes = attributes
|
17
|
+
@relationships = relationships
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
@@ -1,15 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Represents a response from Unit's API
|
4
|
-
|
5
|
-
|
4
|
+
module Unit
|
5
|
+
class UnitResponse
|
6
|
+
attr_reader :data, :included
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
# @param data [Hash] The JSON API payload
|
9
|
+
# @param included [Array] The JSON API payload
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
def initialize(data, included, meta)
|
12
|
+
@data = data
|
13
|
+
@included = included
|
14
|
+
@meta = meta
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/unit/types/address.rb
CHANGED
@@ -1,31 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class Address
|
6
|
+
attr_reader :street, :street2, :city, :state, :postal_code, :country
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
# @param street [String]
|
9
|
+
# @param city [String]
|
10
|
+
# @param state [String]
|
11
|
+
# @param postal_code [String]
|
12
|
+
# @param country [String]
|
13
|
+
# @param optional street2 [String]
|
14
|
+
def initialize(street, city, state, postal_code, country, street2 = nil)
|
15
|
+
@street = street
|
16
|
+
@street2 = street2
|
17
|
+
@city = city
|
18
|
+
@state = state
|
19
|
+
@postal_code = postal_code
|
20
|
+
@country = country
|
21
|
+
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
def represent
|
24
|
+
{
|
25
|
+
street: street,
|
26
|
+
street2: street2,
|
27
|
+
city: city,
|
28
|
+
state: state,
|
29
|
+
postalCode: postal_code,
|
30
|
+
country: country
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
@@ -2,27 +2,31 @@
|
|
2
2
|
|
3
3
|
# Type representing authorized user
|
4
4
|
# See: https://docs.unit.co/customers/#authorized-users
|
5
|
-
|
6
|
-
|
5
|
+
module Unit
|
6
|
+
module Types
|
7
|
+
class AuthorizedUser
|
8
|
+
attr_reader :full_name, :email, :phone, :jwt_subject
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
# @param full_name [FullName] The full name of the authorized user
|
11
|
+
# @param email [String] The email of the authorized user
|
12
|
+
# @param phone [Phone] The phone of the authorized user
|
13
|
+
# @param optional jwt_subject [String] The JWT subject of the authorized user. See https://docs.unit.co/customer-api-tokens/#customers-create-customer-bearer-token-jwt
|
14
|
+
def initialize(full_name, email, phone, jwt_subject = nil)
|
15
|
+
@full_name = full_name
|
16
|
+
@email = email
|
17
|
+
@phone = phone
|
18
|
+
@jwt_subject = jwt_subject
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
def represent
|
22
|
+
payload = {
|
23
|
+
fullName: full_name.represent,
|
24
|
+
email: email,
|
25
|
+
phone: phone.represent,
|
26
|
+
jwtSubject: jwt_subject
|
27
|
+
}
|
28
|
+
payload.compact
|
29
|
+
end
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
@@ -1,48 +1,52 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class BeneficialOwner
|
6
|
+
attr_reader :full_name, :date_of_birth, :address, :phone, :email,
|
7
|
+
:status, :ssn, :passport, :nationality, :percentage
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
9
|
+
# @param [FullName] full_name
|
10
|
+
# @param [Date] date_of_birth
|
11
|
+
# @param [Address] address
|
12
|
+
# @param [Phone] phone
|
13
|
+
# @param [String] email
|
14
|
+
# @param [String] ssn
|
15
|
+
# @param optional [String] status
|
16
|
+
# @param optional [String] passport
|
17
|
+
# @param optional [String] nationality
|
18
|
+
# @param optional [Integer] percentage
|
19
|
+
# @return [BeneficialOwner]
|
20
|
+
def initialize(full_name, date_of_birth, address, phone, email, ssn, status = nil, passport = nil,
|
21
|
+
nationality = nil, percentage = nil)
|
22
|
+
@full_name = full_name
|
23
|
+
@date_of_birth = date_of_birth
|
24
|
+
@address = address
|
25
|
+
@phone = phone
|
26
|
+
@email = email
|
27
|
+
@status = status
|
28
|
+
@ssn = ssn
|
29
|
+
@passport = passport
|
30
|
+
@nationality = nationality
|
31
|
+
@percentage = percentage
|
32
|
+
end
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
def represent
|
35
|
+
payload =
|
36
|
+
{
|
37
|
+
fullName: full_name.represent,
|
38
|
+
dateOfBirth: date_of_birth,
|
39
|
+
address: address.represent,
|
40
|
+
phone: phone.represent,
|
41
|
+
email: email,
|
42
|
+
ssn: ssn,
|
43
|
+
status: status,
|
44
|
+
passport: passport,
|
45
|
+
nationality: nationality,
|
46
|
+
percentage: percentage
|
47
|
+
}
|
48
|
+
payload.compact
|
49
|
+
end
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
@@ -3,23 +3,27 @@
|
|
3
3
|
require_relative "full_name"
|
4
4
|
require_relative "phone"
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
module Unit
|
7
|
+
module Types
|
8
|
+
class BusinessContact
|
9
|
+
attr_reader :full_name, :email, :phone
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
# @param [FullName] full_name
|
12
|
+
# @param [String] email
|
13
|
+
# @param [Phone] phone
|
14
|
+
def initialize(full_name, email, phone)
|
15
|
+
@full_name = full_name
|
16
|
+
@email = email
|
17
|
+
@phone = phone
|
18
|
+
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
def represent
|
21
|
+
{
|
22
|
+
fullName: full_name.represent,
|
23
|
+
email: email,
|
24
|
+
phone: phone.represent
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
@@ -1,19 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class DeviceFingerprint
|
6
|
+
attr_reader :value, :provider
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
# @param value [String] The value
|
9
|
+
# @param provider [String] The provider
|
10
|
+
def initialize(value, provider = "iovation")
|
11
|
+
@value = value
|
12
|
+
@provider = provider
|
13
|
+
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
def represent
|
16
|
+
{
|
17
|
+
value: value,
|
18
|
+
provider: provider
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
@@ -1,18 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Evaluation parameters for a particular entity.
|
4
|
-
|
5
|
-
|
4
|
+
module Unit
|
5
|
+
module Types
|
6
|
+
class EvaluationParams
|
7
|
+
attr_reader :use_selfie_verification, :required_verification
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def initialize(use_selfie_verification = nil, required_verification = nil)
|
10
|
+
@use_selfie_verification = use_selfie_verification
|
11
|
+
@required_verificaion = required_verification
|
12
|
+
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def represent
|
15
|
+
{
|
16
|
+
use_selfie_verification: use_selfie_verification,
|
17
|
+
required_verification: required_verification
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|