mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-25 01:02:18 +08:00
21 lines
678 B
PHP
21 lines
678 B
PHP
<?php
|
|
|
|
/**
|
|
* The webhook module factories.
|
|
*
|
|
* @package WooCommerce\PayPalCommerce\Webhooks
|
|
*/
|
|
declare (strict_types=1);
|
|
namespace WooCommerce\PayPalCommerce\Webhooks;
|
|
|
|
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\WebhookEndpoint;
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|
return array('webhook.status.registered-webhooks' => function (ContainerInterface $container): array {
|
|
$endpoint = $container->get('api.endpoint.webhook');
|
|
assert($endpoint instanceof WebhookEndpoint);
|
|
$is_connected = $container->get('settings.flag.is-connected');
|
|
if ($is_connected) {
|
|
return $endpoint->list();
|
|
}
|
|
return array();
|
|
});
|