Envato Purchase Verification Plugin Documentation

This integration guide will help you to automatically verify Envato purchase and add corresponding license details to Auto PHP Licenser database during installation of protected script.

Important!

Plugin uses existing Auto PHP Licenser modules in your application; no extra files are needed.

Plugin uses existing Auto PHP Licenser modules; therefore, protected application doesn't require any extra code or files.

Important!

The function must be called right before aplInstallLicense function in your script.
The only argument needed is client's Envato purchase code.
The plugin automatically detects and skips non-Envato codes.

In order to verify Envato purchase and add corresponding license details to Auto PHP Licenser database, you need to call a single function inside your code.

Function Arguments Returned Data Notes
aplVerifyEnvatoPurchase LICENSE_CODE array If license doesn't exist in Auto PHP Licenser database, looks for purchase on Envato and adds corresponding license to database on success.


Function: aplVerifyEnvatoPurchase($LICENSE_CODE).
Description: if license doesn't exist in Auto PHP Licenser database, looks for purchase on Envato and adds corresponding license to database on success and returns an array with error messages in case of error. Doesn't return anything when no errors are found.
Arguments: $LICENSE_CODE.
Returned data: array with errors (if any).
Should be used in: installer, right before aplInstallLicense function is called.

Additional notes: this function will only return errors if connection to your server (where Auto PHP Licenser web module is installed) can't be established. In case of purchase verification error (Envato API connection failure, invalid product or license, etc.), reports will be stored in the Reports > View System Reports tab in administration dashboard for security reasons. All non-Envato codes (like "test123", for example) will be silently skipped to prevent invalid API calls.

Example:

$purchase_verification=aplVerifyEnvatoPurchase($LICENSE_CODE);
if (!empty($purchase_verification)) //protected script can't connect to your licensing server
    {
    echo "Connection to remote server can't be established";
    exit();
    }

Here's the short summary of all the actions (listed step-by-step) needed to automatically verify Envato purchase and add corresponding license details to Auto PHP Licenser database.

  • call Envato Purchase Verification Plugin function inside your code before aplInstallLicense function;