PayPal Rest Api 获取用户信息

PayPal RestApi get UserInfo

Paypal 登录流程是 https://www.paypalobjects.com/webstatic/en_US/developer/docs/lipp/oic_flowchart.png

在 Web 应用程序中,我们的人员根据上一张图片执行了 2 个步骤,并为客户将 authtoken 和 refreshToken 放入数据库。 我想稍后获取 UserInfo(第 3 步)

文档说我们可以通过使用 accessToken 的 Autorization 的 GET 请求获取 userInfo。 https://developer.paypal.com/docs/api/#get-user-information

我试过了:

  1. 我通过 App_ID 和 Secret_Key 获得访问令牌。 如果我把它放到 GET 请求中,我会为所有者 paypal 应用程序获取 userInfo。我无法将 customerID(user_id) 作为参数放入此 GET 请求。

  2. 如果我将客户 accessToken 放入 GET 请求,我会收到未经授权的错误,因为客户 accessToken 是旧的。 我需要用 refreshToken 刷新它,但我做不到。 服务器答案是错误代码:400,响应:{"error_description":"Unable to refresh access token","error":"invalid_request","correlation_id":"fee0c71c02cda","information_link":"https://developer.paypal.com/docs/api/#errors"}

为什么我无法刷新accesstoken? (我在论坛上没有找到任何答案)

或者我稍后无法获取用户信息,我们应该在第 2 步之后立即获取?

我选择第 2 步,我只是尝试来自用户的有效访问令牌。它有效。 但是如果你想要刷新令牌,你应该使用权限 client_id 和客户端密码发送请求。