Class: SilaRuby::Entities
- Inherits:
-
Object
- Object
- SilaRuby::Entities
- Includes:
- ApiHelpers
- Defined in:
- lib/sila-ruby/entities.rb
Overview
ENTITIES =====================================
Class Method Summary collapse
-
.add_registration(handle, params = {}, valid_path, user_key) ⇒ Object
——————————————– ADD-REGISTRATION ————————— ——————————————– Add a new email, phone number, street address, or identity to a registered entity.
-
.certify_beneficial_owner(handle, params = {}, user_key, business_handle, business_key) ⇒ Object
——————————————– CERTIFY-BENEFICIAL-OWNER ——————- ——————————————–.
-
.certify_business(handle, user_key, business_handle, business_key) ⇒ Object
——————————————– CERTIFY-BUSINESS ————————— ——————————————–.
-
.check_handle(handle) ⇒ Object
——————————————– CHECK-HANDLE ——————————- ——————————————– Check if a specific handle is taken.
-
.check_kyc(handle, user_key) ⇒ Object
——————————————– CHECK-KYC ———————————- ——————————————– Whether entity attached to user handle is verified, not valid, or pending.
-
.check_partner_kyc(params = {}) ⇒ Object
——————————————– CHECK-PARTNER-KYC ————————– ——————————————– Check KYC status of end-users across apps.
-
.delete_registration(handle, params = {}, valid_path, user_key) ⇒ Object
——————————————– DELETE-REGISTRATION ———————— ——————————————– Delete an existing email, phone number, street address, or identity.
-
.get_entities(params = {}) ⇒ Object
——————————————– GET-ENTITIES ——————————- ——————————————– Return all end-user and legal entities (businesses) associated with a customer application.
-
.get_entity(handle, user_key) ⇒ Object
——————————————– GET-ENTITY ——————————— ——————————————– Gets identifying information about a registered entity.
-
.link_business_member(handle, params = {}, user_key, business_handle, business_key) ⇒ Object
——————————————– LINK-BUSINESS-MEMBER ———————– ——————————————–.
-
.register(handle, params = {}) ⇒ Object
——————————————– REGISTER ———————————– ——————————————– Attaches KYC and blockchain address to user handle.
-
.request_kyc(handle, params = {}, user_key) ⇒ Object
——————————————– REQUEST-KYC ——————————– ——————————————– Start KYC verification process on a registered user handle.
-
.update_registration(handle, params = {}, valid_path, user_key) ⇒ Object
——————————————– UPDATE-REGISTRATION ———————— ——————————————– Update an existing email, phone number, street address, identity, or entity (name, birthdate, or business data).
Methods included from ApiHelpers
Class Method Details
.add_registration(handle, params = {}, valid_path, user_key) ⇒ Object
ADD-REGISTRATION —————————
Add a new email, phone number, street address, or identity to a registered entity.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/sila-ruby/entities.rb', line 109 def self.add_registration(handle, params={}, valid_path, user_key) header = { user_handle: handle } = 'header_msg' # Valid path options # # email # phone # identity # address # # # Example of params passed # # params = { # email: "[email protected]" # } sila_post_signed('add/' + valid_path, header, , params, user_key, nil) end |
.certify_beneficial_owner(handle, params = {}, user_key, business_handle, business_key) ⇒ Object
CERTIFY-BENEFICIAL-OWNER ——————-
236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/sila-ruby/entities.rb', line 236 def self.certify_beneficial_owner(handle, params={}, user_key, business_handle, business_key) header = { user_handle: handle, business_handle: business_handle } = 'header_msg' # Example of params passed # # params = { # member_handle: "your_beneficial_owner_member.silamoney.eth", # certification_token: "889288b15f686baa1f782ba6f51f3594fcfc72cb" # } sila_post_signed('certify_beneficial_owner', header, , params, user_key, business_key) end |
.certify_business(handle, user_key, business_handle, business_key) ⇒ Object
CERTIFY-BUSINESS —————————
254 255 256 257 258 259 |
# File 'lib/sila-ruby/entities.rb', line 254 def self.certify_business(handle, user_key, business_handle, business_key) header = { user_handle: handle, business_handle: business_handle } = 'header_msg' sila_post_signed('certify_business', header, , nil, user_key, business_key) end |
.check_handle(handle) ⇒ Object
CHECK-HANDLE ——————————-
Check if a specific handle is taken
20 21 22 23 24 |
# File 'lib/sila-ruby/entities.rb', line 20 def self.check_handle(handle) header = { user_handle: handle } = 'header_msg' sila_post_signed('check_handle', header, , nil, nil, nil) end |
.check_kyc(handle, user_key) ⇒ Object
CHECK-KYC ———————————-
Whether entity attached to user handle is verified, not valid, or pending
226 227 228 229 230 |
# File 'lib/sila-ruby/entities.rb', line 226 def self.check_kyc(handle, user_key) header = { user_handle: handle } = 'header_msg' sila_post_signed('check_kyc', header, , nil, user_key, nil) end |
.check_partner_kyc(params = {}) ⇒ Object
CHECK-PARTNER-KYC ————————–
Check KYC status of end-users across apps
311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/sila-ruby/entities.rb', line 311 def self.check_partner_kyc(params={}) = 'header_msg' # Example of params passed for partner # # params = { # query_app_handle: "PARTNER_COMPANY_APP", # query_user_handle: "PARTNER_USER_HANDLE" # } sila_post_signed('check_partner_kyc', {}, , params, nil, nil) end |
.delete_registration(handle, params = {}, valid_path, user_key) ⇒ Object
DELETE-REGISTRATION ————————
Delete an existing email, phone number, street address, or identity.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/sila-ruby/entities.rb', line 161 def self.delete_registration(handle, params={}, valid_path, user_key) header = { user_handle: handle } = 'header_msg' # Valid path options # # email # phone # identity # address # # # Example of params passed # # params = { # uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a" # } sila_post_signed('delete/' + valid_path, header, , params, user_key, nil) end |
.get_entities(params = {}) ⇒ Object
GET-ENTITIES ——————————-
Return all end-user and legal entities (businesses) associated with a customer application. This endpoint allows the listing of all entities registered to an application.
266 267 268 269 270 271 272 273 274 |
# File 'lib/sila-ruby/entities.rb', line 266 def self.get_entities(params={}) = 'header_msg' # params = { # entity_type: "individual" # } sila_post_signed('get_entities', {}, , params, nil, nil) end |
.get_entity(handle, user_key) ⇒ Object
GET-ENTITY ———————————
Gets identifying information about a registered entity.
280 281 282 283 284 285 |
# File 'lib/sila-ruby/entities.rb', line 280 def self.get_entity(handle, user_key) header = { user_handle: handle } = 'header_msg' sila_post_signed('get_entity', header, , nil, user_key, nil) end |
.link_business_member(handle, params = {}, user_key, business_handle, business_key) ⇒ Object
LINK-BUSINESS-MEMBER ———————–
186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/sila-ruby/entities.rb', line 186 def self.link_business_member(handle, params={}, user_key, business_handle, business_key) header = { user_handle: handle, business_handle: business_handle } = 'header_msg' # Example of params passed # # params = { # role: "controlling_officer", # member_handle: "your_individual_user_handle" # } sila_post_signed('link_business_member', header, , params, user_key, business_key) end |
.register(handle, params = {}) ⇒ Object
REGISTER ———————————–
Attaches KYC and blockchain address to user handle
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/sila-ruby/entities.rb', line 30 def self.register(handle, params={}) header = { user_handle: handle } = 'entity_msg' # Example of params passed for USER # # params = { # address: { # address_alias: "home", # street_address_1: "123 Main Street", # city: "New City", # state: "OR", # country: "US", # postal_code: "97204-1234" # }, # identity: { # identity_alias: "SSN", # identity_value: "123452222" # }, # contact: { # phone: "503-123-4567", # contact_alias: "", # email: "[email protected]" # }, # crypto_entry: { # crypto_alias: "Address 1", # crypto_address: "0x1234567890abcdef1234567890abcdef12345678", # crypto_code: "ETH" # }, # entity: { # birthdate: "1900-01-31", # entity_name: "Example User", # first_name: "Example", # last_name: "User", # relationship: "user" # } # } # # # Example of params passed for BUSINESS # # params = { # identity: { # identity_alias: "EIN", # identity_value: "12-1234567" # }, # address: { # address_alias: "Office", # street_address_1: "123 Candelabra Blvd.", # city: "Portland", # state: "OR", # country: "US", # postal_code: "97204" # }, # contact: { # phone: "1231231234", # email: "[email protected]" # }, # entity: { # type: "business", # entity_name: "Your Business Customer, Inc.", # business_type: "corporation", # business_website: "https://www.yourbusinesscustomer.com", # doing_business_as: "Your Business Customer Alias Co.", # naics_code: 721 # }, # crypto_entry: { # crypto_code: "ETH", # crypto_address: "0x67CB...E1FB" # } # } sila_post_signed('register', header, , params, nil, nil) end |
.request_kyc(handle, params = {}, user_key) ⇒ Object
REQUEST-KYC ——————————–
Start KYC verification process on a registered user handle
209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/sila-ruby/entities.rb', line 209 def self.request_kyc(handle, params={}, user_key) header = { user_handle: handle } = 'header_msg' # Optional params for requesting KYC # # params = { # kyc_level: "NONE" # } sila_post_signed('request_kyc', header, , params, user_key, nil) end |
.update_registration(handle, params = {}, valid_path, user_key) ⇒ Object
UPDATE-REGISTRATION ————————
Update an existing email, phone number, street address, identity, or entity (name, birthdate, or business data).
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/sila-ruby/entities.rb', line 134 def self.update_registration(handle, params={}, valid_path, user_key) header = { user_handle: handle } = 'header_msg' # Valid path options # # email # phone # identity # address # entity # # # Example of params passed # # params = { # uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a", # email: "[email protected]" # } sila_post_signed('update/' + valid_path, header, , params, user_key, nil) end |