守卫工人类 / 客户端
守卫工人类服务的客户端
1.0.0
2017-02-10 16:11 UTC
Requires
- php: ^5.3|^7.0
This package is not auto-updated.
Last update: 2024-09-23 12:50:57 UTC
README
守卫工人类客户端库
安装
您可以通过composer安装客户端库。
composer require sentryworker/client
或者如果您需要手动加载,可以使用旧式加载器,只需require一个src/SentryWorker/autoload.php即可
require_once 'src/SentryWorker/autoload.php';
工作示例
当订单表单完成时,您需要在守卫工人类服务中关闭订单。这里有一个简单的示例可以正常工作。
require_once 'vendor/autoload.php'; use SentryWorker\Client; use SentryWorker\Exception\ClientException; $client = new Client(array( 'app_key' => 'APP_KEY', 'app_secret' => 'APP_SECRET', 'curl_opts' => array( 'connection_timeout' => 1, 'read_timeout' => 1, ) )); try { $trxId = $client->sendToReview('orderId'); echo $trxId; } catch (ClientException $e) { echo $e->getCode(); echo $e->getMessage(); }
不要忘记在您的订单表单中包含tracker js文件以完成集成。