2020-07-02 09:37:07 +03:00
< ? php
2020-08-28 08:13:45 +03:00
/**
* Renders the settings of the Gateways .
*
2020-09-11 14:11:10 +03:00
* @ package WooCommerce\PayPalCommerce\WcGateway\Settings
2020-08-28 08:13:45 +03:00
*/
2020-07-02 12:48:40 +03:00
2020-07-02 09:37:07 +03:00
declare ( strict_types = 1 );
2020-09-11 14:11:10 +03:00
namespace WooCommerce\PayPalCommerce\WcGateway\Settings ;
2020-07-02 09:37:07 +03:00
2020-10-02 12:09:23 +03:00
use WooCommerce\PayPalCommerce\AdminNotices\Entity\Message ;
2020-09-11 14:11:10 +03:00
use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies ;
use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply ;
use WooCommerce\PayPalCommerce\Onboarding\State ;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway ;
2020-07-02 09:37:07 +03:00
use Psr\Container\ContainerInterface ;
2021-10-08 10:23:19 +03:00
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCProductStatus ;
2021-08-27 13:43:00 +03:00
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway ;
2021-10-08 10:23:19 +03:00
use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus ;
2020-07-02 09:37:07 +03:00
2020-08-28 08:13:45 +03:00
/**
* Class SettingsRenderer
*/
2020-08-27 11:08:36 +03:00
class SettingsRenderer {
2021-09-16 12:40:00 +03:00
use PageMatcherTrait ;
2021-06-17 11:51:43 +02:00
/**
* The Settings status helper .
*
* @ var SettingsStatus
*/
protected $settings_status ;
2020-08-28 08:13:45 +03:00
/**
* The settings .
*
* @ var ContainerInterface
*/
2020-08-27 11:08:36 +03:00
private $settings ;
2020-08-28 08:13:45 +03:00
/**
* The current onboarding state .
*
* @ var State
*/
2020-08-27 11:08:36 +03:00
private $state ;
2020-08-28 08:13:45 +03:00
/**
* The setting fields .
*
* @ var array
*/
2020-08-27 11:08:36 +03:00
private $fields ;
2020-08-28 08:13:45 +03:00
/**
* Helper to see if DCC gateway can be shown .
*
* @ var DccApplies
*/
private $dcc_applies ;
/**
* Helper to see if messages are supposed to show up .
*
* @ var MessagesApply
*/
private $messages_apply ;
2020-09-16 10:00:28 +03:00
/**
* The DCC Product Status .
*
2021-09-13 16:31:09 +02:00
* @ var DCCProductStatus
2020-09-16 10:00:28 +03:00
*/
private $dcc_product_status ;
2021-08-27 13:43:00 +03:00
/**
* ID of the current PPCP gateway settings page , or empty if it is not such page .
*
* @ var string
*/
protected $page_id ;
2020-08-28 08:13:45 +03:00
/**
* SettingsRenderer constructor .
*
* @ param ContainerInterface $settings The Settings .
2020-09-16 10:00:28 +03:00
* @ param State $state The current state .
* @ param array $fields The setting fields .
* @ param DccApplies $dcc_applies Whether DCC gateway can be shown .
2020-08-28 08:13:45 +03:00
* @ param MessagesApply $messages_apply Whether messages can be shown .
2021-09-13 16:31:09 +02:00
* @ param DCCProductStatus $dcc_product_status The product status .
2021-06-17 11:51:43 +02:00
* @ param SettingsStatus $settings_status The Settings status helper .
2021-08-27 13:43:00 +03:00
* @ param string $page_id ID of the current PPCP gateway settings page , or empty if it is not such page .
2020-08-28 08:13:45 +03:00
*/
2020-08-27 11:08:36 +03:00
public function __construct (
ContainerInterface $settings ,
State $state ,
array $fields ,
2020-08-28 08:13:45 +03:00
DccApplies $dcc_applies ,
2020-09-16 10:00:28 +03:00
MessagesApply $messages_apply ,
2021-10-01 10:50:24 +02:00
DCCProductStatus $dcc_product_status ,
2021-08-27 13:43:00 +03:00
SettingsStatus $settings_status ,
string $page_id
2020-08-27 11:08:36 +03:00
) {
2020-09-16 10:00:28 +03:00
$this -> settings = $settings ;
$this -> state = $state ;
$this -> fields = $fields ;
$this -> dcc_applies = $dcc_applies ;
$this -> messages_apply = $messages_apply ;
$this -> dcc_product_status = $dcc_product_status ;
2021-06-17 11:51:43 +02:00
$this -> settings_status = $settings_status ;
2021-08-27 13:43:00 +03:00
$this -> page_id = $page_id ;
2020-08-27 11:08:36 +03:00
}
2020-07-02 09:37:07 +03:00
2020-10-02 12:09:23 +03:00
/**
2021-03-25 16:53:16 +02:00
* Returns notices list .
2020-10-02 12:09:23 +03:00
*
* @ return array
*/
public function messages () : array {
2020-10-02 12:28:40 +03:00
2021-03-25 16:10:42 +02:00
$messages = array ();
2021-03-25 16:02:03 +02:00
2021-04-16 12:17:02 +02:00
if ( $this -> can_display_vaulting_admin_message () ) {
2021-03-30 16:49:31 +02:00
2021-03-25 16:31:20 +02:00
$vaulting_title = __ ( 'PayPal vaulting' , 'woocommerce-paypal-payments' );
$pay_later_messages_title = __ ( 'Pay Later Messaging' , 'woocommerce-paypal-payments' );
2021-03-25 16:16:28 +02:00
$enabled = $this -> paypal_vaulting_is_enabled () ? $vaulting_title : $pay_later_messages_title ;
2021-06-17 11:51:43 +02:00
$disabled = $this -> settings_status -> pay_later_messaging_is_enabled () ? $vaulting_title : $pay_later_messages_title ;
2021-03-25 16:02:03 +02:00
$pay_later_messages_or_vaulting_text = sprintf (
2021-03-25 16:31:20 +02:00
// translators: %1$s and %2$s is translated PayPal vaulting and Pay Later Messaging strings.
2021-03-25 16:02:03 +02:00
__ (
2021-04-16 12:33:06 +02:00
'You have %1$s enabled, that\'s why %2$s options are unavailable now. You cannot use both features at the same time.' ,
2021-03-25 16:10:42 +02:00
'woocommerce-paypal-payments'
2021-03-25 16:02:03 +02:00
),
$enabled ,
$disabled
);
2021-03-25 16:31:20 +02:00
$messages [] = new Message ( $pay_later_messages_or_vaulting_text , 'warning' );
2021-03-25 16:02:03 +02:00
}
2020-10-02 12:28:40 +03:00
//phpcs:disable WordPress.Security.NonceVerification.Recommended
//phpcs:disable WordPress.Security.NonceVerification.Missing
if ( ! isset ( $_GET [ 'ppcp-onboarding-error' ] ) || ! empty ( $_POST ) ) {
2021-03-25 16:02:03 +02:00
return $messages ;
2020-10-02 12:09:23 +03:00
}
2020-10-02 12:28:40 +03:00
//phpcs:enable WordPress.Security.NonceVerification.Recommended
//phpcs:enable WordPress.Security.NonceVerification.Missing
2020-10-02 12:09:23 +03:00
2021-03-25 16:02:03 +02:00
$messages [] = new Message (
2021-03-25 16:10:42 +02:00
__ (
'We could not complete the onboarding process. Some features, such as card processing, will not be available. To fix this, please try again.' ,
'woocommerce-paypal-payments'
),
'error' ,
false
2020-10-02 12:09:23 +03:00
);
2021-03-25 16:10:42 +02:00
2020-10-02 12:09:23 +03:00
return $messages ;
}
2021-03-25 16:02:03 +02:00
/**
2021-04-23 10:33:28 +02:00
* Check whether vaulting is enabled .
2021-03-25 16:10:42 +02:00
*
2021-03-25 16:02:03 +02:00
* @ return bool
*/
2021-03-25 16:10:42 +02:00
private function paypal_vaulting_is_enabled () : bool {
2021-04-23 10:33:28 +02:00
return $this -> settings -> has ( 'vault_enabled' ) && ( bool ) $this -> settings -> get ( 'vault_enabled' );
2021-03-25 16:10:42 +02:00
}
2021-03-25 16:02:03 +02:00
2021-03-30 16:49:31 +02:00
/**
* Check if current screen is PayPal checkout settings screen .
*
* @ return bool Whether is PayPal checkout screen or not .
*/
private function is_paypal_checkout_screen () : bool {
2021-08-27 13:43:00 +03:00
return PayPalGateway :: ID === $this -> page_id ;
2021-03-30 16:49:31 +02:00
}
2020-08-28 08:13:45 +03:00
/**
* Renders the multiselect field .
*
* @ param string $field The current field HTML .
* @ param string $key The current key .
* @ param array $config The configuration array .
* @ param string $value The current value .
*
* @ return string
*/
public function render_multiselect ( $field , $key , $config , $value ) : string {
2020-07-02 12:48:40 +03:00
2020-08-28 08:13:45 +03:00
if ( 'ppcp-multiselect' !== $config [ 'type' ] ) {
2020-08-27 11:08:36 +03:00
return $field ;
}
2020-07-02 09:37:07 +03:00
2020-08-27 11:08:36 +03:00
$options = array ();
2020-08-28 08:13:45 +03:00
foreach ( $config [ 'options' ] as $option_key => $option_value ) {
$selected = ( in_array ( $option_key , $value , true ) ) ? 'selected="selected"' : '' ;
2020-07-02 09:37:07 +03:00
2020-08-28 08:13:45 +03:00
$options [] = '<option value="' . esc_attr ( $option_key ) . '" ' . $selected . '>' .
esc_html ( $option_value ) .
2020-08-27 11:08:36 +03:00
'</option>' ;
}
2020-07-02 09:37:07 +03:00
2020-08-27 11:08:36 +03:00
$html = sprintf (
' < select
2020-07-02 09:37:07 +03:00
multiple
class = " %s "
name = " %s "
>% s </ select > ' ,
2020-10-15 15:42:02 -03:00
esc_attr ( implode ( ' ' , isset ( $config [ 'input_class' ] ) ? $config [ 'input_class' ] : array () ) ),
2020-08-27 11:08:36 +03:00
esc_attr ( $key ) . '[]' ,
implode ( '' , $options )
);
2020-07-02 09:37:07 +03:00
2020-08-27 11:08:36 +03:00
return $html ;
}
2020-07-28 12:18:57 +03:00
2020-08-28 08:13:45 +03:00
/**
* Renders the password input field .
*
* @ param string $field The current field HTML .
* @ param string $key The current key .
* @ param array $config The configuration array .
* @ param string $value The current value .
*
* @ return string
*/
public function render_password ( $field , $key , $config , $value ) : string {
2020-07-28 12:18:57 +03:00
2020-08-28 08:13:45 +03:00
if ( 'ppcp-password' !== $config [ 'type' ] ) {
2020-08-27 11:08:36 +03:00
return $field ;
}
2020-07-28 12:18:57 +03:00
2020-08-27 11:08:36 +03:00
$html = sprintf (
' < input
2020-07-28 12:18:57 +03:00
type = " password "
autocomplete = " new-password "
class = " %s "
name = " %s "
value = " %s "
> ' ,
2020-08-27 11:08:36 +03:00
esc_attr ( implode ( ' ' , $config [ 'class' ] ) ),
esc_attr ( $key ),
esc_attr ( $value )
);
2020-07-28 12:18:57 +03:00
2020-08-27 11:08:36 +03:00
return $html ;
}
2020-07-28 12:23:50 +03:00
2020-08-28 08:13:45 +03:00
/**
* Renders the text input field .
*
* @ param string $field The current field HTML .
* @ param string $key The current key .
* @ param array $config The configuration array .
* @ param string $value The current value .
*
* @ return string
*/
public function render_text_input ( $field , $key , $config , $value ) : string {
if ( 'ppcp-text-input' !== $config [ 'type' ] ) {
2020-08-27 11:08:36 +03:00
return $field ;
}
2020-07-28 12:23:50 +03:00
2020-08-27 11:08:36 +03:00
$html = sprintf (
' < input
2020-07-28 12:23:50 +03:00
type = " text "
autocomplete = " off "
class = " %s "
name = " %s "
value = " %s "
> ' ,
2020-08-27 11:08:36 +03:00
esc_attr ( implode ( ' ' , $config [ 'class' ] ) ),
esc_attr ( $key ),
esc_attr ( $value )
);
2020-07-28 12:23:50 +03:00
2020-08-27 11:08:36 +03:00
return $html ;
}
2020-08-14 10:09:11 +03:00
2020-08-28 08:13:45 +03:00
/**
* Renders the heading field .
*
* @ param string $field The current field HTML .
* @ param string $key The current key .
* @ param array $config The configuration array .
* @ param string $value The current value .
*
* @ return string
*/
public function render_heading ( $field , $key , $config , $value ) : string {
2020-08-14 10:09:11 +03:00
2020-08-28 08:13:45 +03:00
if ( 'ppcp-heading' !== $config [ 'type' ] ) {
2020-08-27 11:08:36 +03:00
return $field ;
}
2020-08-14 10:09:11 +03:00
2020-08-27 11:08:36 +03:00
$html = sprintf (
2020-10-15 15:42:02 -03:00
'<h3 class="wc-settings-sub-title %s">%s</h3>' ,
2020-08-27 11:08:36 +03:00
esc_attr ( implode ( ' ' , $config [ 'class' ] ) ),
esc_html ( $config [ 'heading' ] )
);
2020-08-14 10:09:11 +03:00
2020-08-27 11:08:36 +03:00
return $html ;
}
2020-07-02 09:37:07 +03:00
2021-09-16 12:41:08 +03:00
/**
* Renders the table row .
*
* @ param array $data Values of the row cells .
* @ param string $tag HTML tag ( 'td' , 'th' ) .
* @ return string
*/
public function render_table_row ( array $data , string $tag = 'td' ) : string {
$cells = array_map (
function ( $value ) use ( $tag ) : string {
return " < $tag > " . ( string ) $value . " </ $tag > " ;
},
$data
);
return '<tr>' . implode ( $cells ) . '</tr>' ;
}
/**
* Renders the table field .
*
* @ param string $field The current field HTML .
* @ param string $key The key .
* @ param array $config The configuration of the field .
* @ param array $value The current value .
*
* @ return string HTML .
*/
public function render_table ( $field , $key , $config , $value ) : string {
if ( 'ppcp-table' !== $config [ 'type' ] ) {
return $field ;
}
$data = $value [ 'data' ];
if ( empty ( $data ) ) {
$empty_placeholder = $value [ 'empty_placeholder' ] ? ? ( $config [ 'empty_placeholder' ] ? ? null );
if ( $empty_placeholder ) {
return $empty_placeholder ;
}
}
$header_row_html = $this -> render_table_row ( $value [ 'headers' ], 'th' );
$data_rows_html = implode (
array_map (
array ( $this , 'render_table_row' ),
$data
)
);
return " <table>
$header_row_html
$data_rows_html
</ table > " ;
}
2020-08-28 08:13:45 +03:00
/**
* Renders the settings .
*/
2020-09-02 09:56:04 +03:00
public function render () {
2020-08-27 11:08:36 +03:00
2021-08-27 13:43:00 +03:00
$is_dcc = CreditCardGateway :: ID === $this -> page_id ;
2020-10-02 12:28:40 +03:00
//phpcs:enable WordPress.Security.NonceVerification.Recommended
//phpcs:enable WordPress.Security.NonceVerification.Missing
$nonce = wp_create_nonce ( SettingsListener :: NONCE );
2020-08-27 11:08:36 +03:00
?>
< input type = " hidden " name = " ppcp-nonce " value = " <?php echo esc_attr( $nonce ); ?> " >
< ? php
foreach ( $this -> fields as $field => $config ) :
2020-08-31 09:42:39 +03:00
if ( ! in_array ( $this -> state -> current_state (), $config [ 'screens' ], true ) ) {
2020-08-27 11:08:36 +03:00
continue ;
}
2021-09-16 12:40:00 +03:00
if ( ! $this -> field_matches_page ( $config , $this -> page_id ) ) {
2020-08-27 11:08:36 +03:00
continue ;
}
if (
in_array ( 'dcc' , $config [ 'requirements' ], true )
2020-09-01 09:00:45 +03:00
&& ! $this -> dcc_applies -> for_country_currency ()
2020-08-27 11:08:36 +03:00
) {
continue ;
}
2020-09-16 10:00:28 +03:00
if (
in_array ( 'dcc' , $config [ 'requirements' ], true )
&& ! $this -> dcc_product_status -> dcc_is_active ()
) {
continue ;
}
2020-08-27 11:08:36 +03:00
if (
in_array ( 'messages' , $config [ 'requirements' ], true )
2020-08-31 11:12:46 +03:00
&& ! $this -> messages_apply -> for_country ()
2020-08-27 11:08:36 +03:00
) {
continue ;
}
2021-09-16 12:42:30 +03:00
$value = $this -> settings -> has ( $field ) ? $this -> settings -> get ( $field ) : ( isset ( $config [ 'value' ] ) ? $config [ 'value' ]() : null );
2020-08-27 11:08:36 +03:00
$key = 'ppcp[' . $field . ']' ;
$id = 'ppcp-' . $field ;
$config [ 'id' ] = $id ;
2020-08-28 08:13:45 +03:00
$colspan = 'ppcp-heading' !== $config [ 'type' ] ? 1 : 2 ;
2020-09-25 11:58:30 +03:00
$classes = isset ( $config [ 'classes' ] ) ? $config [ 'classes' ] : array ();
2020-10-15 15:42:02 -03:00
$classes [] = sprintf ( 'ppcp-settings-field-%s' , str_replace ( 'ppcp-' , '' , $config [ 'type' ] ) );
$description = isset ( $config [ 'description' ] ) ? $config [ 'description' ] : '' ;
unset ( $config [ 'description' ] );
2020-08-27 11:08:36 +03:00
?>
2020-09-25 11:58:30 +03:00
< tr valign = " top " id = " <?php echo esc_attr( 'field-' . $field ); ?> " class = " <?php echo esc_attr( implode( ' ', $classes ) ); ?> " >
2020-08-28 08:13:45 +03:00
< ? php if ( 'ppcp-heading' !== $config [ 'type' ] ) : ?>
2020-10-15 15:42:02 -03:00
< th scope = " row " >
2020-08-27 11:08:36 +03:00
< label
for = " <?php echo esc_attr( $id ); ?> "
>< ? php echo esc_html ( $config [ 'title' ] ); ?> </label>
< ? php if ( isset ( $config [ 'desc_tip' ] ) && $config [ 'desc_tip' ] ) : ?>
< span
class = " woocommerce-help-tip "
2020-10-15 15:42:02 -03:00
data - tip = " <?php echo esc_attr( $description ); ?> "
2020-08-27 11:08:36 +03:00
></ span >
< ? php
2020-10-15 15:42:02 -03:00
$description = '' ;
2020-08-27 11:08:36 +03:00
endif ;
?>
</ th >
< ? php endif ; ?>
2021-04-16 11:47:26 +02:00
< td colspan = " <?php echo (int) $colspan ; ?> " >
2020-10-15 15:42:02 -03:00
< ? php
'ppcp-text' === $config [ 'type' ] ?
$this -> render_text ( $config )
: woocommerce_form_field ( $key , $config , $value );
?>
< ? php if ( $description ) : ?>
< p class = " <?php echo 'ppcp-heading' === $config['type'] ? '' : 'description'; ?> " >< ? php echo wp_kses_post ( $description ); ?> </p>
< ? php endif ; ?>
2021-04-16 11:47:26 +02:00
</ td >
2020-08-27 11:08:36 +03:00
</ tr >
< ? php
endforeach ;
2020-09-03 08:43:25 +03:00
if ( $is_dcc ) {
if ( $this -> dcc_applies -> for_country_currency () ) {
if ( State :: STATE_ONBOARDED > $this -> state -> current_state () ) {
$this -> render_dcc_onboarding_info ();
2020-09-16 10:00:28 +03:00
} elseif ( ! $this -> dcc_product_status -> dcc_is_active () ) {
$this -> render_dcc_not_active_yet ();
2020-09-03 08:43:25 +03:00
}
} else {
$this -> render_dcc_does_not_apply_info ();
}
}
2020-08-27 11:08:36 +03:00
}
2020-07-02 12:48:40 +03:00
2020-08-28 08:13:45 +03:00
/**
* Renders the ppcp - text field given a configuration .
*
* @ param array $config The configuration array .
*/
private function render_text ( array $config ) {
2020-08-27 11:08:36 +03:00
echo wp_kses_post ( $config [ 'text' ] );
if ( isset ( $config [ 'hidden' ] ) ) {
$value = $this -> settings -> has ( $config [ 'hidden' ] ) ?
( string ) $this -> settings -> get ( $config [ 'hidden' ] )
: '' ;
echo ' < input
2020-08-21 09:41:12 +03:00
type = " hidden "
2020-08-27 11:08:36 +03:00
name = " ppcp[' . esc_attr( $config['hidden'] ) . '] "
value = " ' . esc_attr( $value ) . ' "
2020-08-21 09:41:12 +03:00
> ' ;
2020-08-27 11:08:36 +03:00
}
}
2020-09-03 08:43:25 +03:00
2020-09-16 10:00:28 +03:00
/**
* Renders the information that the PayPal account can not yet process DCC .
*/
private function render_dcc_not_active_yet () {
?>
< tr >
2020-10-08 20:03:07 -03:00
< th >< ? php esc_html_e ( 'Onboarding' , 'woocommerce-paypal-payments' ); ?> </th>
2020-09-16 10:00:28 +03:00
< td class = " notice notice-error " >
< p >
< ? php
esc_html_e (
'Credit Card processing for your account has not yet been activated by PayPal. If your account is new, this can take some days. Otherwise, please get in contact with PayPal.' ,
2020-10-08 20:03:07 -03:00
'woocommerce-paypal-payments'
2020-09-16 10:00:28 +03:00
);
?>
</ p >
</ td >
</ tr >
< ? php
}
2020-09-03 08:43:25 +03:00
/**
* Renders the DCC onboarding info .
*/
private function render_dcc_onboarding_info () {
?>
< tr >
2020-10-08 20:03:07 -03:00
< th >< ? php esc_html_e ( 'Onboarding' , 'woocommerce-paypal-payments' ); ?> </th>
2020-09-03 08:43:25 +03:00
< td class = " notice notice-error " >
< p >
< ? php
esc_html_e (
'You need to complete your onboarding, before you can use the PayPal Card Processing option.' ,
2020-10-08 20:03:07 -03:00
'woocommerce-paypal-payments'
2020-09-03 08:43:25 +03:00
);
?>
< a
href = " <?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' ) ); ?> "
>
2020-10-08 20:03:07 -03:00
< ? php esc_html_e ( 'Click here to complete your onboarding.' , 'woocommerce-paypal-payments' ); ?>
2020-09-03 08:43:25 +03:00
</ a >
</ p >
</ td >
</ tr >
< ? php
}
/**
* Renders the info , that DCC is not available in the merchant ' s country .
*/
private function render_dcc_does_not_apply_info () {
?>
< tr >
2020-10-08 20:03:07 -03:00
< th >< ? php esc_html_e ( 'Card Processing not available' , 'woocommerce-paypal-payments' ); ?> </th>
2020-09-03 08:43:25 +03:00
< td class = " notice notice-error " >
< p >
< ? php
esc_html_e (
2021-04-15 14:52:26 +02:00
'Unfortunately, the card processing option is not yet available in your country.' ,
2020-10-08 20:03:07 -03:00
'woocommerce-paypal-payments'
2020-09-03 08:43:25 +03:00
);
?>
2022-01-06 16:02:23 +02:00
< a href = " https://developer.paypal.com/docs/checkout/advanced/currency-availability-advanced-cards/ " >
< ? php
esc_html_e (
'Advanced credit and debit country and currency availability.' ,
'woocommerce-paypal-payments'
);
?>
</ a >
2020-09-03 08:43:25 +03:00
</ p >
</ td >
</ tr >
< ? php
}
2021-04-16 12:17:02 +02:00
/**
* 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 ;
}
2021-08-27 13:43:25 +03:00
return $this -> is_paypal_checkout_screen ()
&& ( $this -> paypal_vaulting_is_enabled () || $this -> settings_status -> pay_later_messaging_is_enabled () );
2021-04-16 12:17:02 +02:00
}
2020-08-27 11:08:36 +03:00
}
2021-07-29 12:56:52 +02:00