forked from LiveCarta/PayPal-PHP-SDK
Enabled Billing Plans and Agreements APIs
- Added API Classes, Samples, and Tests - Updated Functional Tests - Updated Documentation with new SDK Name - Updated Few Samples to use newer nicer result page
This commit is contained in:
22
sample/billing/ExecuteAgreement.php
Normal file
22
sample/billing/ExecuteAgreement.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
session_start();
|
||||
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||
|
||||
$token = $_GET['token'];
|
||||
|
||||
$agreement = new \PayPal\Api\Agreement();
|
||||
|
||||
try {
|
||||
$agreement->execute($token, $apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
ResultPrinter::printResult("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $agreement);
|
||||
|
||||
} else {
|
||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||
}
|
||||
Reference in New Issue
Block a user