forked from angellops/paypal-php-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBillAgreementUpdate.php
More file actions
32 lines (26 loc) · 1.51 KB
/
Copy pathBillAgreementUpdate.php
File metadata and controls
32 lines (26 loc) · 1.51 KB
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
<?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
$BAUFields = array(
'referenceid' => '', // Required. An ID, such as a billing agreement ID or a reference transaction ID that is associated with a billing agreement.
'billingagreementstatus' => '', // The current status of the billing agreement, which is one of the following values: Active or Canceled.
'billingagreementdescription' => '', // Description of goods or services associated with the billing agreement, which is required for each recurring payment billing agreement. PayPal recommends that the description contain a brief summary of the billing agreement terms and conditions. For example, customer will be billed at "9.99 per month for 2 years". 127 Car max.
'billingagreementcustom' => '' // Custom annotation field for your own use. 256 char max.
);
$PayPalRequestData = array('BAUFields'=>$BAUFields);
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$PayPalResult = $PayPal->BillAgreementUpdate($PayPalRequestData);
// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);
?>