Add this line to your application's Gemfile:
gem 'alloy-kyc'
And then execute:
$ bundle
Or install it yourself as:
$ gem install alloy-kyc
Configure the gem using your issued Alloy credentials in an initializer file. For example, in config/initializers/alloy-kyc.rb:
Alloy::KYC.configure do |config|
config.application_token = ENV['ALLOY_APPLICATION_TOKEN']
config.application_secret = ENV['ALLOY_APPLICATION_SECRET']
end
Create a new evaluation:
Alloy::KYC::Evaluation.create({
phone_number: "18042562188",
name_first: "Thomas",
name_last: "Nicholas",
email_address: "[email protected]",
birth_date: "1985-01-23",
address_line_1: "1717 E Test St",
address_city: "Richmond",
address_state: "VA",
document_ssn: "123456789",
address_postal_code: "23220",
address_country_code: "US",
social_twitter: "tommyrva"
})
If evaluation requires further information around out-of-wallet questions:
evaluation = Alloy::KYC::Evaluation.create({phone_number: "18042562188", name_first: "Thomas",...})
if evaluation.requires_oow?
# collect answers and either match locally or resubmit
updated_evaluation = evaluation.submit_oow_responses(responses)
end
Bug reports and pull requests are welcome on GitHub at https://github.com/qedinvestors/alloy-kyc.
The gem is available as open source under the terms of the MIT License.