/** * Returns the URL to which the user must be redirected to * logout from the OpenID provider (i.e. PayPal) * * @param string $redirectUri Uri on merchant website to where * the user must be redirected to post logout * @param string $idToken id_token from the TokenInfo object * @param PPApiContext $apiContext Optional API Context */ public static function getLogoutUrl($redirectUri, $idToken, $apiContext = null) { if (is_null($apiContext)) { $apiContext = new PPApiContext(); } $config = $apiContext->getConfig(); $params = array('id_token' => $idToken, 'redirect_uri' => $redirectUri, 'logout' => 'true'); return sprintf("%s/v1/endsession?%s", self::getBaseUrl($config), http_build_query($params)); }
/** * * @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; }