nopCommerce icon indicating copy to clipboard operation
nopCommerce copied to clipboard

PayPal Commerce plugin. OAuth tokens used for every transaction

Open renaldas opened this issue 5 months ago • 0 comments

nopCommerce version: 4.60.5

we had many sales recently and encountering rate-limiting issues with PayPal API when requesting OAuth tokens for every transaction.:

Payments.PayPalCommerce error: One or more errors occurred. ({"name":"RATE_LIMIT_REACHED","debug_id":"82314f17885c7","message":"Too many requests. Blocked due to rate limiting.","links":[]})

After contacting PayPal Merchant Technical Support, it was identified that our system is being rate-limited due to the frequent request of new OAuth tokens for each transaction. PayPal recommends caching tokens to avoid rate-limiting issues.

Recommendation from PayPal Support:

OAuth tokens have a lifespan of around 9 hours and should be reused during that time; however, your system is requesting new OAuth tokens for every transaction. Requesting a new OAuth token for every transaction, at scale, is highly problematic and will result in rate limiting.

To resolve this issue, please ensure your system follows the rate limiting guidelines linked below. If you reach out to your web developer or third-party checkout plugin provider, they can further assist. "Rather than generate an OAuth 2.0 access token for each transaction, cache tokens." https://developer.paypal.com/api/rest/reference/rate-limiting/

Impact: The current approach of requesting new OAuth tokens for every transaction is causing rate-limiting, potentially affecting the overall system performance and transaction processing.

Action Required: Adjust the system behavior to cache OAuth tokens as recommended by PayPal to avoid rate-limiting issues.

renaldas avatar Jan 24 '24 09:01 renaldas