diff --git a/CHANGELOG.md b/CHANGELOG.md index d40b44a..4c3cb7a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -[OST KYC Ruby SDK v2.0](https://github.com/OpenSTFoundation/ost-kyc-sdk-ruby) December 4 2018 +[OST KYC RUBY SDK v2.0.1](https://github.com/OpenSTFoundation/ost-kyc-sdk-ruby/tree/v2.0.1) December 17 2018 +--- + +* Implemented API's for kyc email send + +[OST KYC Ruby SDK v2.0.0](https://github.com/OpenSTFoundation/ost-kyc-sdk-ruby/tree/v2.0.0) December 4 2018 --- Initial release of the official OST KYC Ruby SDK
diff --git a/README.md b/README.md index 80ea607..a2b517a 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,27 @@ params = {user_id: 11007, first_name:'YOGESH', last_name:'SAWANT', birthdate:' ost_kyc_users_kyc_object.submit_kyc(params).to_json ``` +Send Approve Email to User: + +```ruby +params = {user_id: 11550} +ost_kyc_users_kyc_object.email_approve(params).to_json +``` + +Send Deny Email to User: + +```ruby +params = {user_id: 11550} +ost_kyc_users_kyc_object.email_deny(params).to_json +``` + +Send Report Issue Email to User: + +```ruby +params = {user_id: 11550} +ost_kyc_users_kyc_object.email_report_issue(params).to_json +``` + Get a list of existing users kyc and other data: ```ruby @@ -137,4 +158,4 @@ And then call a method: ```ruby ost_kyc_user_object.list().to_json {:success=>true, :data=>{:request_uri=>"http://kyc.ost.com:8080/api/v2/users", :request_type=>"GET", :request_params=>"request_timestamp=1542027534&signature=7d61d9494040858ff656a8e9361a3b5990ae969a30d123386069e58290f8e465&api_key=28ad8ebb00c8469e1e32156849e94b3f&page_number=1&order=asc&page_size=3"}} - ``` \ No newline at end of file + ``` diff --git a/VERSION b/VERSION index 359a5b9..10bf840 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.0.1 \ No newline at end of file diff --git a/lib/ost-kyc-sdk-ruby/saas/users_kyc.rb b/lib/ost-kyc-sdk-ruby/saas/users_kyc.rb index 8f04a61..725ed12 100644 --- a/lib/ost-kyc-sdk-ruby/saas/users_kyc.rb +++ b/lib/ost-kyc-sdk-ruby/saas/users_kyc.rb @@ -38,6 +38,42 @@ def submit_kyc(params) http_helper.send_post_request("#{@url_prefix}/#{get_user_id!(params)}", params) end + # Send Approve Email to User + # + # Arguments: + # params: (Hash) + # + # Returns: + # response: (OstKycSdkRuby::Util::Result) + # + def email_approve(params) + http_helper.send_post_request("#{@url_prefix}/#{get_user_id!(params)}/email/approve", params) + end + + # Send Deny Email to User + # + # Arguments: + # params: (Hash) + # + # Returns: + # response: (OstKycSdkRuby::Util::Result) + # + def email_deny(params) + http_helper.send_post_request("#{@url_prefix}/#{get_user_id!(params)}/email/deny", params) + end + + # Send Report Issue Email to User + # + # Arguments: + # params: (Hash) + # + # Returns: + # response: (OstKycSdkRuby::Util::Result) + # + def email_report_issue(params) + http_helper.send_post_request("#{@url_prefix}/#{get_user_id!(params)}/email/report-issue", params) + end + # Get an existing User Kyc # # Arguments: diff --git a/lib/ost-kyc-sdk-ruby/test/user_kyc_test.rb b/lib/ost-kyc-sdk-ruby/test/user_kyc_test.rb index 3e6a1b4..2a904fb 100644 --- a/lib/ost-kyc-sdk-ruby/test/user_kyc_test.rb +++ b/lib/ost-kyc-sdk-ruby/test/user_kyc_test.rb @@ -20,6 +20,24 @@ def test_submit_kyc assert_equal(result.success?, false ) end + def test_email_approve + params = {user_id: ENV['USER_ID']} + result = user_kyc_obj.email_approve(params) + is_unprocessable_entity(result) + end + + def test_email_deny + params = {user_id: ENV['USER_ID']} + result = user_kyc_obj.email_deny(params) + is_unprocessable_entity(result) + end + + def test_email_report_issue + params = {user_id: ENV['USER_ID']} + result = user_kyc_obj.email_report_issue(params) + is_unprocessable_entity(result) + end + def test_user_kyc_list result = user_kyc_obj.list() assert_equal(result.success?, true ) @@ -37,5 +55,11 @@ def test_presigned_url_for_post assert_equal(result.success?, true ) end + def is_unprocessable_entity(result) + if !result.success? + assert_equal(result.error, "UNPROCESSABLE_ENTITY") + end + end + end \ No newline at end of file diff --git a/lib/ost-kyc-sdk-ruby/version.rb b/lib/ost-kyc-sdk-ruby/version.rb index 5eff1bc..e882bcf 100755 --- a/lib/ost-kyc-sdk-ruby/version.rb +++ b/lib/ost-kyc-sdk-ruby/version.rb @@ -1,5 +1,5 @@ module OstKycSdkRuby - VERSION = "2.0.0" + VERSION = "2.0.1" end