Hello @arepsv
Thank you for your message and for using my plugin.
I don’t understand what exactly it is you did. But if you installed the plugin on the main domain, shouldn’t you make your requests there?
Also, do you have any PHP error logs?
Thread Starter
arepsv
(@arepsv)
I want my clients to be able to make their own license key on the index.php
I tried to make a new license key.
but failed, the browser only displays http error 500
if I try to get the license key, then the $ response is successful
index.php (sub.domain.com)
LMFWC ( instaled in my wordpress site domain.com )
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://domain.com/wp-json/lmfwc/v2/licenses?consumer_key=ck_e85b2e88e5f5d597e6203687663b5dc331b24bdf&consumer_secret=cs_e85df435670679aa3d6a5aa1d8db7fc35a186e91",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{
"product_id": "1777",
"license_key": "ECHOES-SILENCE-PATIENCE-AND-GRACE",
"valid_for": "365",
"status": "active",
"times_activated_max": 1
}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
@arepsv
And what do your PHP error logs say?
I would also strongly suggest to first try everything out with POSTMAN: https://www.postman.com/
After it works there, you can port your requests to your website.
Thread Starter
arepsv
(@arepsv)
#SOLVED
{“success”:true,”data”:{“id”:”9″,”orderId”:null,”productId”:”1777″,”licenseKey”:”ECHOES-SILENCE-PATIENCE-AND-GRACE”,”expiresAt”:null,”validFor”:”365″,”source”:”3″,”status”:”3″,”timesActivated”:null,”timesActivatedMax”:”1″,”createdAt”:”2020-03-26 13:05:18″,”createdBy”:”1″,”updatedAt”:null,”updatedBy”:null}}
I want to ask,
response [‘status’] = 1,2,3 etc, what does that represent?
2 = license active ..?
please explain..