Hello, how can I add a licensing system to prevent our products from being shared and used by non-purchasers.
you can do it through purchase code verification systems using envato api: https://build.envato.com
2 Likes
Hello, yes, I am getting the product information with the code below. But how will I know if this purchase code has been used before.
$verifyURL = 'https://api.envato.com/v3/market/author/sale/';
$curlURL = curl_init($verifyURL . '?code=' . $code);
curl_setopt($curlURL, CURLOPT_HTTPHEADER, self::prepareHeader());
curl_setopt($curlURL, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curlURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlURL, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curlURL, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
$result = curl_exec($curlURL);
curl_close($curlURL);
if ($result != "") {
return json_decode($result);
} else {
return false;
}
You have to make your own database systems where you will store purchase code and domain used that code. then for each new license registration you have to check your DB.