forked from LiveCarta/PayPal-PHP-SDK
- Added API Classes, Samples, and Tests - Updated Functional Tests - Updated Documentation with new SDK Name - Updated Few Samples to use newer nicer result page
23 lines
645 B
PHP
23 lines
645 B
PHP
<?php
|
|
|
|
require __DIR__ . '/../bootstrap.php';
|
|
|
|
use PayPal\Auth\Openid\PPOpenIdSession;
|
|
|
|
$baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true';
|
|
|
|
// ### Get User Consent URL
|
|
// The clientId is stored in the bootstrap file
|
|
|
|
//Get Authorization URL returns the redirect URL that could be used to get user's consent
|
|
$redirectUrl = PPOpenIdSession::getAuthorizationUrl(
|
|
$baseUrl,
|
|
array('profile', 'email', 'phone'),
|
|
null,
|
|
null,
|
|
null,
|
|
$apiContext
|
|
);
|
|
|
|
ResultPrinter::printResult("Generated the User Consent URL", "URL", '<a href="'. $redirectUrl . '" >Click Here to Obtain User Consent</a>', $baseUrl, $redirectUrl);
|