PHP code example of tuxxx128 / paddle-php-api

1. Go to this page and download the library: Download tuxxx128/paddle-php-api 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/ */

    

tuxxx128 / paddle-php-api example snippets


$api = new \Paddle\Api;
$api->authorize_vendor($vendor_id, $vendor_auth_code);

$api->set_timeout(60);

$api = new \Paddle\Api($vendor_id, $vendor_auth_code, 60);

// define $vendor_id and $vendor_auth_code first
$api = new \Paddle\Api($vendor_id, $vendor_auth_code, 60);
$product_id = 100;
$license_code = $api->generate_license($product_id);

string generate_product_pay_link (int $product_id, [array $optional_arguments = array()])

string generate_custom_product_pay_link (string $title, float $price, string $image_url, string $webhook_url, array $optional_arguments)

string generate_license (int $product_id)

array get_products ([int $limit = 1], [int $offset = 0])

array generate_customers_report ([int $product_id = null])

array generate_license_activations_report ([int $product_id = null], [int $start_timestamp = null], [int $end_timestamp = null])

array generate_orders_report ([int $product_id = null], [int $start_timestamp = null], [int $end_timestamp = null])

array generate_sent_licenses_report ([int $product_id = null])

array generate_auth_code (string $vendor_email, string $vendor_password)

string register_external_application (string $application_name, string $application_description, string $application_icon_url)

string get_vendor_public_key ()
javascript
{
    "8/paddle-php-api": "1.*"
    }
}