diff --git a/modules/ppcp-googlepay/src/Helper/ApmProductStatus.php b/modules/ppcp-googlepay/src/Helper/ApmProductStatus.php index 307fa8c14..ef93d8d54 100644 --- a/modules/ppcp-googlepay/src/Helper/ApmProductStatus.php +++ b/modules/ppcp-googlepay/src/Helper/ApmProductStatus.php @@ -83,7 +83,7 @@ class ApmProductStatus { * @return bool */ public function is_active() : bool { - if ( $this->onboarding_state->current_state() < State::STATE_ONBOARDED ) { + if ( ! $this->is_onboarded() ) { return false; } @@ -126,6 +126,15 @@ class ApmProductStatus { return $this->current_status; } + /** + * Returns if the seller is onboarded. + * + * @return bool + */ + public function is_onboarded(): bool { + return $this->onboarding_state->current_state() >= State::STATE_ONBOARDED; + } + /** * Returns if there was a request failure. * diff --git a/modules/ppcp-googlepay/src/Helper/AvailabilityNotice.php b/modules/ppcp-googlepay/src/Helper/AvailabilityNotice.php index 84f7c4abc..2f07d422a 100644 --- a/modules/ppcp-googlepay/src/Helper/AvailabilityNotice.php +++ b/modules/ppcp-googlepay/src/Helper/AvailabilityNotice.php @@ -39,6 +39,10 @@ class AvailabilityNotice { * @return void */ public function execute(): void { + if ( ! $this->product_status->is_onboarded() ) { + return; + } + if ( $this->product_status->has_request_failure() ) { $this->add_seller_status_failure_notice(); } else {