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

@@ -56,26 +56,31 @@ try {
// ^ Ignore workflow code segment
if ($ex instanceof \PayPal\Exception\PayPalConnectionException) {
$data = $ex->getData();
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Created Webhook Failed. Checking if it is Webhook Number Limit Exceeded. Trying to delete all existing webhooks", "Webhook", "Please Use <a style='color: red;' href='DeleteAllWebhooks.php' >Delete All Webhooks</a> Sample to delete all existing webhooks in sample", $request, $ex);
if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) {
require 'DeleteAllWebhooks.php';
try {
$output = $webhook->create($apiContext);
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
exit(1);
}
} else {
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
exit(1);
}
} else {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
exit(1);
}
// Print Success Result
}
ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output);
return $output;