简体   繁体   中英

PayPal Rest API - List transactions from a billing agreement

I developed some weeks ago a payment service for my web in django using PayPal subscriptions. At that moment, all I did worked fine, but when I am testing it now to upload to production server, the function to get the history of payments of one specific billing agreement doesn't work.

The function does this:

try:
    billing_agreement = paypalrestsdk.BillingAgreement.find(request.POST.get("id"))
    transactions = billing_agreement.search_transactions("2014-01-01", time.strftime("%Y-%m-%d"))
except Exception, e:
    ...

So, anyone could help me to get that to work? I have seen some GitHub's codes using this way to get the history of payments and it worked for me some weeks ago, but not today.

This is Avi from PayPal. There were changes in the api recently, and getting the transactions endpoint changed from /transaction to /transactions. We released a new version of the sdk to reflect these changes. Updating the sdk should resolve these issues.

Please check the url New url is of type

https://{URL}/v1/payments/billing-agreements/{Agreement-Id}/transactions?start_date= {yyyy-mm-dd}&end_date={yyyy-mm-dd}

Path params are start_date & end_date

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM