Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Cannot retrieve payments #3

Closed
disconnectme opened this issue May 17, 2013 · 18 comments
Closed

Cannot retrieve payments #3

disconnectme opened this issue May 17, 2013 · 18 comments

Comments

@disconnectme
Copy link

I'm trying to write a script to tell how much people have donated for a software project. When I look in the paypal account, there are plenty of donations, but the API is returning an empty result when I request the payment list. Here's the script:

!/usr/bin/env python

import httplib2
import logging
import paypalrestsdk
import sys

logging.basicConfig(level=logging.INFO)
httplib2.debuglevel = 1

print sys.argv

mode = sys.argv[1]
client_id = sys.argv[2]
client_secret = sys.argv[3]

paypalrestsdk.configure(mode=mode, client_id=client_id, client_secret=client_secret)

history = paypalrestsdk.Payment.all({"count": 10})
print history

Here's the output:
INFO:root:Request[POST]: https://api.paypal.com/v1/oauth2/token
INFO:root:Response[200]: OK, Duration: 0.940779s
INFO:root:Request[GET]: https://api.paypal.com/v1/payments/payment?count=10
INFO:root:Response[200]: OK, Duration: 0.921905s
connect: (api.paypal.com, 443)
send: 'POST /v1/oauth2/token HTTP/1.1\r\nHost: api.paypal.com\r\nContent-Length: 29\r\naccept-encoding: gzip, deflate\r\nauthorization: Basic xyz\r\naccept: application/json\r\nuser-agent: PayPalSDK/rest-sdk-python 0.5.3 (httplib2 0.8; python 2.7.2)\r\n\r\ngrant_type=client_credentials'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Apache-Coyote/1.1
header: Date: Thu, 16 May 2013 22:36:46 GMT
header: Content-Type: application/json
header: Transfer-Encoding: chunked
connect: (api.paypal.com, 443)
send: 'GET /v1/payments/payment?count=10 HTTP/1.1\r\nHost: api.paypal.com\r\naccept-encoding: gzip, deflate\r\ncontent-type: application/json\r\naccept: application/json\r\nauthorization: Bearer xxx\r\nuser-agent: PayPalSDK/rest-sdk-python 0.5.3 (httplib2 0.8; python 2.7.2)\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Apache-Coyote/1.1
header: Date: Thu, 16 May 2013 22:36:47 GMT
header: PayPal-Debug-Id: e63eb1d8d07c1
header: Content-Type: application/json
header: Content-Length: 11
{u'count': 0}

@siddick
Copy link
Contributor

siddick commented May 17, 2013

Payment.all only list the payments that are created using Payment.create api call.

@ghost ghost assigned siddick May 17, 2013
@disconnectme
Copy link
Author

Is there anything to list all the payments, not just the ones created using Payment.create?

siddick added a commit that referenced this issue Jun 3, 2013
Fix test to not assume guaranteed order in dict
@siddick
Copy link
Contributor

siddick commented Aug 19, 2013

Refer #12 (comment)

@siddick siddick closed this as completed Aug 19, 2013
@johnpfeifer4
Copy link

I'm looking for the same feature and it sounds like you are telling us to use the old API's?

@sobelito
Copy link

I had the same issue where I could not pull donations or payments made via email from REST API. Empty result each time. Started to use the Merchant API, but.. the classic paypal APP signup was way too verbose, ... #NotFun

@avidas
Copy link
Contributor

avidas commented Feb 23, 2015

That is still the case that Payment.all only list the payments that are created using Payment.create i.e. payments created using REST APIs. Merchant API TransactionSearch or your merchant dashboard after you login would have other payments made using classic APIs.

@johnpfeifer4
Copy link

This really sucks. Seems that these API's reflect some serious flaws in what's happening behind the scenes. I'm not quite sure how you can convince people to go all-in with the REST API's when they don't show all historical transactions.

@johnpfeifer4
Copy link

I've been stuck using the TransactionSearch service which is pretty painful. This is 2015, tooling exists to codegen and easily consume RESTful and SOAP based services... Not these goofy NVP API's :(

@hakanb
Copy link

hakanb commented Feb 27, 2015

@johnpfeifer4 Check out https://github.com/gtaylor/paypal-python for a less painful way to use TransactionSearch. Example usage is available here: http://stackoverflow.com/a/23122397/378638

@pjrobertson
Copy link

I think this issue should be re-opened until the documentation is fixed. See: https://developer.paypal.com/webapps/developer/docs/api/#list-payment-resources

This is very misleading, and should really be "use this call to get a list of payments created by the Payment.create API call in any state..."
I wonder how many thousands of dev hours have been lost because of poor documentation...

List payment resources

Operation

GET /v1/payments/payment/

Use this call to get a list of payments in any state (created, approved, failed, etc.). The payments returned are the payments made to the merchant making the call.

Request

PayPal offers query parameters and pagination to help filter results.

@bluk
Copy link
Contributor

bluk commented Feb 22, 2016

For internal book-keeping, DEVDOC-406 was opened for this.

@bluk bluk reopened this Feb 22, 2016
@bluk
Copy link
Contributor

bluk commented Feb 26, 2016

@pjrobertson The REST API reference documentation beta was updated to explicitly call out that the payments listed are only for those created by Payment.create:

Use this call to list payments in any state, such as created, approved, and failed, that were created by the Payment.create call. The payments returned are the payments made to the merchant making the call.

https://developer.paypal.com/docs/rest/api/payments/#payment.list (the beta label will be removed in the near future). Thanks for your feedback.

@bluk bluk closed this as completed Feb 26, 2016
@pjrobertson
Copy link

Great! Thanks for your work :)

@InteXX
Copy link

InteXX commented Jun 15, 2016

I'm casting my vote for the ability to search for and locate ANY transaction via the REST API (and the .NET SDK), not just those created by an API.

In other words, the REST API (and the .NET SDK) should be able to locate transactions that were created manually via the website user interface. A returned list of merely API-created transactions (any API) is simply not sufficient—manually-created transactions should be included as well.

This is a very serious issue. I haven't seen discussion regarding the problem that's dated newer than over a year ago, so I hope attention to it hasn't waned.

Thanks,
Jeff Bowman
Fairbanks, Alaska

@braebot
Copy link
Contributor

braebot commented Jun 15, 2016

@InteXX, I totally agree. Would you mind creating a new issue for a new 'transaction search' API?

@InteXX
Copy link

InteXX commented Jun 15, 2016

@braebot: Sure thing, no problem. I'm using .NET, so I posted it here (hope you don't mind ;-)

@braebot
Copy link
Contributor

braebot commented Jun 21, 2016

Thanks @InteXX!

@InteXX
Copy link

InteXX commented Jun 21, 2016

@braebot: YW :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants