This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/sample/billing/ExecuteAgreement.php
japatel 3c02790138 Updates to Sample Code
- Updated UI Presentation on samples
- Fixed Bugs
2014-11-02 18:22:35 -06:00

22 lines
630 B
PHP

<?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 (Exception $ex) {
ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex);
exit(1);
}
ResultPrinter::printResult("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $agreement);
} else {
ResultPrinter::printResult("User Cancelled the Approval", null);
}