Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #83 from hvssle/update_readme_changelog_and_version
Browse files Browse the repository at this point in the history
Update readme, changelog and version
  • Loading branch information
Alan Carrie committed Feb 5, 2019
2 parents 17e8ed6 + 2b28736 commit c275da9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.15.0, 4 Feb 2019

- Add Check#find_by_url method (@ctrlaltdylan)

## v0.14.0, 28 Jan 2019

- Add support for applicant deletion and restore endpoints
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This gem supports both `v1` and `v2` of the Onfido API. Refer to Onfido's [API d
Add this line to your application's Gemfile:

```ruby
gem 'onfido', '~> 0.14.0'
gem 'onfido', '~> 0.15.0'
```

The gem is compatible with Ruby 2.2.0 and onwards. Earlier versions of Ruby have [reached end-of-life](https://www.ruby-lang.org/en/news/2017/04/01/support-of-ruby-2-1-has-ended/), are no longer supported and no longer receive security fixes.
Expand Down Expand Up @@ -117,6 +117,7 @@ more "reports" on them.
```ruby
api.check.create('applicant_id', type: 'express', reports: [{ name: 'identity' }])
api.check.find('applicant_id', 'check_id')
api.check.find_by_url('applicants/a90e7a17-677a-49ab-a171-281f96c77bde/checks/c9f41bef-0610-4d2f-9982-ae9387876edc')
api.check.resume('check_id')
api.check.all('applicant_id')
```
Expand Down
4 changes: 2 additions & 2 deletions lib/onfido/resources/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def find(applicant_id, check_id, expand: nil)
end

def find_by_url(url, expand: nil)
url_path = url.sub(/^https\:\/\/api\.onfido\.com\/v2\//,'')
url_path = url.sub(%r/^https\:\/\/api\.onfido\.com\/v2\//, '')
querystring = "&expand=#{expand}" if expand
get(url: url_for("#{url_path}?#{querystring}"))
get(url: url_for("#{url_path}?#{querystring}"))
end

def all(applicant_id, page: 1, per_page: 20, expand: nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/onfido/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Onfido
VERSION = '0.14.0'.freeze
VERSION = '0.15.0'.freeze
end
6 changes: 4 additions & 2 deletions spec/integrations/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

context 'partial url' do
let(:url) { "applicants/#{applicant_id}/checks/#{check_id}" }

it 'returns an existing check for the applicant with the partial url' do
response = check.find_by_url(url)
expect(response['id']).to eq(check_id)
Expand All @@ -53,7 +53,9 @@
end

context 'full url' do
let(:url) { "https://api.onfido.com/v2/applicants/#{applicant_id}/checks/#{check_id}" }
let(:url) do
"https://api.onfido.com/v2/applicants/#{applicant_id}/checks/#{check_id}"
end

it 'returns an existing check for the applicant with the partial url' do
response = check.find_by_url(url)
Expand Down

0 comments on commit c275da9

Please sign in to comment.