If I use trusted_merchant OAuth, caching is not used at all. Therefore, every request with the same email and ext_customer_id makes new call to the API and returns new access token. Each token is used just once and then forgotten. The problem is in OpenPayU_Oauth::getAccessToken – there is a condition for trusted_merchant to skip the cache.
In my opinion, OAuth cache should be more universal LRU cache that will allow to store all kinds of access tokens.
If I use
trusted_merchant
OAuth, caching is not used at all. Therefore, every request with the sameemail
andext_customer_id
makes new call to the API and returns new access token. Each token is used just once and then forgotten. The problem is in OpenPayU_Oauth::getAccessToken – there is a condition fortrusted_merchant
to skip the cache.In my opinion, OAuth cache should be more universal LRU cache that will allow to store all kinds of access tokens.