velser/ondato-api-php-client

PHP版本的Ondato API客户端

0.2.1 2023-10-04 09:41 UTC

This package is auto-updated.

Last update: 2024-09-04 11:44:59 UTC


README

PHP版本的Ondato API客户端。用于与Ondato流程集成KYC和Verifid。

要求

  • php7.1+

安装

composer require velser/ondato-api-php-client

用法

Kyc

$guzzleClient = new GuzzleHttp\Client([
    'timeout' => 10,
    'allow_redirects' => false,
    'base_uri' => 'https://ondatourl',
    'headers' => [
        'Accept' => 'application/json'
    ]
]);

$kycApiClient = new Velser\OndatoApiClient\KycApiClient($guzzleClient, 'apikey');

Verifid

$guzzleClient = new GuzzleHttp\Client([
    'timeout' => 10,
    'allow_redirects' => false,
    'base_uri' => 'https://ondatourl',
    'headers' => [
        'Accept' => 'application/json'
    ]
]);

$kycApiClient = new Velser\OndatoApiClient\VerifidApiClient(
    $guzzleClient,
    'username',
    'password'
);

注意

  • Accept头是强制性的,因为如果不这样做,当发送多部分请求时服务器将返回多部分响应;
  • base_uri是Ondato API的根URI,不带特定路径;

待办事项

  • 添加工厂以通过DI快速构建客户端;
  • 测试;
  • 客户端异常重映射到特定异常;

贡献/维护

  • 由于需要维护,因此库可维护。任何贡献/修复/改进都受到欢迎;
  • 此库与Ondato本身无关。它只是一个集成。因此,在此存储库中只讨论与此存储库相关的内容;

许可证

MIT(可在LICENSE文件中找到)