Skip to content

Commit 4b8fd57

Browse files
authored
Partially reverts #3688 (#3705)
* Support for both ECE settings key names * Fix isset call * Changelog and readme entries * Fix is array check * Replacing main implementation with the revert of the original change * Removing unnecessary changelog and readme entries
1 parent bd674e1 commit 4b8fd57

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

includes/payment-methods/class-wc-stripe-express-checkout-helper.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function is_account_creation_possible() {
8585
* @return string
8686
*/
8787
public function get_button_type() {
88-
return isset( $this->stripe_settings['express_checkout_button_type'] ) ? $this->stripe_settings['express_checkout_button_type'] : 'default';
88+
return isset( $this->stripe_settings['payment_request_button_type'] ) ? $this->stripe_settings['payment_request_button_type'] : 'default';
8989
}
9090

9191
/**
@@ -94,7 +94,7 @@ public function get_button_type() {
9494
* @return string
9595
*/
9696
public function get_button_theme() {
97-
return isset( $this->stripe_settings['express_checkout_button_theme'] ) ? $this->stripe_settings['express_checkout_button_theme'] : 'dark';
97+
return isset( $this->stripe_settings['payment_request_button_theme'] ) ? $this->stripe_settings['payment_request_button_theme'] : 'dark';
9898
}
9999

100100
/**
@@ -103,7 +103,7 @@ public function get_button_theme() {
103103
* @return string
104104
*/
105105
public function get_button_height() {
106-
$height = isset( $this->stripe_settings['express_checkout_button_size'] ) ? $this->stripe_settings['express_checkout_button_size'] : 'default';
106+
$height = isset( $this->stripe_settings['payment_request_button_size'] ) ? $this->stripe_settings['payment_request_button_size'] : 'default';
107107
if ( 'small' === $height ) {
108108
return '40';
109109
}
@@ -121,7 +121,7 @@ public function get_button_height() {
121121
* @return string
122122
*/
123123
public function get_button_radius() {
124-
$height = isset( $this->stripe_settings['express_checkout_button_size'] ) ? $this->stripe_settings['express_checkout_button_size'] : 'default';
124+
$height = isset( $this->stripe_settings['payment_request_button_size'] ) ? $this->stripe_settings['payment_request_button_size'] : 'default';
125125
if ( 'small' === $height ) {
126126
return '2';
127127
}
@@ -1329,18 +1329,18 @@ public function get_login_confirmation_settings() {
13291329
*/
13301330
public function get_button_locations() {
13311331
// If the locations have not been set return the default setting.
1332-
if ( ! isset( $this->stripe_settings['express_checkout_button_locations'] ) ) {
1332+
if ( ! isset( $this->stripe_settings['payment_request_button_locations'] ) ) {
13331333
return [ 'product', 'cart' ];
13341334
}
13351335

13361336
// If all locations are removed through the settings UI the location config will be set to
13371337
// an empty string "". If that's the case (and if the settings are not an array for any
13381338
// other reason) we should return an empty array.
1339-
if ( ! is_array( $this->stripe_settings['express_checkout_button_locations'] ) ) {
1339+
if ( ! is_array( $this->stripe_settings['payment_request_button_locations'] ) ) {
13401340
return [];
13411341
}
13421342

1343-
return $this->stripe_settings['express_checkout_button_locations'];
1343+
return $this->stripe_settings['payment_request_button_locations'];
13441344
}
13451345

13461346
/**
@@ -1351,7 +1351,7 @@ public function get_button_locations() {
13511351
* @return boolean
13521352
*/
13531353
public function is_express_checkout_enabled() {
1354-
return isset( $this->stripe_settings['express_checkout'] ) && 'yes' === $this->stripe_settings['express_checkout'];
1354+
return isset( $this->stripe_settings['payment_request'] ) && 'yes' === $this->stripe_settings['payment_request'];
13551355
}
13561356

13571357
/**

0 commit comments

Comments
 (0)