forked from LiveCarta/PayPal-PHP-SDK
Updates to LIPP & Future Payments
- Updated LIPP Sample code - Updated Future Payments to have helper functions for retrieving access token - Updated Logging Syntax to include timestamp and response json
This commit is contained in:
22
sample/lipp/ObtainUserConsent.php
Normal file
22
sample/lipp/ObtainUserConsent.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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
|
||||
);
|
||||
|
||||
print_result("Generated the User Consent URL", "URL", null, '<a href="'. $redirectUrl . '" >Click Here to Obtain User Consent</a>');
|
||||
Reference in New Issue
Block a user