Authorization Cache to use both boolean and string in configuration

- both true and 'true' will enable authorization cache
This commit is contained in:
japatel
2014-12-22 14:13:08 -06:00
parent f03c2f893c
commit 9e7cb951a6
2 changed files with 2 additions and 2 deletions

View File

@@ -85,7 +85,7 @@ abstract class AuthorizationCache
$config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap(); $config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap();
if (array_key_exists("cache.enabled", $config)) { if (array_key_exists("cache.enabled", $config)) {
$value = $config['cache.enabled']; $value = $config['cache.enabled'];
return (trim($value) == 'true') ? true : false; return (trim($value) == true || trim($value) == 'true') ? true : false;
} }
return false; return false;
} }

View File

@@ -77,7 +77,7 @@ function getApiContext($clientId, $clientSecret)
'log.FileName' => '../PayPal.log', 'log.FileName' => '../PayPal.log',
'log.LogLevel' => 'FINE', 'log.LogLevel' => 'FINE',
'validation.level' => 'log', 'validation.level' => 'log',
'cache.enabled' => 'true', 'cache.enabled' => true,
// 'http.headers.PayPal-Partner-Attribution-Id' => '123123123' // 'http.headers.PayPal-Partner-Attribution-Id' => '123123123'
) )
); );