forked from LiveCarta/PayPal-PHP-SDK
[PSR] Fixed Tests
- Using `php-cs-fixer` tool.
This commit is contained in:
@@ -58,7 +58,7 @@ try {
|
||||
$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) {
|
||||
if (strpos($data, 'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) {
|
||||
require 'DeleteAllWebhooks.php';
|
||||
try {
|
||||
$output = $webhook->create($apiContext);
|
||||
@@ -69,7 +69,7 @@ try {
|
||||
}
|
||||
} else {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
|
||||
ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -16,7 +16,7 @@ try {
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex);
|
||||
ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ try {
|
||||
$output = $webhook->delete($apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex);
|
||||
ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ try {
|
||||
$output = \PayPal\Api\Webhook::get($webhookId, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex);
|
||||
ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ try {
|
||||
$output = \PayPal\Api\WebhookEventType::subscribedEventTypes($webhookId, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $ex);
|
||||
ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList",null, null, $output);
|
||||
ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList", null, null, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -19,11 +19,11 @@ try {
|
||||
$output = \PayPal\Api\Webhook::getAll($apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex);
|
||||
ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output);
|
||||
ResultPrinter::printResult("List all webhooks", "WebhookList", null, null, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -23,7 +23,7 @@ try {
|
||||
$output = \PayPal\Api\WebhookEvent::all($params, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex);
|
||||
ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ try {
|
||||
$output = $webhook->update($patchRequest, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex);
|
||||
ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ try {
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output);
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ try {
|
||||
$output = \PayPal\Api\WebhookEventType::availableEventTypes($apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $ex);
|
||||
ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user