mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Display vaulting admin message only if state is onboarded
This commit is contained in:
parent
e3cb93f632
commit
ced4336c33
1 changed files with 15 additions and 2 deletions
|
@ -100,8 +100,7 @@ class SettingsRenderer {
|
|||
|
||||
$messages = array();
|
||||
|
||||
if ( $this->is_paypal_checkout_screen() && $this->paypal_vaulting_is_enabled()
|
||||
|| $this->is_paypal_checkout_screen() && $this->pay_later_messaging_is_enabled() ) {
|
||||
if ( $this->can_display_vaulting_admin_message() ) {
|
||||
|
||||
$vaulting_title = __( 'PayPal vaulting', 'woocommerce-paypal-payments' );
|
||||
$pay_later_messages_title = __( 'Pay Later Messaging', 'woocommerce-paypal-payments' );
|
||||
|
@ -552,4 +551,18 @@ class SettingsRenderer {
|
|||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if vaulting admin message can be displayed.
|
||||
*
|
||||
* @return bool Whether the message can be displayed or not.
|
||||
*/
|
||||
private function can_display_vaulting_admin_message(): bool {
|
||||
if ( State::STATE_ONBOARDED !== $this->state->current_state() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->is_paypal_checkout_screen() && $this->paypal_vaulting_is_enabled()
|
||||
|| $this->is_paypal_checkout_screen() && $this->pay_later_messaging_is_enabled();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue