README.md in onfido-0.15.1 vs README.md in onfido-1.0.0

- old
+ new

@@ -1,32 +1,34 @@ # Onfido A thin wrapper for Onfido's API. [![Gem Version](https://badge.fury.io/rb/onfido.svg)](http://badge.fury.io/rb/onfido) -[![Build Status](https://travis-ci.org/hvssle/onfido.svg?branch=master)](https://travis-ci.org/hvssle/onfido) +[![Build Status](https://travis-ci.org/onfido/onfido-ruby.svg?branch=master)](https://travis-ci.org/onfido/onfido-ruby) -This gem supports both `v1` and `v2` of the Onfido API. Refer to Onfido's [API documentation](https://onfido.com/documentation#introduction) for details of the expected requests and responses for both. +This gem supports only `v3` of Onfido's API from version `1.0.0` ownards. +The latest version that supports `v2` of Onfido's API is `0.15.0`. `v1` of Onfido's API is deprecated +Refer to Onfido's [API documentation](https://documentation.onfido.com) for details of the expected requests and responses. + ## Installation Add this line to your application's Gemfile: ```ruby -gem 'onfido', '~> 0.15.1' +gem 'onfido', '~> 1.0.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. ## Configuration -There are 6 configuration options: +There are 5 configuration options: ```ruby Onfido.configure do |config| config.api_key = 'MY_API_KEY' - config.api_version = 'v2' config.logger = Logger.new(STDOUT) config.open_timeout = 30 config.read_timeout = 80 config.region = nil end @@ -57,11 +59,11 @@ ### Resources All resources share the same interface when making API calls. Use `.create` to create a resource, `.find` to find one, and `.all` to fetch all resources. -**Note:** *All param keys should be a symbol e.g. `{ type: 'express', reports: [{ name: 'identity' }] }`* +**Note:** *All param keys should be a symbol e.g. `{ report_names: ['document'] }`* #### Applicants Applicants are the object upon which Onfido checks are performed. @@ -81,12 +83,12 @@ Documents provide supporting evidence for Onfido checks. ```ruby api.document.create('applicant_id', file: 'http://example.com', type: 'passport') # => Creates a document -api.document.find('applicant_id', 'document_id') # => Finds a document -api.document.download('applicant_id', 'document_id') # => Downloads a document as a binary data +api.document.find('document_id') # => Finds a document +api.document.download('document_id') # => Downloads a document as a binary data api.document.all('applicant_id') # => Returns all applicant's documents ``` **Note:** The file parameter must be a `File`-like object which responds to `#read` and `#path`. Previous versions of this gem supported providing a URL to a file accessible over HTTP or a path @@ -97,12 +99,12 @@ Live Photos, like documents, can provide supporting evidence for Onfido checks. ```ruby api.live_photo.create('applicant_id', file: 'http://example.com') -api.live_photo.find(applicant_id, live_photo_id) # => Finds a live photo -api.live_photo.download(applicant_id, live_photo_id) # => Downloads a live photo as binary data +api.live_photo.find(live_photo_id) # => Finds a live photo +api.live_photo.download(live_photo_id) # => Downloads a live photo as binary data api.live_photo.all(applicant_id) # => Returns all applicant's live photos ``` **Note:** The file parameter must be a `File`-like object which responds to `#read` and `#path`. Previous versions of this gem supported providing a URL to a file accessible over HTTP or a path @@ -113,13 +115,12 @@ Checks are requests for Onfido to check an applicant, by commissioning one or 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.create('applicant_id', report_names: ['document']) +api.check.find('check_id') api.check.resume('check_id') api.check.all('applicant_id') ``` #### Reports @@ -128,26 +129,16 @@ created when a check is created, so the Onfido API only provides support for finding and listing them. For paused reports specifically, additional support for resuming and cancelling reports is also available. ```ruby -api.report.find('check_id', 'report_id') +api.report.find('report_id') api.report.all('check_id') -api.report.resume('check_id', 'report_id') -api.report.cancel('check_id', 'report_id') +api.report.resume('report_id') +api.report.cancel('report_id') ``` -#### Report Type Groups - -Report type groups provide a convenient way to group and organize different types of reports. - The Onfido API only provides support for finding and listing them. - -```ruby -api.report_type_group.find('report_type_group_id') -api.report_type_group.all() -``` - #### Address Lookups Onfido provides an address lookup service, to help ensure well-formatted addresses are provided when creating "applicants". To search for addresses by postcode, use: @@ -174,15 +165,10 @@ ```ruby api.sdk_token.create(applicant_id: 'applicant_id', referrer: 'referrer') ``` -### Pagination - -All resources that support an `all` method also support pagination. By default, -the first 20 records are fetched. - ### Error Handling There are three classes of errors raised by the library, all of which subclass `Onfido::OnfidoError`: - `Onfido::ServerError` is raised whenever Onfido returns a `5xx` response - `Onfido::RequestError` is raised whenever Onfido returns any other kind of error @@ -222,10 +208,10 @@ - Add custom errors based on the response code - Improve pagination handling (use information passed in link header) ## Contributing -1. Fork it ( https://github.com/hvssle/onfido/fork ) +1. Fork it ( https://github.com/onfido/onfido/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request