1. Go to this page and download the library: Download paddlehq/paddle-php-sdk 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/ */
paddlehq / paddle-php-sdk example snippets
use Paddle\SDK\Exceptions\ApiError;
try {
// Call functions from the SDK
} catch (ApiError $e) {
// $e->errorCode will always follow the error code defined in our documentation
if ($e->errorCode === 'conflict') {
// Handle Conflict error
}
}
bash
composer
php
use Paddle\SDK\Client;
$paddle = new Client('API_KEY');
php
use Paddle\SDK\Client;
$paddle = new Client('API_KEY');
$products = $paddle->products->list();
// List returns an iterable, so pagination is handled automatically.
foreach ($products as $product) {
echo $product->id;
}