mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Remove calls to enpoints if not onboarded
This commit is contained in:
parent
43a5b759f2
commit
cce8ee9d8d
3 changed files with 25 additions and 3 deletions
|
@ -9,6 +9,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\Webhooks;
|
||||
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface;
|
||||
use Exception;
|
||||
|
@ -126,8 +127,8 @@ class WebhookModule implements ModuleInterface {
|
|||
|
||||
try {
|
||||
$webhooks = $container->get( 'webhook.status.registered-webhooks' );
|
||||
|
||||
if ( empty( $webhooks ) ) {
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
if ( empty( $webhooks ) && $state->current_state() >= State::STATE_ONBOARDED ) {
|
||||
$registrar = $container->get( 'webhook.registrar' );
|
||||
assert( $registrar instanceof WebhookRegistrar );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue