Class: Bitex::KycProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/bitex/kyc_profile.rb

Overview

Documentation here!

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accepted_usage_tierSymbol

Returns Current usage tier as accepted by our compliance officers.

Returns:

  • (Symbol)

    Current usage tier as accepted by our compliance officers.



76
77
78
# File 'lib/bitex/kyc_profile.rb', line 76

def accepted_usage_tier
  @accepted_usage_tier
end

#birth_dateTime

Returns Birth date.

Returns:

  • (Time)

    Birth date.



36
37
38
# File 'lib/bitex/kyc_profile.rb', line 36

def birth_date
  @birth_date
end

#first_nameString

Returns Name.

Returns:

  • (String)

    Name.



12
13
14
# File 'lib/bitex/kyc_profile.rb', line 12

def first_name
  @first_name
end

#genderSymbol

Returns Gender.

Returns:

  • (Symbol)

    Gender.



44
45
46
# File 'lib/bitex/kyc_profile.rb', line 44

def gender
  @gender
end

#home_addressString

Returns Home address.

Returns:

  • (String)

    Home address.



52
53
54
# File 'lib/bitex/kyc_profile.rb', line 52

def home_address
  @home_address
end

#idInteger

Returns This KycProfile’s unique ID.

Returns:

  • (Integer)

    This KycProfile’s unique ID.



8
9
10
# File 'lib/bitex/kyc_profile.rb', line 8

def id
  @id
end

#last_nameString

Returns Last Name.

Returns:

  • (String)

    Last Name.



16
17
18
# File 'lib/bitex/kyc_profile.rb', line 16

def last_name
  @last_name
end

Returns Is legal entity.

Returns:

  • (Boolean)

    Is legal entity.



64
65
66
# File 'lib/bitex/kyc_profile.rb', line 64

def legal_entity
  @legal_entity
end

#nationalityString

Returns Nationality.

Returns:

  • (String)

    Nationality.



40
41
42
# File 'lib/bitex/kyc_profile.rb', line 40

def nationality
  @nationality
end

#occupationString

Returns:

  • (String)


48
49
50
# File 'lib/bitex/kyc_profile.rb', line 48

def occupation
  @occupation
end

#personal_id_issuerString

Returns ISO country code for the issuer of this ID.

Returns:

  • (String)

    ISO country code for the issuer of this ID.



24
25
26
# File 'lib/bitex/kyc_profile.rb', line 24

def personal_id_issuer
  @personal_id_issuer
end

#personal_id_numberString

Returns Personal ID Number.

Returns:

  • (String)

    Personal ID Number.



20
21
22
# File 'lib/bitex/kyc_profile.rb', line 20

def personal_id_number
  @personal_id_number
end

#personal_id_typesymbol

Returns Type of ID. [:passport].

Returns:

  • (symbol)

    Type of ID. [:passport]



28
29
30
# File 'lib/bitex/kyc_profile.rb', line 28

def personal_id_type
  @personal_id_type
end

#phone_numbersString

Returns Phone numbers.

Returns:

  • (String)

    Phone numbers.



60
61
62
# File 'lib/bitex/kyc_profile.rb', line 60

def phone_numbers
  @phone_numbers
end

#politically_exposed_personBoolean

Returns Is politically exposed.

Returns:

  • (Boolean)

    Is politically exposed.



68
69
70
# File 'lib/bitex/kyc_profile.rb', line 68

def politically_exposed_person
  @politically_exposed_person
end

#tax_idIntger

Returns Tax ID.

Returns:

  • (Intger)

    Tax ID.



32
33
34
# File 'lib/bitex/kyc_profile.rb', line 32

def tax_id
  @tax_id
end

#usage_tierSymbol

Returns Requested usage tier.

Returns:

  • (Symbol)

    Requested usage tier.



72
73
74
# File 'lib/bitex/kyc_profile.rb', line 72

def usage_tier
  @usage_tier
end

#work_addressString

Returns Work address.

Returns:

  • (String)

    Work address.



56
57
58
# File 'lib/bitex/kyc_profile.rb', line 56

def work_address
  @work_address
end

Class Method Details

.allObject



112
113
114
# File 'lib/bitex/kyc_profile.rb', line 112

def self.all
  Api.private(:get, '/private/kyc_profiles').map { |kyc| from_json(kyc) }
end

.create!(params) ⇒ Object

rubocop:enable Metrics/AbcSize



104
105
106
# File 'lib/bitex/kyc_profile.rb', line 104

def self.create!(params)
  from_json(Api.private(:post, '/private/kyc_profiles', sanitize(params)))
end

.find(id) ⇒ Object



108
109
110
# File 'lib/bitex/kyc_profile.rb', line 108

def self.find(id)
  from_json(Api.private(:get, "/private/kyc_profiles/#{id}"))
end

.sanitize(params) ⇒ Object



116
117
118
# File 'lib/bitex/kyc_profile.rb', line 116

def self.sanitize(params)
  params.merge(birth_date: params[:birth_date].strftime('%Y/%m/%d'))
end

Instance Method Details

#add_kyc_file!(path, content_type = nil) ⇒ Object



124
125
126
127
128
129
130
131
132
133
# File 'lib/bitex/kyc_profile.rb', line 124

def add_kyc_file!(path, content_type = nil)
  response = Api.private(
    :post,
    "/private/kyc_profiles/#{id}/kyc_files",
    { document_content_type: content_type },
    document: path
  )

  KycFile.from_json(response)
end

#kyc_filesObject



135
136
137
# File 'lib/bitex/kyc_profile.rb', line 135

def kyc_files
  Api.private(:get, "/private/kyc_profiles/#{id}/kyc_files").map { |kyc| KycFile.from_json(kyc) }
end

#update!(params) ⇒ Object



120
121
122
# File 'lib/bitex/kyc_profile.rb', line 120

def update!(params)
  self.class.from_json(Api.private(:put, "/private/kyc_profiles/#{id}", self.class.sanitize(params)))
end