braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
241 stars 155 forks source link

Issues with plan:all method and search customers #118

Closed ngodichat closed 4 years ago

ngodichat commented 4 years ago

General information

Issue description

I have 3 issues:

  1. I cannot search customers by their emails:
    
    import braintree

gateway = braintree.BraintreeGateway(access_token='access_token$') collection = gateway.transaction.search([ braintree.TransactionSearch.customer_email != "abc" ])

collection = gateway.customer.search(braintree.CustomerSearch.email != "abc@gmail.com") for customer in collection.items: print('first_name: ',customer)


The server always return `Error: braintree.exceptions.server_error.ServerError`

2. I can't get all plans by doing as written in the documentation, it always returns `braintree.exceptions.authorization_error.AuthorizationError: None` while there's no Resource-oriented OAuth scopes for this method. 
The code is as follow:
```py
import braintree

gateway = braintree.BraintreeGateway(access_token='access_token$')
collection = gateway.plan.all()

collection = gateway.customer.search(braintree.CustomerSearch.email != "abc@gmail.com")
for plan in collection.items:
    print('first_name: ', plan)
  1. And I can't find the customer id in the search result of transaction, what is the best way to get that information?

Thank you very much!

scannillo commented 4 years ago

Hello. Here are our docs links to the two errors #1 and #2 you're seeing.

In regards to question 3, here is a link to our docs for searching for customers. But our Support team can take your questions on this functionality.

Please contact support at support@getbraintree.com, who can help troubleshoot your specific integration. Feel free to open a new issue if you find an issue with our SDK.

ngodichat commented 4 years ago

Hello. Here are our docs links to the two errors #1 and #2 you're seeing.

In regards to question 3, here is a link to our docs for searching for customers. But our Support team can take your questions on this functionality.

Please contact support at support@getbraintree.com, who can help troubleshoot your specific integration. Feel free to open a new issue if you find an issue with our SDK.

Thanks for your quick response but those two links are not very informative. Can you tell me why the search functionality, which searches for a customer_email != a specific email, works for transactions but not for customers?

And why there's no Resource-oriented OAuth scopes for plan:all() but it still return AuthorizationError? How can I make that function usable?

Thanks!

hollabaq86 commented 4 years ago

šŸ‘‹ @ngodichat, please contact Support referencing this issue. They'll partner with the team that owns OAuth to answer your questions and look into the source of the issues you're seeing with your searches.

Also for future reference, Access Tokens should not be shared in a public forum like GitHub (even sandbox tokens šŸ˜„). I went ahead and removed your access token for security.

ngodichat commented 4 years ago

@hollabaq86 Thank you :)