forked from angelleye/paypal-php-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetAccessPermissions.php
118 lines (109 loc) · 4.27 KB
/
SetAccessPermissions.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
// Include required library files.
require_once('includes/config.php');
require_once('includes/paypal.class.php');
// Create PayPal object.
$PayPalConfig = array(
'Sandbox' => $sandbox,
'APIUsername' => $api_username,
'APIPassword' => $api_password,
'APISignature' => $api_signature
);
$PayPal = new PayPal($PayPalConfig);
// Prepare request arrays
$SetAccessPermissionsFields = array(
'ReturnURL' => '', // URL to return the browser to after authorizing permissions.
'CancelURL' => '', // URL to return if the customer cancels authorization
'LogoutURL' => '', // URL to return to on logout from PayPal
'LocalCode' => '', // Local of pages displayed by PayPal during authentication. AU, DE, FR, IT, GB, ES, US
'PageStyle' => '', // Sets the custom payment page style of the PayPal pages associated with this button/link.
'HDRIMG' => '', // URL for the iamge you want to appear at the top of the PayPal pages. 750x90. Should be stored on a secure server. 127 char max.
'HDRBorderColor' => '', // Sets the border color around the header on PayPal pages.HTML Hexadecimal value.
'HDRBackColor' => '', // Sets the background color for PayPal pages.
'PayFlowColor' => '', // Sets the background color for the payment page.
'InitFlowType' => '', // The initial flow type, which is one of the following: login / signup Default is login.
'FirstName' => '', // Customer's first name.
'LastName' => ''
);
$RequiredPermissions = array(
'Email',
'Name',
'GetBalance',
'RefundTransaction',
'GetTransactionDetails',
'TransactionSearch',
'MassPay',
'EncryptedWebsitePayments',
'GetExpressCheckoutDetails',
'SetExpressCheckout',
'DoExpressCheckoutPayment',
'DoCapture',
'DoAuthorization',
'DoReauthorization',
'DoVoid',
'DoDirectPayment',
'SetMobileCheckout',
'CreateMobileCheckout',
'DoMobileCheckoutPayment',
'DoUATPAuthorization',
'DoUATPExpressCheckoutPayment',
'GetBillingAgreementCustomerDetails',
'SetCustomerBillingAgreement',
'CreateBillingAgreement',
'BillAgreementUpdate',
'BillUser',
'DoReferenceTransaction',
'Express_Checkout',
'Admin_API',
'Auth_Settle',
'Transaction_History'
);
$OptionalPermissions = array(
'Email',
'Name',
'GetBalance',
'RefundTransaction',
'GetTransactionDetails',
'TransactionSearch',
'MassPay',
'EncryptedWebsitePayments',
'GetExpressCheckoutDetails',
'SetExpressCheckout',
'DoExpressCheckoutPayment',
'DoCapture',
'DoAuthorization',
'DoReauthorization',
'DoVoid',
'DoDirectPayment',
'SetMobileCheckout',
'CreateMobileCheckout',
'DoMobileCheckoutPayment',
'DoUATPAuthorization',
'DoUATPExpressCheckoutPayment',
'GetBillingAgreementCustomerDetails',
'SetCustomerBillingAgreement',
'CreateBillingAgreement',
'BillAgreementUpdate',
'BillUser',
'DoReferenceTransaction',
'Express_Checkout',
'Admin_API',
'Auth_Settle',
'Transaction_History'
);
$PayPalRequestData = array(
'SetAccessPermissionsFields' => $SetAccessPermissionsFields,
'RequiredPermissions' => $RequiredPermissions,
'OptionalPermissions' => $OptionalPermissions
);
$PayPalRequestData = array(
'SetAccessPermissionsFields' => $SetAccessPermissionsFields,
'RequiredPermissions' => $RequiredPermissions,
'OptionalPermissions' => $OptionalPermissions
);
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$PayPalResult = $PayPal->SetAccessPermissions($PayPalRequestData);
// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);
?>