Merge pull request #359 from paypal/FuturePayment

Future payment
This commit is contained in:
Jay
2015-07-21 12:06:46 -05:00
4 changed files with 79 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) {