/**
* 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));
}