【问题标题】:What is error in my code ?? I Want Retrieve Customer Information using我的代码有什么错误??我想使用检索客户信息
【发布时间】:2016-06-14 21:37:49
【问题描述】:

配置文件共享服务器端集成 (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;

【问题讨论】:

  • 我强烈建议您阅读How to Ask 页面以发布Minimal, Complete, and Verifiable examples另外,我认为您现在可能需要更改访问令牌,因为可能存在安全问题...
  • 请告诉我你对我的问题有什么困惑
  • 任何人请回答我的问题

标签: php ios curl paypal-sandbox


【解决方案1】:
$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

【讨论】:

  • 欢迎你 syon 开发者
猜你喜欢
  • 2016-04-18
  • 1970-01-01
  • 2018-02-23
  • 2018-12-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多