Class: Synapsis::User

Inherits:
APIResource show all
Extended by:
APIOperations::Create
Defined in:
lib/synapsis_v3/user.rb

Defined Under Namespace

Modules: DocumentStatus

Class Method Summary collapse

Methods included from APIOperations::Create

create_request, create_url

Methods inherited from APIResource

#class_name, class_name, class_name_pluralized, parse_as_synapse_resource, request, return_response

Class Method Details

.add_document(payload, headers) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/synapsis_v3/user.rb', line 37

def self.add_document(payload, headers)
  verify_kyc_new_url = "#{API_V3_NEW_PATH}users/#{headers[:synapse_id]}"

  # Automatically convert all physical documents to base64 format
  physical_doc_array = payload[:documents][0][:physical_docs]
  physical_doc_array = convert_all_physical_documents_to_base64(physical_doc_array)

  response = request(:patch, verify_kyc_new_url, payload, headers)

  return_response(response)
end

.create(params) ⇒ Object



17
18
19
20
21
22
# File 'lib/synapsis_v3/user.rb', line 17

def self.create(params)
  payload = params.merge(client_credentials)

  response = create_request(payload)
  return_response(response)
end

.refresh(params) ⇒ Object



33
34
35
# File 'lib/synapsis_v3/user.rb', line 33

def self.refresh(params)
  return (params)
end

.search(params) ⇒ Object



73
74
75
76
77
78
79
# File 'lib/synapsis_v3/user.rb', line 73

def self.search(params)
  search_user_url = "#{API_V3_PATH}#{class_name}/search"

  response = request(:post, search_user_url, params.merge(client_credentials))

  return_response(response)
end

.show(payload, headers) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/synapsis_v3/user.rb', line 57

def self.show(payload, headers)
  show_user_url = "#{API_V3_NEW_PATH}#{class_name_pluralized}/#{headers[:synapse_id]}"

  response = request(:get, show_user_url, payload, headers)

  return_response(response)
end

.show_kyc(params) ⇒ Object



65
66
67
68
69
70
71
# File 'lib/synapsis_v3/user.rb', line 65

def self.show_kyc(params)
  show_kyc_url = "#{API_V3_PATH}#{class_name}/kyc/show"

  response = request(:post, show_kyc_url, params.merge(client_credentials))

  return_response(response)
end

.sign_in(params) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/synapsis_v3/user.rb', line 24

def self.(params)
   = "#{API_V3_PATH}#{class_name}/signin"

  payload = params.merge(client_credentials)

  response = request(:post, , payload)
  return_response(response)
end