Add webhook status to status report

This commit is contained in:
Alex P 2021-11-24 11:52:14 +02:00
parent 27d71e14c3
commit f845acefbe
5 changed files with 124 additions and 4 deletions

View file

@ -32,11 +32,13 @@ return array(
$factory = $container->get( 'api.factory.webhook' );
$endpoint = $container->get( 'api.endpoint.webhook' );
$rest_endpoint = $container->get( 'webhook.endpoint.controller' );
$last_webhook_storage = $container->get( 'webhook.last-webhook-storage' );
$logger = $container->get( 'woocommerce.logger.woocommerce' );
return new WebhookRegistrar(
$factory,
$endpoint,
$rest_endpoint,
$last_webhook_storage,
$logger
);
},
@ -48,6 +50,7 @@ return array(
$verify_request = ! defined( 'PAYPAL_WEBHOOK_REQUEST_VERIFICATION' ) || PAYPAL_WEBHOOK_REQUEST_VERIFICATION;
$webhook_event_factory = $container->get( 'api.factory.webhook-event' );
$simulation = $container->get( 'webhook.status.simulation' );
$last_webhook_storage = $container->get( 'webhook.last-webhook-storage' );
return new IncomingWebhookEndpoint(
$webhook_endpoint,
@ -56,6 +59,7 @@ return array(
$verify_request,
$webhook_event_factory,
$simulation,
$last_webhook_storage,
... $handler
);
},
@ -183,6 +187,13 @@ return array(
);
},
'webhook.last-webhook-storage' => static function ( ContainerInterface $container ): WebhookInfoStorage {
return new WebhookInfoStorage( $container->get( 'webhook.last-webhook-storage.key' ) );
},
'webhook.last-webhook-storage.key' => static function ( ContainerInterface $container ): string {
return 'ppcp-last-webhook';
},
'webhook.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-webhooks/',