Skip to content

Commit

Permalink
Merge pull request #11 from OpenSTFoundation/develop
Browse files Browse the repository at this point in the history
Implemented API's for kyc email send
  • Loading branch information
Tejas-Sangani authored Dec 21, 2018
2 parents f5b3885 + b994a8b commit ba48c48
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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<br />
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"}}
```
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1
36 changes: 36 additions & 0 deletions lib/ost-kyc-sdk-ruby/saas/users_kyc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 24 additions & 0 deletions lib/ost-kyc-sdk-ruby/test/user_kyc_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/ost-kyc-sdk-ruby/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OstKycSdkRuby

VERSION = "2.0.0"
VERSION = "2.0.1"

end

0 comments on commit ba48c48

Please sign in to comment.