Merge pull request #2646 from woocommerce/PCP-3720-fastlane-remove-privacy-setting

Fastlane remove Privacy setting (3720)
This commit is contained in:
Philipp Stracker 2024-09-27 11:40:52 +02:00 committed by GitHub
commit e5a848e757
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 29 deletions

View file

@ -83,7 +83,6 @@ return array(
->rule()
->condition_element( 'axo_enabled', '1' )
->action_visible( 'axo_main_notice' )
->action_visible( 'axo_privacy' )
->action_visible( 'axo_style_heading' )
->action_class( 'axo_enabled', 'active' )
->to_array(),
@ -131,22 +130,6 @@ return array(
'requirements' => array( 'dcc', 'axo' ),
'gateway' => array( 'dcc', 'axo' ),
),
'axo_privacy' => array(
'title' => __( 'Privacy', 'woocommerce-paypal-payments' ),
'type' => 'select',
'description' => __(
'PayPal powers this accelerated checkout solution from Fastlane. Since you\'ll share consumers\' email address with PayPal, please consult your legal advisors on the appropriate privacy setting for your business.',
'woocommerce-paypal-payments'
),
'classes' => array( 'ppcp-field-indent' ),
'class' => array(),
'input_class' => array( 'wc-enhanced-select' ),
'default' => 'yes',
'options' => PropertiesDictionary::privacy_options(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => array( 'dcc', 'axo' ),
'requirements' => array( 'axo' ),
),
'axo_style_heading' => array(
'heading' => __( 'Advanced Style Settings (optional)', 'woocommerce-paypal-payments' ),
'heading_html' => sprintf(

View file

@ -14,18 +14,6 @@ namespace WooCommerce\PayPalCommerce\Axo\Helper;
*/
class PropertiesDictionary {
/**
* Returns the list of possible privacy options.
*
* @return array
*/
public static function privacy_options(): array {
return array(
'yes' => __( 'Yes (Recommended)', 'woocommerce-paypal-payments' ),
'no' => __( 'No', 'woocommerce-paypal-payments' ),
);
}
/**
* Returns the list of possible cardholder name options.
*

View file

@ -34,6 +34,14 @@ class DCCGatewayConfiguration {
*/
private string $show_name_on_card;
/**
* Whether the Fastlane watermark should be hidden on the front-end.
*
* @var bool
*/
private bool $hide_fastlane_watermark = false;
/**
* Initializes the gateway details based on the provided Settings instance.
*
@ -57,6 +65,16 @@ class DCCGatewayConfiguration {
$this->show_name_on_card = in_array( $show_on_card, $valid_options, true )
? $show_on_card
: $valid_options[0];
/**
* Moved from setting "axo_privacy" to a hook-only filter:
* Changing this to true (and hiding the watermark) has potential legal
* consequences, and therefore is generally discouraged.
*/
$this->hide_fastlane_watermark = add_filter(
'woocommerce_paypal_payments_fastlane_watermark_enabled',
'__return_false'
);
}
/**
@ -76,4 +94,16 @@ class DCCGatewayConfiguration {
public function show_name_on_card() : string {
return $this->show_name_on_card;
}
/**
* Whether to display the watermark (text branding) for the Fastlane payment
* method in the front end.
*
* Note: This setting is planned but not implemented yet.
*
* @retun bool True means, the default watermark is displayed to customers.
*/
public function show_fastlane_watermark() : bool {
return ! $this->hide_fastlane_watermark;
}
}