Skip to content

Commit

Permalink
Use PayPal plugin state to returen is_complete logic
Browse files Browse the repository at this point in the history
  • Loading branch information
epeicher committed Jul 17, 2024
1 parent 851970f commit 0dd0d01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions includes/tasks/class-wc-calypso-task-get-paid-with-paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ public function get_content() {
*
*/
public function is_complete() {
$settings = get_option( 'woocommerce_paypal_settings', array() );

return ! empty( $settings ) && 'yes' == ( $settings['enabled'] );
$pp = \WooCommerce\PayPalCommerce\PPCP::container();
$state = $pp->get('onboarding.state');
$is_onboarded = ( $state->current_state() >= \WooCommerce\PayPalCommerce\Onboarding\State::STATE_ONBOARDED );

return $is_onboarded;
}

/**
Expand Down

0 comments on commit 0dd0d01

Please sign in to comment.