Sample ResultPrinter Not to be Used

- Comment everywhere the ResultPrinter is used to not use outside sample
This commit is contained in:
Jay Patel
2015-04-23 23:34:24 -05:00
parent c1dbda1242
commit ab334918b0
167 changed files with 592 additions and 749 deletions

View File

@@ -72,10 +72,12 @@ $request = clone $bankAccount;
try {
$bankAccount->create($apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex);
exit(1);
}
ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount);
return $bankAccount;

View File

@@ -34,10 +34,12 @@ $request = clone $card;
try {
$card->create($apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex);
exit(1);
}
ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card);
return $card;

View File

@@ -14,8 +14,10 @@ try {
// (See bootstrap.php for more on `ApiContext`)
$bankAccount->delete($apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex);
exit(1);
}
ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null);

View File

@@ -15,8 +15,10 @@ try {
// (See bootstrap.php for more on `ApiContext`)
$card->delete($apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex);
exit(1);
}
ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null);

View File

@@ -16,10 +16,12 @@ $bankAccount = require 'CreateBankAccount.php';
try {
$bankAccount = \PayPal\Api\BankAccount::get($bankAccount->getId(), $apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex);
exit(1);
}
ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount);
return $bankAccount;

View File

@@ -17,10 +17,12 @@ use PayPal\Api\CreditCard;
try {
$card = CreditCard::get($card->getId(), $apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $ex);
exit(1);
}
ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card);
return $card;

View File

@@ -42,10 +42,12 @@ $pathRequest->addPatch($pathOperation)
try {
$card = $card->update($pathRequest, $apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $ex);
exit(1);
}
ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card);
return $card;