sentryworker / client
Client for SentryWorker service
1.0.0
2017-02-10 16:11 UTC
Requires
- php: ^5.3|^7.0
This package is not auto-updated.
Last update: 2025-02-10 14:33:03 UTC
README
SentryWorker Client Library
Installation
You can install client library by composer.
composer require sentryworker/client
Or if you have to autoload it manually you can use old style autoloader, just require one src/SentryWorker/autoload.php
require_once 'src/SentryWorker/autoload.php';
Working example
When order form is completed you need to close order in sentryworker service. There is a simple example that do work.
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(); }
Don't forget to include tracker js file on your order form to complete integration.