forked from LiveCarta/PayPal-PHP-SDK
[PSR] Fixed Tests
- Using `php-cs-fixer` tool.
This commit is contained in:
@@ -8,7 +8,6 @@ require __DIR__ . '/../bootstrap.php';
|
||||
// ## Approval Status
|
||||
// Determine if the user accepted or denied the request
|
||||
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||
|
||||
$token = $_GET['token'];
|
||||
$agreement = new \PayPal\Api\Agreement();
|
||||
try {
|
||||
@@ -17,7 +16,7 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||
$agreement->execute($token, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex);
|
||||
ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -30,13 +29,12 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||
$agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex);
|
||||
ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement);
|
||||
|
||||
} else {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||
|
||||
Reference in New Issue
Block a user