Hello Team,
I am new to clover web app development.
I have read the https://docs.clover.com/build/oauth-2-0/ Auth document twice or thrice but didnt understand it fully sothat i can generate access token for my test merchant.
blow is the code i am using(PHP)
$appSecret="[appSecret]"; $appId="CN4SN5WTQ22BW"; if(!empty($GET)) { if(isset($GET['code'])) { makeCall("https://www.clover.com/oauth/token?clientid=$appId&clientsecret=$appSecret&code=".$_GET['code'],0,array()); } }
function makeCall($url=0,$method=0,$data=array()) { // Get cURL resource $curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL =>$url,
CURLOPT_SSL_VERIFYPEER=>0
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
if(!$resp){
die('Error: "' . curl_error($curl) . '" - Code: ' . curl_errno($curl));
}
// Close request to clear up some resources
curl_close($curl);
echo "<br/>".$url;
echo "<br/>".$resp;
}
When i run this i get error: {"message":"Unknown Client ID"}
I also tried to run url directly in browser but got the same error.
Please help
Thanks