forked from angelleye/paypal-php-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RequestPermissions.php
63 lines (56 loc) · 1.89 KB
/
RequestPermissions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// Include required library files.
require_once('includes/config.php');
require_once('includes/paypal.class.php');
// Create PayPal object.
$PayPalConfig = array(
'Sandbox' => $sandbox,
'DeveloperAccountEmail' => $developer_account_email,
'ApplicationID' => $application_id,
'DeviceID' => $device_id,
'IPAddress' => $_SERVER['REMOTE_ADDR'],
'APIUsername' => $api_username,
'APIPassword' => $api_password,
'APISignature' => $api_signature,
'APISubject' => $api_subject
);
$PayPal = new PayPal_Adaptive($PayPalConfig);
// Prepare request arrays
$Scope = array(
'EXPRESS_CHECKOUT',
'DIRECT_PAYMENT',
'SETTLEMENT_CONSOLIDATION',
'SETTLEMENT_REPORTING',
'AUTH_CAPTURE',
'MOBILE_CHECKOUT',
'BILLING_AGREEMENT',
'REFERENCE_TRANSACTION',
'AIR_TRAVEL',
'MASS_PAY',
'TRANSACTION_DETAILS',
'TRANSACTION_SEARCH',
'RECURRING_PAYMENTS',
'ACCOUNT_BALANCE',
'ENCRYPTED_WEBSITE_PAYMENTS',
'REFUND',
'NON_REFERENCED_CREDIT',
'BUTTON_MANAGER',
'MANAGE_PENDING_TRANSACTION_STATUS',
'RECURRING_PAYMENT_REPORT',
'EXTENDED_PRO_PROCESSING_REPORT',
'EXCEPTION_PROCESSING_REPORT',
'ACCOUNT_MANAGEMENT_PERMISSIONS',
'ACCESS_BASIC_PERSONAL_DATA',
'ACCESS_ADVANCED_PERSONAL_DATA'
);
$RequestPermissionsFields = array(
'Scope' => $Scope, // Required.
'Callback' => '' // Required. Your callback function that specifies actions to take after the account holder grants or denies the request.
);
$PayPalRequestData = array('RequestPermissionsFields');
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$PayPalResult = $PayPal->RequestPermissions($PayPalRequestData);
// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);
?>