1. Go to this page and download the library: Download esauti/esauti-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Esauti\Events\EventType;
EventType::CUSTOMER_CREATED // 'customer.created'
EventType::ORDER_PAID // 'order.paid'
EventType::SUBSCRIPTION_CREATED // 'subscription.created'
// ... 225 total
use Esauti\Events\DeadLetterSink;
use Esauti\Events\EventRegistry;
use Esauti\Events\EventsClient;
$sink = new DeadLetterSink(function (array $envelope, \Throwable $reason) {
// Send to your own queue, log, alert, etc.
myErrorTracker()->capture($reason, ['envelope' => $envelope]);
});
use Esauti\Http\HttpTransportInterface;
use Esauti\Http\Response;
class MyTransport implements HttpTransportInterface {
public function request(string $method, string $path, array $headers = [], array $query = [], ?array $body = null): Response {
// your implementation
}
}
$client = new EsautiClient('https://…', [], ['transport' => new MyTransport()]);
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.