Download the PHP package partfire/onfido without Composer

On this page you can find all versions of the php package partfire/onfido. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package onfido

PartFire onfido

This is a PHP API client for Onfido's REST API.

We have kept this library as close to the original as possible and so can be used as the documentation states.

In order to run the tests, you must update the AbstractTest file with your api token. The tests are poor as they depend upon data on your Onfido account (e.g. customer ids).

These are the original unit tests that Onfido provided.

Installation

You can obtain onfido-php from source

$ git clone https://github.com/onfido/php-onfido.git

or you can install via composer:

$ composer require partfire/onfido

Usage

At the beginning, You need is to import the autoload.php file, Initiate the Config, and Set the Token:

require_once('autoload.php');

\Onfido\Config::init()->set_token('YOUR TOKEN');

Applicants

The applicant endpoint supports two operations - create() and get():

Create applicant

$applicant = new \Onfido\Applicant();
$applicant->first_name = 'John';
$applicant->last_name = 'Smith';
$applicant->email = '[email protected]';

$address1 = new \Onfido\Address();
$address1->postcode = 'abc';
$address1->town = 'London';
$address1->country = 'GBR';

$applicant->addresses = Array($address1);

$response = $applicant->create();

Retrieve applicant

APPLICANT_ID to be the ID of the Applicants You want to retrieve.

$applicant = (new \Onfido\Applicant())->get(APPLICANT_ID);

List applicants

->paginate(2, 5) means to get page #2 where each page has 5 Applicants, Any of both can be null to ignore

\Onfido\Config::init()->set_token('YOUR TOKEN')->paginate(2, 5);

$applicants = (new \Onfido\Applicant())->get();

Documents

The documents endpoint supports one operation - upload_for():

Upload document

$document = new \Onfido\Document();

$document->file_name = 'file.jpg';
$document->file_path = '/path/to/file.jpg';
$document->file_type = 'image/jpg';
$document->type = 'passport';
$document->side = 'front';

$response = $document->upload_for(APPLICANT_ID);

Checks

The checks endpoint supports two operations - create_for() and get():

Create check

$check = new \Onfido\Check();
$check->type = 'standard';

$report1 = new \Onfido\CheckReport();
$report1->name = 'identity';

$check->reports = Array(
    $report1
);
$response = $check->create_for(APPLICANT_ID);

Retrieve check

$check = (new \Onfido\Check())->get(APPLICANT_ID, CHECK_ID);

List checks

\Onfido\Config::init()->set_token('YOUR TOKEN')->paginate(null, 5);

$checks = (new \Onfido\Check())->get(APPLICANT_ID);

Reports

The reports endpoint supports one operation - get():

Retrieve report

$report = (new \Onfido\Report())->get(CHECK_ID, REPORT_ID);

List reports

$report = (new \Onfido\Report())->get(CHECK_ID);

Address Picker

You can get use of the Onfido Address Picker, like:

$address = new \Onfido\AddressPicker();
$address->postcode = 'SW4 6EH';
$addresses = $address->pick();

Running tests

You will need to have latest version of phpunit installed. Then:

phpunit Applicants.php

will run the tests related to Applicant endpoint operations, and shows the results in a readable way. You can run other tests like: Checks, Documents and Reports.


All versions of onfido with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package partfire/onfido contains the following files

Loading the files please wait ....