Wednesday, 20 March 2019

Storing OAuth Token in Python Library

I have a Python service which imports a library that talks to the PayPal API. There is a config file that is passed into the library __init__() which contains the PayPal API username and password.

Calling the PayPal API token endpoint with the username and password will return a token used to authenticate during the pay call. However, this token lasts for 90 minutes and should be reused.

Since the library is instantiated every time a Payment is to be made how should I store the API token so it can be reused for future payments?



from Storing OAuth Token in Python Library

No comments:

Post a Comment