2020-07-06 11:04:06 +03:00
|
|
|
<?php
|
2020-08-27 13:10:16 +03:00
|
|
|
/**
|
|
|
|
* The webhook module extensions.
|
|
|
|
*
|
2020-09-11 14:11:10 +03:00
|
|
|
* @package WooCommerce\PayPalCommerce\Webhooks
|
2020-08-27 13:10:16 +03:00
|
|
|
*/
|
2020-07-06 11:04:06 +03:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-09-11 14:11:10 +03:00
|
|
|
namespace WooCommerce\PayPalCommerce\Webhooks;
|
2020-07-06 11:04:06 +03:00
|
|
|
|
2021-09-16 13:48:20 +03:00
|
|
|
use WooCommerce\PayPalCommerce\Onboarding\State;
|
|
|
|
use WooCommerce\PayPalCommerce\Webhooks\Status\WebhooksStatusPage;
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'wcgateway.settings.fields' => static function ( $container, array $fields ): array {
|
|
|
|
$status_page_fields = array(
|
|
|
|
'webhooks-list' => array(
|
|
|
|
'title' => __( 'Registered webhooks', 'woocommerce-paypal-payments' ),
|
|
|
|
'type' => 'ppcp-table',
|
|
|
|
'screens' => array(
|
|
|
|
State::STATE_PROGRESSIVE,
|
|
|
|
State::STATE_ONBOARDED,
|
|
|
|
),
|
|
|
|
'requirements' => array(),
|
|
|
|
'gateway' => WebhooksStatusPage::ID,
|
|
|
|
'classes' => array( 'ppcp-webhooks-table' ),
|
|
|
|
'value' => function () use ( $container ) : array {
|
|
|
|
return $container->get( 'webhook.status.registered-webhooks-data' );
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
return array_merge( $fields, $status_page_fields );
|
|
|
|
},
|
|
|
|
);
|