-
-
Notifications
You must be signed in to change notification settings - Fork 29
Activating a License
The ActivateLicense.php
file allows you to activate a license for a specific domain or device, securely communicating with the SLM Plus API. This guide will walk you through configuring and using ActivateLicense.php
to manage license activation.
- Ensure
CoreConfig.php
is configured with your API URL and secret key. - Confirm that
LicenseAPI.php
is included in your project, as it provides the core method for activating licenses.
-
Open
ActivateLicense.php
. -
Define the activation data as an associative array. Here’s an example of required fields:
$activationData = [ 'license_key' => 'YOUR_LICENSE_KEY', // The license key to activate 'registered_domain' => 'example.com', // Domain to associate with the license 'registered_devices' => 'Device12345' // Optional: Device identifier ];
Adjust these fields based on the specific domain or device information you want to activate.
-
Instantiate
ActivateLicense
. -
Call the
activate()
method with the$activationData
array. Here’s how:require_once 'ActivateLicense.php';
$activateLicense = new ActivateLicense(); $activateLicense->activate($activationData);
This sends a request to activate the license on the specified domain and/or device.
ActivateLicense.php
provides a response indicating the success or failure of the activation attempt. Here’s what to expect:
- Success: If activation is successful, you’ll see a message confirming activation for the specified domain and/or device.
- Error: If there’s an issue (e.g., maximum allowed domains or devices reached), an error message will be displayed.
Below is a complete example of using ActivateLicense.php
to activate a license:
require_once 'ActivateLicense.php';
$activationData = [ 'license_key' => 'YOUR_LICENSE_KEY', 'registered_domain' => 'example.com', 'registered_devices' => 'Device12345' ];
$activateLicense = new ActivateLicense(); $activateLicense->activate($activationData);
The ActivateLicense.php
script includes specific error handling to cover scenarios like:
- Expired License: Notifies the user if the license is expired.
- Blocked License: Alerts the user if the license is blocked.
- Max Domains or Devices Reached: Provides a message if the license has reached its allowed limit of domains or devices.
For detailed response handling, review the code in ActivateLicense.php
.
After configuring and testing license activation, you can proceed to additional actions:
Updated and maintained by Epikly