Skip to content

Commit 09ec495

Browse files
committed
v0.0.6
1 parent 5e5d6e6 commit 09ec495

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ back to `%HOME%\AppData\Roaming` if undefined
107107
[Confuse Help](https://confuse.readthedocs.io/en/latest/usage.html#search-paths)
108108

109109

110+
### Managing obtained credentials
111+
112+
By default the package will create a 600 permissions file in the configuration search path. This is because the token obtained it will ve valid for 3200 seconds and storing it will reduce the calls to the oauth paypal endpoint. If you dont want to store it in a file there is an option to use the LRU Cache from cachetools but the cache will be available only during the script living environment, so once you get the token, any call will be used the cached token but since the script terminates the cached key will be gone.
113+
114+
```python
115+
from python_paypal_api.api import Identity, Catalog
116+
from python_paypal_api.base import PaypalApiException
117+
import logging
118+
119+
try:
120+
result = Identity(store_credentials=False).get_userinfo()
121+
logging.info(result)
122+
123+
except PaypalApiException as error:
124+
logging.error(error)
125+
```
126+
127+
128+
110129
### Exceptions
111130

112131
You can use a [try](https://docs.python.org/3.10/reference/compound_stmts.html#try) except statement when you call the API and catch exceptions if some problem ocurred:

0 commit comments

Comments
 (0)