isign/isign-sdk-php

此包已被废弃且不再维护。作者建议使用dokobit/ws-api-sdk-php包代替。

Dokobit.com 电子签名 WS API 客户端

2.1.0 2023-09-06 09:48 UTC

This package is auto-updated.

Last update: 2024-07-15 14:41:42 UTC


README

Code Coverage Build Status

如何开始?

检查 tests/Integration 目录下的集成测试,以了解库的使用案例。

请求日志记录

自定义 PSR-3 日志记录器

use GuzzleHttp\Middleware;
use GuzzleHttp\MessageFormatter;
use Monolog\Logger;

$log = Middleware::log(new Logger('requests'), new MessageFormatter(MessageFormatter::DEBUG));

$client = Dokobit\Client::create([
    'apiKey' => 'xxxxxx',
    'sandbox' => true,
], $log);

了解更多

http://www.php-fig.org/psr/psr-3/

https://github.com/Seldaek/monolog

调试

要深入了解发生的错误,请使用以下方法。A

echo (string) $exception->getMessage()
echo (string) $exception->getPrevious()->getResponse()
var_dump( $exception->getResponseData() )

适用于所有异常类,除了 UnexpectedErrorQueryValidator

开发

包括集成测试的完整测试套件

phpunit

不要忘记在 phpunit.xml 中定义 SANDBOX_API_KEY

仅运行单元测试

phpunit --testsuite=Unit

仅运行集成测试

phpunit --testsuite=Integration

运行单个测试用例

phpunit tests/Integration/MobileSignTest.php