【发布时间】:2020-12-24 18:59:59
【问题描述】:
我想获取我的 PayPal 帐户交易历史记录。与我登录时可以导出的数据相同。
所有不是通过 REST API 本身生成的事务。
我读过一些帖子说不能使用,例如在这种情况下,“交易搜索”API (https://developer.paypal.com/docs/api/transaction-search/v1/)。
我试过了,但无法让它工作。
获得我的 access_token 后:
stdClass Object
(
[scope] => https://api.paypal.com/v1/payments/.* openid https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/identity/activities https://api.paypal.com/v1/vault/credit-card
[access_token] => xxx
[token_type] => Bearer
[app_id] => xxx
[expires_in] => 32400
[nonce] => 2020-09-05T22:25:09ZHAnra0QUpsxgo4E90gqEKtgtUNgkGNzVs1IVCBJfiu0
)
我尝试调用 /v1/reporting/transactions API 并返回:
stdClass Object
(
[localizedMessage] => No permission for the requested operation.
[suppressed] => Array
(
)
[name] => PERMISSION_DENIED
[message] => No permission for the requested operation.
[details] => Array
(
[0] => stdClass Object
(
[field] =>
[value] =>
[location] =>
[issue] => No permission for the requested operation.
)
)
[information_link] => https://developer.paypal.com/docs/classic/products/permissions/
[debug_id] => feb53d91bc653
)
响应中的“information_link”以 404 结束。
是的,我在我的开发者帐户中激活了“交易搜索 API”。
然后我发现了这个旧 API:
在那里,PayPal 表示此 API 已被弃用,但仍可用于使用它的客户。
对我来说,这也行不通,回复:
{
"name": "INTERNAL_SERVICE_ERROR",
"message": "An internal service error has occurred",
"debugId": "a2b554e8cc7b",
"links": [
{
"href": "https://developer.paypal.com/docs/api/overview/#error",
"rel": "information_link"
}
]
}
那么如何通过 API 获取我的 PayPal 账户的现有 PayPal 交易?一定有办法,导入这些数据的工具有很多,但是他们用的是哪个API呢?
【问题讨论】:
标签: php paypal paypal-rest-sdk