mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix GooglePay availability notice when not onboarded.
This commit is contained in:
parent
b16e2571b1
commit
904beafa1f
2 changed files with 14 additions and 1 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue