我的代码中有什么错误?我想使用检索客户信息



配置文件共享服务器端集成 (PayPal-iOS-SDK)

使用有效的访问令牌检索客户信息。 但它不起作用(客户信息不获取我的代码中的问题。 如果有任何想法和代码,请帮助我)

$access_token = "xxxx";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid");
curl_setopt($ch, CURLOPT_HEADER, "Content-Type:application/json");
curl_setopt($ch, CURLOPT_HEADER, "Authorization: Bearer ".$access_token);
$result1 = curl_exec($ch);
curl_close($ch);
print_r($result1);die;
$access_token = "xxxxx";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo?schema=openid&access_token=xxxx");
$headers = array("Accept: application/json", "Accept-Language: en_US");
curl_setopt($ch, CURLOPT_HEADER, $headers);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HEADER, "Authorization: Bearer ".str_replace(" ", "", $access_token));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$result1 = curl_exec($ch);
$information = curl_getinfo($ch);
curl_close($ch);
print_r($information);die;

https://gist.github.com/xcommerce-gists/4007896#file-getuserprofile-request-curl

相关内容

  • 没有找到相关文章

最新更新