bdelespierre/onfido-api-php-client
Composer 安装命令:
composer require bdelespierre/onfido-api-php-client
包简介
The Onfido API is used to submit check requests.
README 文档
README
The Onfido API is used to submit check requests.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 3.0.0
- Package version: 5.2.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
- PHP 7.1 and later
- Guzzle/psr7 1.7 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/onfido/api-php-client.git"
}
],
"require": {
"onfido/api-php-client": "^5.2.0"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
require_once('/path/to/onfido-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: Token $config = Onfido\Configuration::getDefaultConfiguration(); $config->setApiKey('Authorization', 'token=' . 'YOUR API KEY'); $config->setApiKeyPrefix('Authorization', 'Token'); // Limit the at-rest region, if needed (optional, see https://documentation.onfido.com/#regions) // $config->setHost($config->getHostFromSettings(1, array("region" => "us"))); $apiInstance = new Onfido\Api\DefaultApi(null, $config); // Setting applicant details $applicantDetails = new Onfido\Model\Applicant(); $applicantDetails->setFirstName('Jane'); $applicantDetails->setLastName('Doe'); $applicantDetails->setDob('1990-01-31'); $address = new \Onfido\Model\Address(); $address->setBuildingNumber('100'); $address->setStreet('Main Street'); $address->setTown('London'); $address->setPostcode('SW4 6EH'); $address->setCountry('GBR'); $applicantDetails->setAddress($address); // Setting check details $checkData = new Onfido\Model\Check(); $checkData->setReportNames(array('identity_standard')); // Create an applicant and then a check with an Identity report try { $applicantResult = $apiInstance->createApplicant($applicantDetails); $applicantId = $applicantResult->getId(); print_r("Applicant ID: ".$applicantId); $checkData->setApplicantId($applicantId); $checkResult = $apiInstance->createCheck($checkData); print_r($checkResult); } catch (Exception $e) { print_r($e->getResponseBody()); } ?>
Documentation for API Endpoints
All URIs are relative to https://api.onfido.com/v3
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | cancelReport | POST /reports/{report_id}/cancel | This endpoint is for cancelling individual paused reports. |
| DefaultApi | createApplicant | POST /applicants | Create Applicant |
| DefaultApi | createCheck | POST /checks | Create a check |
| DefaultApi | createWebhook | POST /webhooks | Create a webhook |
| DefaultApi | deleteWebhook | DELETE /webhooks/{webhook_id} | Delete a webhook |
| DefaultApi | destroyApplicant | DELETE /applicants/{applicant_id} | Delete Applicant |
| DefaultApi | downloadDocument | GET /documents/{document_id}/download | Download a documents raw data |
| DefaultApi | downloadLivePhoto | GET /live_photos/{live_photo_id}/download | Download live photo |
| DefaultApi | downloadLiveVideo | GET /live_videos/{live_video_id}/download | Download live video |
| DefaultApi | downloadLiveVideoFrame | GET /live_videos/{live_video_id}/frame | Download live video frame |
| DefaultApi | editWebhook | PUT /webhooks/{webhook_id} | Edit a webhook |
| DefaultApi | findAddresses | GET /addresses/pick | Search for addresses by postcode |
| DefaultApi | findApplicant | GET /applicants/{applicant_id} | Retrieve Applicant |
| DefaultApi | findCheck | GET /checks/{check_id} | Retrieve a Check |
| DefaultApi | findDocument | GET /documents/{document_id} | A single document can be retrieved by calling this endpoint with the document’s unique identifier. |
| DefaultApi | findLivePhoto | GET /live_photos/{live_photo_id} | Retrieve live photo |
| DefaultApi | findLiveVideo | GET /live_videos/{live_video_id} | Retrieve live video |
| DefaultApi | findReport | GET /reports/{report_id} | A single report can be retrieved using this endpoint with the corresponding unique identifier. |
| DefaultApi | findWebhook | GET /webhooks/{webhook_id} | Retrieve a Webhook |
| DefaultApi | generateSdkToken | POST /sdk_token | Generate a SDK token |
| DefaultApi | listApplicants | GET /applicants | List Applicants |
| DefaultApi | listChecks | GET /checks | Retrieve Checks |
| DefaultApi | listDocuments | GET /documents | List documents |
| DefaultApi | listLivePhotos | GET /live_photos | List live photos |
| DefaultApi | listLiveVideos | GET /live_videos | List live videos |
| DefaultApi | listReports | GET /reports | All the reports belonging to a particular check can be listed from this endpoint. |
| DefaultApi | listWebhooks | GET /webhooks | List webhooks |
| DefaultApi | restoreApplicant | POST /applicants/{applicant_id}/restore | Restore Applicant |
| DefaultApi | resumeCheck | POST /checks/{check_id}/resume | Resume a Check |
| DefaultApi | resumeReport | POST /reports/{report_id}/resume | This endpoint is for resuming individual paused reports. |
| DefaultApi | updateApplicant | PUT /applicants/{applicant_id} | Update Applicant |
| DefaultApi | uploadDocument | POST /documents | Upload a document |
| DefaultApi | uploadLivePhoto | POST /live_photos | Upload live photo |
Documentation For Models
- Address
- AddressesList
- Applicant
- ApplicantsList
- Check
- ChecksList
- Document
- DocumentsList
- Error
- ErrorProperties
- IdNumber
- LivePhoto
- LivePhotosList
- LiveVideo
- LiveVideosList
- Report
- ReportDocument
- ReportsList
- SdkToken
- Webhook
- WebhooksList
Documentation For Authorization
Token
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Author
bdelespierre/onfido-api-php-client 适用场景与选型建议
bdelespierre/onfido-api-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 105 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 12 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「rest」 「api」 「sdk」 「openapi」 「openapitools」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bdelespierre/onfido-api-php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bdelespierre/onfido-api-php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bdelespierre/onfido-api-php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
Alfabank REST API integration
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
BlockCypher's PHP SDK for REST API
Helper classes for creating cookie headers
统计信息
- 总下载量: 105
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: unlicense
- 更新时间: 2021-12-01