Dokumentacja klasy Elibri\Watermarking\WatermarkingClient
Metody publiczne | |
| __construct (string $token, string $secret, string $host=self::DEFAULT_HOST, ?HttpClient $httpClient=null) | |
| watermark (string $ident, $formats, string $visibleWatermark, ?string $clientSymbol=null) | |
| deliver (string $transId) | |
| availableFiles () | |
| soonAvailableFiles () | |
| soonUnavailableFiles () | |
Atrybuty publiczne | |
| const | DEFAULT_HOST = 'https://www.elibri.com.pl' |
Opis szczegółowy
Client for the elibri watermarking and transactional API.
Watermarking a book is a two step process. Call {
- Zobacz również
- watermark()} as early as you can - when the customer leaves the basket, for instance - so elibri can start marking the file while the payment is being made. Nothing is charged and no transaction is registered at that point. Once the payment is confirmed, call {
- deliver()}; elibri then registers the transaction and pings your callback URL with links to the finished files. A transaction that is never delivered is cancelled after seven days and nobody is billed.
- https://www.elibri.com.pl/doc/watermarking/
Dokumentacja konstruktora i destruktora
◆ __construct()
| Elibri\Watermarking\WatermarkingClient::__construct | ( | string | $token, |
| string | $secret, | ||
| string | $host = self::DEFAULT_HOST, |
||
| ?HttpClient | $httpClient = null |
||
| ) |
- Parametry
-
string $token public token of the elibri watermarking API string $secret private token of the elibri watermarking API string $host API host, override only to target a test server HttpClient | null $httpClient transport to use; defaults to cURL
Dokumentacja funkcji składowych
◆ availableFiles()
| Elibri\Watermarking\WatermarkingClient::availableFiles | ( | ) |
Books available to this account right now.
Includes titles whose files are all uploaded but whose release date is still ahead; those carry an available_date field.
- Zwraca
- array<int,array<string,mixed>>
- Wyjątki
-
Exception
◆ deliver()
| Elibri\Watermarking\WatermarkingClient::deliver | ( | string | $transId | ) |
Register the transaction and deliver the watermarked files.
Call this only once the payment is confirmed: the publisher invoices the shop for every delivered transaction. Must happen within 7 days of the matching {
- Zobacz również
- watermark()} call.
- Parametry
-
string $transId transaction identifier returned by {
- Zobacz również
- watermark()}
- Wyjątki
-
Exception
◆ soonAvailableFiles()
| Elibri\Watermarking\WatermarkingClient::soonAvailableFiles | ( | ) |
Books not available yet, but with a release date coming up.
- Zwraca
- array<int,array<string,mixed>>
- Wyjątki
-
Exception
◆ soonUnavailableFiles()
| Elibri\Watermarking\WatermarkingClient::soonUnavailableFiles | ( | ) |
Books that will stop being available shortly.
- Zwraca
- array<int,array<string,mixed>>
- Wyjątki
-
Exception
◆ watermark()
| Elibri\Watermarking\WatermarkingClient::watermark | ( | string | $ident, |
| $formats, | |||
| string | $visibleWatermark, | ||
| ?string | $clientSymbol = null |
||
| ) |
Order the watermarking of a book, without registering a transaction.
- Parametry
-
string $ident ISBN13 (digits only) or a record reference string | string[] $formats one or more of the {
- Zobacz również
- Format} constants, as an array or a comma separated string
- Parametry
-
string $visibleWatermark footer appended to the end of every chapter string | null $clientSymbol optional promotion identifier
- Zwraca
- string alphanumeric transaction identifier, to pass to {
- Zobacz również
- deliver()}
- Wyjątki
-
WrongFormatsException if a requested format cannot be watermarked NoServerRespondingException if elibri gives no usable answer Exception
1.9.1