我正在使用var_dump检查curl_init()并得到:
类型(curl)的resource(69)
此响应是什么意思?我的代码如下:
$apikey = "API-KEY";
$ch = curl_init();
// var_dump($ch);
curl_setopt($ch, CURLOPT_URL, "https://identity-uat.ngeniuspayments.com/auth/realms/ni/protocol/openidconnect/token");
$headers = curl_getinfo($ch);
echo "<pre>";
print_r($headers);
echo "</pre>";
$test = curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Basic'.$apikey,
'Content-Type: application/x-www-form-urlencoded'));
// var_dump($test);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(grant_type => client_credentials)));
var_dump($ch);
$output = json_decode(curl_exec($ch));
$access_token = $output->access_token;
print_r($access_token);
推荐,您是否能够在您的opencart网站上实施N.Genious解决方案。请您分享实现NGenus + opencart所需的任何相关详细信息
问候