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$tokenpublic token of the elibri watermarking API
string$secretprivate token of the elibri watermarking API
string$hostAPI host, override only to target a test server
HttpClient | null$httpClienttransport 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$transIdtransaction 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$identISBN13 (digits only) or a record reference
string | string[]$formatsone or more of the {
Zobacz również
Format} constants, as an array or a comma separated string
Parametry
string$visibleWatermarkfooter appended to the end of every chapter
string | null$clientSymboloptional promotion identifier
Zwraca
string alphanumeric transaction identifier, to pass to {
Zobacz również
deliver()}
Wyjątki
WrongFormatsExceptionif a requested format cannot be watermarked
NoServerRespondingExceptionif elibri gives no usable answer
Exception