我正在尝试使用PayPal REST API来获取付款清单.通常这些付款将通过eBay进行.
当我尝试沙箱时,我可以获得一个令牌,然后按预期获得付款清单.但是当我切换到直播时,列表总是空的.
例如,使用curl:
curl https://api.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "ASnXAXXXXXXXXXXXXXXXXXXXXXPP7sBaB:EGWXXXXXXXXXXXXXXXXXXXXXXXs-NU" \
-d "grant_type=client_credentials"
<response>
{"scope":"https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault /credit-card https://api.paypal.com/v1/vault/credit-card/.* openid","access_token":"dzXXXXXXXXXXXXXXXXXXHJs-XXXXXA","token_type":"Bearer","app_id":"APP-1JCXXXXXXXXXXX08","expires_in":28800}
Run Code Online (Sandbox Code Playgroud)
然后我从响应正文中获取令牌并调用支付列表资源:
curl -v -X GET https://api.paypal.com/v1/payments/payment \
-H "Content-Type:application/json" \
-H "Authorization: Bearer dzXXXXXXXXXXXXXXXXXXHJs-XXXXXA"
<response>
{"count":0}
Run Code Online (Sandbox Code Playgroud)
帐户中实际有付款,所以我做错了吗?我没有设法谷歌任何有用的答案.我在一篇文章中看到了一个建议,即REST API可能只返回通过REST API进行的付款?如果是这种情况(那么其余的API将被限制使用)那么还有另一种方法来获得收到的付款清单吗?再说一次,到目前为止,我还没有在paypal文档或google中找到一个.
感谢您的任何建议或帮助.