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

@ -21,6 +21,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper;
use WooCommerce\PayPalCommerce\Onboarding\State;
use WooCommerce\PayPalCommerce\Webhooks\WebhookInfoStorage;
/**
* Class StatusReportModule
@ -64,6 +65,9 @@ class StatusReportModule implements ModuleInterface {
/* @var MessagesApply $messages_apply The messages apply. */
$messages_apply = $c->get( 'button.helper.messages-apply' );
$last_webhook_storage = $c->get( 'webhook.last-webhook-storage' );
assert( $last_webhook_storage instanceof WebhookInfoStorage );
/* @var Renderer $renderer The renderer. */
$renderer = $c->get( 'status-report.renderer' );
@ -103,6 +107,11 @@ class StatusReportModule implements ModuleInterface {
$messages_apply->for_country()
),
),
array(
'label' => esc_html__( 'Webhook status', 'woocommerce-paypal-payments' ),
'description' => esc_html__( 'Whether we received webhooks successfully.', 'woocommerce-paypal-payments' ),
'value' => $last_webhook_storage->is_empty() ? 'Unknown' : 'OK',
),
array(
'label' => esc_html__( 'Vault enabled', 'woocommerce-paypal-payments' ),
'description' => esc_html__( 'Whether vaulting is enabled on PayPal account or not.', 'woocommerce-paypal-payments' ),