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 => "https://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;
}
?>