forked from LiveCarta/PayPal-PHP-SDK
Sample ResultPrinter Not to be Used
- Comment everywhere the ResultPrinter is used to not use outside sample
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user