This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/sample/notifications/ListWebhooks.php
japatel fb9584ba66 More Webhook API Changes
- Updated API Models with Fixes
- Updated Samples
- Additional Functional Tests
2014-12-12 17:00:33 -06:00

28 lines
898 B
PHP

<?php
// # Get All Webhooks Sample
//
// Use this call to list all the webhooks, as documented here at:
// https://developer.paypal.com/webapps/developer/docs/api/#list-all-webhooks
// API used: GET /v1/notifications/webhooks
// ## List Webhooks
// This step is not necessarily required. We are creating a webhook for sample purpose only, so that we would not
// get an empty list at any point.
// In real case, you dont need to create any webhook to make this API call.
/** @var \PayPal\Api\Webhook $webhook */
$webhook = require_once __DIR__ . '/../bootstrap.php';
// ### Get List of All Webhooks
try {
$output = \PayPal\Api\Webhook::getAll($apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex);
exit(1);
}
ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output);
return $output;