This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/sample/oauth/ObtainUserConsent.php
2014-10-14 16:54:43 -05:00

21 lines
405 B
PHP

<?php
require __DIR__ . '/../bootstrap.php';
$baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true';
//Get User Consent
// The clientId is stored in the bootstrap file
$redirectUrl = \PayPal\Auth\Openid\PPOpenIdSession::getAuthorizationUrl(
$baseUrl,
array('profile', 'email', 'phone'),
$clientId,
null,
null,
$apiContext
);
header("Location: $redirectUrl");
exit;