Right now I contact the PayPal API to check the subscription status everytime the user enters the profile settings
, and each time a new access token
is generated.
Is this considered a bad practice in production? Should I rather set a timer for 24 hours and check the subscription status only once a day to reduce the load on PayPal's end? Does this even matter?
And would it be better to somehow store a new access token
in the .env
everytime it expires (PayPal gives the duration)?
I just want to know if there are any limitations since [https://developer.paypal.com/api/rest/reference/rate-limiting/][1] does not give any specific numbers.
CodePudding user response:
This is a question for PayPal's support but something like 100 requests/minute per endpoint would seem safe. Caching the access token is always preferred, certainly--saves you an unnecessary API call.