PayPal REST API“列出付款"不返回任何条目 [英] PayPal REST API "List Payments" returns no entries

查看:26
本文介绍了PayPal REST API“列出付款"不返回任何条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 PayPal REST API 来获取付款列表.通常,这些付款将通过 eBay 进行.

I'm trying to use PayPal REST API to get a list of payments. Typically these payments will have been made via eBay.

当我尝试沙箱时,我可以获得一个令牌,然后按预期获得付款列表.但是当我切换到直播时,列表总是空的.

When I try the sandbox I can get a token, and then get a list of payments as expected. But when I switch to live the list is always empty.

例如,使用 curl:

For example, using 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}

然后我从响应正文中取出令牌并调用支付列表资源:

Then I take the token from the response body and call the payments list resource:

 curl -v -X GET https://api.paypal.com/v1/payments/payment 
 -H "Content-Type:application/json" 
 -H "Authorization: Bearer dzXXXXXXXXXXXXXXXXXXHJs-XXXXXA"

<response>
{"count":0}

帐户中确实有付款,所以我做错了什么吗?我还没有设法用谷歌搜索任何有用的答案.我在一篇文章中看到一个建议,也许只有通过 REST API 支付的款项才会由 REST API 返回?如果是这种情况(那么其余 API 的使用将是有限的)那么还有另一种方法来获取收到的付款列表吗?再说一次,到目前为止,我都没能在 paypal 文档或谷歌中找到一个.

There are actually payments in the account, so am I doing something wrong? I've not managed to google up any useful answers. I saw a suggestion on one post that maybe only payments made via the REST API are returned by the REST API? If that is the case (then the rest API would be of limited used) then is there another way to get a list of payments received? Again, I've had no luck in finding one in the paypal docs or google so far.

感谢您的任何建议或帮助.

Thanks for any advice or help.

推荐答案

我也遇到了这个问题.奇怪的是,PayPal REST API 似乎只返回通过 REST API 支付的结果.请参阅此处:https://stackoverflow.com/a/18139747

I also ran into this issue. Strangely, It seems that the PayPal REST API only returns results for payments made through the REST API. See here: https://stackoverflow.com/a/18139747

在 REST API 得到改进之前,经典 API 仍将是这样做的方式.

Classic API will remain the way to do this until the REST API is improved.

这篇关于PayPal REST API“列出付款"不返回任何条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆