mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
♻️ Refactor ppcp-webhooks/factory
This commit is contained in:
parent
554c9ad03c
commit
8c23462db5
1 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,6 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\Webhooks;
|
||||
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\WebhookEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
|
||||
return array(
|
||||
|
@ -18,8 +17,9 @@ return array(
|
|||
$endpoint = $container->get( 'api.endpoint.webhook' );
|
||||
assert( $endpoint instanceof WebhookEndpoint );
|
||||
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
if ( $state->current_state() >= State::STATE_ONBOARDED ) {
|
||||
$is_connected = $container->get( 'settings.flag.is-connected' );
|
||||
|
||||
if ( $is_connected ) {
|
||||
return $endpoint->list();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue