Fixes #343: Future Payment Caching Issue

This commit is contained in:
Jay Patel
2015-07-20 11:28:17 -05:00
parent 5aa215c235
commit 9caf75ee82
2 changed files with 9 additions and 5 deletions

View File

@@ -125,6 +125,10 @@ class OAuthTokenCredential extends PayPalResourceModel
*/
public function getAccessToken($config)
{
// Check if we already have accessToken in Cache
if ($this->accessToken && (time() - $this->tokenCreateTime) < ($this->tokenExpiresIn - self::$expiryBufferTime)) {
return $this->accessToken;
}
// Check for persisted data first
$token = AuthorizationCache::pull($config, $this->clientId);
if ($token) {