Paylith PHP Library provides access to Paylith API from Applications written in PHP language.
- PHP 7.1 or higher
Install the library using Composer
$ composer require paylith/php-sdk
Use autoloader
require_once('vendor/autoload.php');
Create a Merchant link
use Paylith\Client;
$client = new Paylith\Client('TestApiKey', 'TestApiSecret');
try {
$result = $paylith->createMerchantLink(
'TestConversationId',
'TestUserId',
'TestUserEmail',
'TestUserIpAddress',
);
} catch (Exception $exception) {
// catch errors
}
Create a Product link
use Paylith\Client;
$client = new Paylith\Client('TestApiKey', 'TestApiSecret');
try {
$result = $paylith->createProductLink(
'TestConversationId',
'TestUserId',
'TestUserEmail',
'TestUserIpAddress',
'TestProductName',
'TestProductAmount',
);
} catch (Exception $exception) {
// catch errors
}
Get Payment Detail
use Paylith\Resources\Payment;
$payment = new Paylith\Resources\Payment();
try {
$result = $payment->getDetail([
'TestIpAddres',
'TestPaymentId'
]);
} catch (Exception $exception) {
// catch errors
}
See the Paylith API documentation
If you have any questions or issues, please contact our support at contact@paylith.com.
MIT license. For more information see the LICENSE file