我创建了一个新应用程序,并按照此处记录的 API 说明进行操作:https : //developer.paypal.com/docs/api/activities/
我的沙箱凭证很好,我用它们创建了一个不记名令牌,我用它(在 Postman 中)成功地发布了付款(https://api.sandbox.paypal.com/v1/payments/payment)。
但是,我对这个应用程序的目标是使用上面链接的 API 函数创建一个活动报告。为此,除了所有其他应用程序功能选项之外,我还打开了名为Transaction Search的适当“应用程序功能选项” 。
标题:
Authorization: Bearer (new bearer token here)
Run Code Online (Sandbox Code Playgroud)
我的 GET 请求:
https://api.sandbox.paypal.com/v1/activities/activities?start_time=2018-05-03T15:00:00.000Z&end_time=2018-05-02T15:30:00.000Z&page_size=10&next_page_token=1
Run Code Online (Sandbox Code Playgroud)
无论我做什么,我都会得到:
HTTP Status: 401 Unauthorized
Run Code Online (Sandbox Code Playgroud)
请求正文:
{
"name": "PERMISSION_DENIED",
"message": "No permission for the requested operation",
"details": {
"": "No permission for the requested operation"
}
}
Run Code Online (Sandbox Code Playgroud)
我是美国开发者,这个应用是我自己用的。
最终答案(目前),由 PayPal 开发人员支持技术人员确认:
PayPal 尚未向公众提供用于创建此报告的 REST API 方法。在旧的 NVP(名称-值对)API 中使用 TransactionSearch,它有相当详细的文档记录并随处使用 - 尽管它自 2017 年以来已被弃用。
对于那些喜欢使用示例代码的人,以下 GitHub 项目展示了如何实现 API。这对我很有帮助:
https://github.com/gtaylor/paypal-python
| 归档时间: |
|
| 查看次数: |
2535 次 |
| 最近记录: |