public function __construct($loggerName, $config = null) { $this->loggerName = $loggerName; $config = PPConfigManager::getConfigWithDefaults($config); $this->isLoggingEnabled = array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1'; if ($this->isLoggingEnabled) { $this->loggerFile = $config['log.FileName'] ? $config['log.FileName'] : ini_get('error_log'); $loggingLevel = strtoupper($config['log.LogLevel']); $this->loggingLevel = isset($loggingLevel) && defined("PPLoggingLevel::{$loggingLevel}") ? constant("PPLoggingLevel::{$loggingLevel}") : PPLoggingManager::DEFAULT_LOGGING_LEVEL; } }
/** * * @param string $method - API method to call * @param object $requestObject Request object * @param apiContext $apiContext object containing credential and SOAP headers * @param mixed $apiUserName - Optional API credential - can either be * a username configured in sdk_config.ini or a ICredential object created dynamically */ public function call($port, $method, $requestObject, $apiContext, $handlers) { if ($apiContext == null) { $apiContext = new PPApiContext(PPConfigManager::getConfigWithDefaults($this->config)); } if ($apiContext->getConfig() == null) { $apiContext->setConfig(PPConfigManager::getConfigWithDefaults($this->config)); } $service = new PPAPIService($port, $this->serviceName, $this->serviceBinding, $apiContext, $handlers); $ret = $service->makeRequest($method, new PPRequest($requestObject, $this->serviceBinding)); $this->lastRequest = $ret['request']; $this->lastResponse = $ret['response']; return $this->lastResponse; }
/** * * @param string $postData OPTIONAL post data. If null, * the class automatically reads incoming POST data * from the input stream */ public function __construct($postData = '', $config = null) { $this->config = PPConfigManager::getConfigWithDefaults($config); if ($postData == '') { // reading posted data from directly from $_POST may causes serialization issues with array data in POST // reading raw POST data from input stream instead. $postData = file_get_contents('php://input'); } $rawPostArray = explode('&', $postData); foreach ($rawPostArray as $keyValue) { $keyValue = explode('=', $keyValue); if (count($keyValue) == 2) { $this->ipnData[urldecode($keyValue[0])] = urldecode($keyValue[1]); } } //var_dump($this->ipnData); }
public function __construct($config = null) { $this->config = PPConfigManager::getConfigWithDefaults($config); }