Skip to content

Checking License Status

Michel edited this page Nov 5, 2024 · 1 revision

Checking License Status

The CheckLicense.php file allows you to check the status of a license, which can help determine if it is active, expired, or blocked. This guide will walk you through configuring and using CheckLicense.php to verify license status.

Prerequisites

  • Ensure CoreConfig.php is configured with your API URL and secret key.
  • Verify that LicenseAPI.php is included in your project, as it provides the core method for checking license status.

How to Use CheckLicense.php

Step 1: Set Up the License Data

  1. Open CheckLicense.php.

  2. Define the license key to check by setting up a simple associative array:

    $licenseData = [ 'license_key' => 'YOUR_LICENSE_KEY' // The license key you want to check ];

    Replace 'YOUR_LICENSE_KEY' with the actual license key you wish to verify.

Step 2: Call the check Method

  1. Instantiate CheckLicense.

  2. Call the check() method with the $licenseData array. Here’s how:

    require_once 'CheckLicense.php';

    $checkLicense = new CheckLicense(); $checkLicense->check($licenseData['license_key']);

    This sends a request to check the status of the specified license key.

Step 3: Handle the Response

CheckLicense.php provides a response indicating the license’s current status. Here’s what to expect:

  • Active: If the license is active, you’ll see a message confirming its active status.
  • Expired: If the license has expired, an expiration message will be displayed.
  • Blocked: If the license is blocked, you’ll be notified to contact support.

Example Usage

Below is a complete example of using CheckLicense.php to check the status of a license:

require_once 'CheckLicense.php';

$licenseData = [ 'license_key' => 'YOUR_LICENSE_KEY' ];

$checkLicense = new CheckLicense(); $checkLicense->check($licenseData['license_key']);

License Status Responses

The CheckLicense.php script includes handling for various status responses:

  • Active: Confirms the license is valid and in good standing.
  • Expired: Notifies the user that the license has expired.
  • Blocked: Alerts the user that the license is blocked, suggesting they contact support.
  • Invalid License Key: If the license key is invalid, an error message will be displayed.

For detailed response handling, review the code in CheckLicense.php.

Next Steps

Once you’ve configured and tested license status checking, you can proceed to additional actions: