Installation
Install and configure the PHP SDK using Composer.
This guide covers installing and configuring the Paysera Checkout PHP SDK.
Requirements​
- PHP: 7.4 or higher
- Extensions: cURL, JSON
- Composer: For dependency management
Installation via Composer​
composer require paysera/lib-checkout-integration-sdk
Configuration Options​
Builder Options​
use Paysera\CheckoutSdk\SdkFacadeBuilder;
$builder = new SdkFacadeBuilder();
// Set custom logger (PSR-3 compatible)
$builder->setLogger($myLogger);
// Set token repository for persistence
$builder->setPaymentApiAuthTokenRepository($myTokenRepository);
// Set credentials repository for persistence
$builder->setPaymentApiCredentialsRepository($myCredentialsRepository);
// Build the SDK
$sdk = $builder->build();
Token and Credentials Persistence​
By default, tokens and credentials are stored in memory and lost when the script ends. For persistent storage, you can implement custom repositories and pass them to the builder:
PaymentApiAuthTokenRepositoryInterface— Permanently stores the payment API access token. Helps avoid additional token requests between calls. The token is stored automatically during authorization.PaymentApiCredentialsRepositoryInterface— Permanently stores payment API credentials. Needed for automatically refreshing tokens and for callback processing. Credentials are stored automatically during authorization.
$sdk = (new SdkFacadeBuilder())
->setPaymentApiAuthTokenRepository($myTokenRepository)
->setPaymentApiCredentialsRepository($myCredentialsRepository)
->build();