Completed
Pull Request — master (#1267)
by
unknown
01:46
created
tests/phpunit/setup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,4 +2,4 @@
 block discarded – undo
2 2
 /**
3 3
  * Set up shared by all tests.
4 4
  */
5
-update_option( 'woocommerce_default_country', 'US:CA' );
5
+update_option('woocommerce_default_country', 'US:CA');
Please login to merge, or discard this patch.
woocommerce-gateway-stripe.php 1 patch
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -15,20 +15,20 @@  discard block
 block discarded – undo
15 15
  *
16 16
  */
17 17
 
18
-if ( ! defined( 'ABSPATH' ) ) {
18
+if ( ! defined('ABSPATH')) {
19 19
 	exit;
20 20
 }
21 21
 
22 22
 /**
23 23
  * Required minimums and constants
24 24
  */
25
-define( 'WC_STRIPE_VERSION', '4.5.0' );
26
-define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
27
-define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
28
-define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.0' );
29
-define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
30
-define( 'WC_STRIPE_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
31
-define( 'WC_STRIPE_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
25
+define('WC_STRIPE_VERSION', '4.5.0');
26
+define('WC_STRIPE_MIN_PHP_VER', '5.6.0');
27
+define('WC_STRIPE_MIN_WC_VER', '3.0');
28
+define('WC_STRIPE_FUTURE_MIN_WC_VER', '3.0');
29
+define('WC_STRIPE_MAIN_FILE', __FILE__);
30
+define('WC_STRIPE_PLUGIN_URL', untrailingslashit(plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__))));
31
+define('WC_STRIPE_PLUGIN_PATH', untrailingslashit(plugin_dir_path(__FILE__)));
32 32
 
33 33
 // phpcs:disable WordPress.Files.FileName
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  */
41 41
 function woocommerce_stripe_missing_wc_notice() {
42 42
 	/* translators: 1. URL link. */
43
-	echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-stripe' ), '<a href="https://woocommerce.com/" target="_blank">WooCommerce</a>' ) . '</strong></p></div>';
43
+	echo '<div class="error"><p><strong>' . sprintf(esc_html__('Stripe requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-stripe'), '<a href="https://woocommerce.com/" target="_blank">WooCommerce</a>') . '</strong></p></div>';
44 44
 }
45 45
 
46 46
 /**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function woocommerce_stripe_wc_not_supported() {
53 53
 	/* translators: $1. Minimum WooCommerce version. $2. Current WooCommerce version. */
54
-	echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce %1$s or greater to be installed and active. WooCommerce %2$s is no longer supported.', 'woocommerce-gateway-stripe' ), WC_STRIPE_MIN_WC_VER, WC_VERSION ) . '</strong></p></div>';
54
+	echo '<div class="error"><p><strong>' . sprintf(esc_html__('Stripe requires WooCommerce %1$s or greater to be installed and active. WooCommerce %2$s is no longer supported.', 'woocommerce-gateway-stripe'), WC_STRIPE_MIN_WC_VER, WC_VERSION) . '</strong></p></div>';
55 55
 }
56 56
 
57 57
 /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * @return string
62 62
  */
63 63
 function woocommerce_stripe_wc_country_not_supported() {
64
-	echo '<div class="error"><p><strong>' . __( 'Stripe is not available in your store\'s country and will not be available for buyers to choose during checkout.', 'woocommerce-gateway-stripe' ) . '</strong></p></div>';
64
+	echo '<div class="error"><p><strong>' . __('Stripe is not available in your store\'s country and will not be available for buyers to choose during checkout.', 'woocommerce-gateway-stripe') . '</strong></p></div>';
65 65
 }
66 66
 
67 67
 /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
  * @return bool
73 73
  */
74 74
 function woocommerce_stripe_wc_country_is_supported_country() {
75
-	$wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 );
75
+	$wc_default_country = substr(get_option('woocommerce_default_country'), 0, 2);
76 76
 
77 77
 	$supported_countries = apply_filters(
78 78
 		'wc_stripe_supported_countries',
@@ -118,30 +118,30 @@  discard block
 block discarded – undo
118 118
 		)
119 119
 	);
120 120
 
121
-	return in_array( $wc_default_country, $supported_countries );
121
+	return in_array($wc_default_country, $supported_countries);
122 122
 }
123 123
 
124
-add_action( 'plugins_loaded', 'woocommerce_gateway_stripe_init' );
124
+add_action('plugins_loaded', 'woocommerce_gateway_stripe_init');
125 125
 
126 126
 function woocommerce_gateway_stripe_init() {
127
-	load_plugin_textdomain( 'woocommerce-gateway-stripe', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
127
+	load_plugin_textdomain('woocommerce-gateway-stripe', false, plugin_basename(dirname(__FILE__)) . '/languages');
128 128
 
129
-	if ( ! class_exists( 'WooCommerce' ) ) {
130
-		add_action( 'admin_notices', 'woocommerce_stripe_missing_wc_notice' );
129
+	if ( ! class_exists('WooCommerce')) {
130
+		add_action('admin_notices', 'woocommerce_stripe_missing_wc_notice');
131 131
 		return;
132 132
 	}
133 133
 
134
-	if ( version_compare( WC_VERSION, WC_STRIPE_MIN_WC_VER, '<' ) ) {
135
-		add_action( 'admin_notices', 'woocommerce_stripe_wc_not_supported' );
134
+	if (version_compare(WC_VERSION, WC_STRIPE_MIN_WC_VER, '<')) {
135
+		add_action('admin_notices', 'woocommerce_stripe_wc_not_supported');
136 136
 		return;
137 137
 	}
138 138
 
139
-	if ( ! woocommerce_stripe_wc_country_is_supported_country() ) {
140
-		add_action( 'admin_notices', 'woocommerce_stripe_wc_country_not_supported' );
139
+	if ( ! woocommerce_stripe_wc_country_is_supported_country()) {
140
+		add_action('admin_notices', 'woocommerce_stripe_wc_country_not_supported');
141 141
 		return;
142 142
 	}
143 143
 
144
-	if ( ! class_exists( 'WC_Stripe' ) ) :
144
+	if ( ! class_exists('WC_Stripe')) :
145 145
 
146 146
 		class WC_Stripe {
147 147
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			 * @return Singleton The *Singleton* instance.
157 157
 			 */
158 158
 			public static function get_instance() {
159
-				if ( null === self::$instance ) {
159
+				if (null === self::$instance) {
160 160
 					self::$instance = new self();
161 161
 				}
162 162
 				return self::$instance;
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
 			 * *Singleton* via the `new` operator from outside of this class.
198 198
 			 */
199 199
 			private function __construct() {
200
-				add_action( 'admin_init', array( $this, 'install' ) );
200
+				add_action('admin_init', array($this, 'install'));
201 201
 
202 202
 				$this->init();
203 203
 
204 204
 				$this->api     = new WC_Stripe_Connect_API();
205
-				$this->connect = new WC_Stripe_Connect( $this->api );
205
+				$this->connect = new WC_Stripe_Connect($this->api);
206 206
 
207
-				add_action( 'rest_api_init', array( $this, 'register_connect_routes' ) );
208
-				add_action( 'admin_enqueue_scripts', array( $this->connect, 'maybe_connect_oauth' ) );
207
+				add_action('rest_api_init', array($this, 'register_connect_routes'));
208
+				add_action('admin_enqueue_scripts', array($this->connect, 'maybe_connect_oauth'));
209 209
 			}
210 210
 
211 211
 			/**
@@ -215,55 +215,55 @@  discard block
 block discarded – undo
215 215
 			 * @version 4.0.0
216 216
 			 */
217 217
 			public function init() {
218
-				if ( is_admin() ) {
219
-					require_once dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-privacy.php';
218
+				if (is_admin()) {
219
+					require_once dirname(__FILE__) . '/includes/admin/class-wc-stripe-privacy.php';
220 220
 				}
221 221
 
222
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-exception.php';
223
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php';
224
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php';
225
-				include_once dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php';
226
-				require_once dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php';
227
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php';
228
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php';
229
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-apple-pay-registration.php';
230
-				require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-pre-orders-compat.php';
231
-				require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php';
232
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php';
233
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php';
234
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php';
235
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php';
236
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php';
237
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php';
238
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php';
239
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php';
240
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php';
241
-				require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php';
242
-				require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php';
243
-				require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php';
244
-				require_once dirname( __FILE__ ) . '/includes/connect/class-wc-stripe-connect.php';
245
-				require_once dirname( __FILE__ ) . '/includes/connect/class-wc-stripe-connect-api.php';
246
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php';
247
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php';
248
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php';
249
-				require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-intent-controller.php';
250
-
251
-				if ( is_admin() ) {
252
-					require_once dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-admin-notices.php';
222
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-exception.php';
223
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-logger.php';
224
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-helper.php';
225
+				include_once dirname(__FILE__) . '/includes/class-wc-stripe-api.php';
226
+				require_once dirname(__FILE__) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php';
227
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-webhook-handler.php';
228
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-sepa-payment-token.php';
229
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-apple-pay-registration.php';
230
+				require_once dirname(__FILE__) . '/includes/compat/class-wc-stripe-pre-orders-compat.php';
231
+				require_once dirname(__FILE__) . '/includes/class-wc-gateway-stripe.php';
232
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php';
233
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php';
234
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php';
235
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php';
236
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php';
237
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php';
238
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php';
239
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php';
240
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php';
241
+				require_once dirname(__FILE__) . '/includes/payment-methods/class-wc-stripe-payment-request.php';
242
+				require_once dirname(__FILE__) . '/includes/compat/class-wc-stripe-subs-compat.php';
243
+				require_once dirname(__FILE__) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php';
244
+				require_once dirname(__FILE__) . '/includes/connect/class-wc-stripe-connect.php';
245
+				require_once dirname(__FILE__) . '/includes/connect/class-wc-stripe-connect-api.php';
246
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-order-handler.php';
247
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-payment-tokens.php';
248
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-customer.php';
249
+				require_once dirname(__FILE__) . '/includes/class-wc-stripe-intent-controller.php';
250
+
251
+				if (is_admin()) {
252
+					require_once dirname(__FILE__) . '/includes/admin/class-wc-stripe-admin-notices.php';
253 253
 				}
254 254
 
255 255
 				// REMOVE IN THE FUTURE.
256
-				require_once dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php';
256
+				require_once dirname(__FILE__) . '/includes/deprecated/class-wc-stripe-apple-pay.php';
257 257
 
258
-				add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) );
259
-				add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
260
-				add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
258
+				add_filter('woocommerce_payment_gateways', array($this, 'add_gateways'));
259
+				add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
260
+				add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
261 261
 
262 262
 				// Modify emails emails.
263
-				add_filter( 'woocommerce_email_classes', array( $this, 'add_emails' ), 20 );
263
+				add_filter('woocommerce_email_classes', array($this, 'add_emails'), 20);
264 264
 
265
-				if ( version_compare( WC_VERSION, '3.4', '<' ) ) {
266
-					add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) );
265
+				if (version_compare(WC_VERSION, '3.4', '<')) {
266
+					add_filter('woocommerce_get_sections_checkout', array($this, 'filter_gateway_order_admin'));
267 267
 				}
268 268
 			}
269 269
 
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 			 * @version 4.0.0
275 275
 			 */
276 276
 			public function update_plugin_version() {
277
-				delete_option( 'wc_stripe_version' );
278
-				update_option( 'wc_stripe_version', WC_STRIPE_VERSION );
277
+				delete_option('wc_stripe_version');
278
+				update_option('wc_stripe_version', WC_STRIPE_VERSION);
279 279
 			}
280 280
 
281 281
 			/**
@@ -285,15 +285,15 @@  discard block
 block discarded – undo
285 285
 			 * @version 3.1.0
286 286
 			 */
287 287
 			public function install() {
288
-				if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
288
+				if ( ! is_plugin_active(plugin_basename(__FILE__))) {
289 289
 					return;
290 290
 				}
291 291
 
292
-				if ( ! defined( 'IFRAME_REQUEST' ) && ( WC_STRIPE_VERSION !== get_option( 'wc_stripe_version' ) ) ) {
293
-					do_action( 'woocommerce_stripe_updated' );
292
+				if ( ! defined('IFRAME_REQUEST') && (WC_STRIPE_VERSION !== get_option('wc_stripe_version'))) {
293
+					do_action('woocommerce_stripe_updated');
294 294
 
295
-					if ( ! defined( 'WC_STRIPE_INSTALLING' ) ) {
296
-						define( 'WC_STRIPE_INSTALLING', true );
295
+					if ( ! defined('WC_STRIPE_INSTALLING')) {
296
+						define('WC_STRIPE_INSTALLING', true);
297 297
 					}
298 298
 
299 299
 					$this->update_plugin_version();
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
 			 * @since 1.0.0
307 307
 			 * @version 4.0.0
308 308
 			 */
309
-			public function plugin_action_links( $links ) {
309
+			public function plugin_action_links($links) {
310 310
 				$plugin_links = array(
311
-					'<a href="admin.php?page=wc-settings&tab=checkout&section=stripe">' . esc_html__( 'Settings', 'woocommerce-gateway-stripe' ) . '</a>',
311
+					'<a href="admin.php?page=wc-settings&tab=checkout&section=stripe">' . esc_html__('Settings', 'woocommerce-gateway-stripe') . '</a>',
312 312
 				);
313
-				return array_merge( $plugin_links, $links );
313
+				return array_merge($plugin_links, $links);
314 314
 			}
315 315
 
316 316
 			/**
@@ -321,13 +321,13 @@  discard block
 block discarded – undo
321 321
 			 * @param  string $file  Name of current file.
322 322
 			 * @return array  $links Update list of plugin links.
323 323
 			 */
324
-			public function plugin_row_meta( $links, $file ) {
325
-				if ( plugin_basename( __FILE__ ) === $file ) {
324
+			public function plugin_row_meta($links, $file) {
325
+				if (plugin_basename(__FILE__) === $file) {
326 326
 					$row_meta = array(
327
-						'docs'    => '<a href="' . esc_url( apply_filters( 'woocommerce_gateway_stripe_docs_url', 'https://docs.woocommerce.com/document/stripe/' ) ) . '" title="' . esc_attr( __( 'View Documentation', 'woocommerce-gateway-stripe' ) ) . '">' . __( 'Docs', 'woocommerce-gateway-stripe' ) . '</a>',
328
-						'support' => '<a href="' . esc_url( apply_filters( 'woocommerce_gateway_stripe_support_url', 'https://woocommerce.com/my-account/create-a-ticket?select=18627' ) ) . '" title="' . esc_attr( __( 'Open a support request at WooCommerce.com', 'woocommerce-gateway-stripe' ) ) . '">' . __( 'Support', 'woocommerce-gateway-stripe' ) . '</a>',
327
+						'docs'    => '<a href="' . esc_url(apply_filters('woocommerce_gateway_stripe_docs_url', 'https://docs.woocommerce.com/document/stripe/')) . '" title="' . esc_attr(__('View Documentation', 'woocommerce-gateway-stripe')) . '">' . __('Docs', 'woocommerce-gateway-stripe') . '</a>',
328
+						'support' => '<a href="' . esc_url(apply_filters('woocommerce_gateway_stripe_support_url', 'https://woocommerce.com/my-account/create-a-ticket?select=18627')) . '" title="' . esc_attr(__('Open a support request at WooCommerce.com', 'woocommerce-gateway-stripe')) . '">' . __('Support', 'woocommerce-gateway-stripe') . '</a>',
329 329
 					);
330
-					return array_merge( $links, $row_meta );
330
+					return array_merge($links, $row_meta);
331 331
 				}
332 332
 				return (array) $links;
333 333
 			}
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 			 * @since 1.0.0
339 339
 			 * @version 4.0.0
340 340
 			 */
341
-			public function add_gateways( $methods ) {
342
-				if ( class_exists( 'WC_Subscriptions_Order' ) && function_exists( 'wcs_create_renewal_order' ) ) {
341
+			public function add_gateways($methods) {
342
+				if (class_exists('WC_Subscriptions_Order') && function_exists('wcs_create_renewal_order')) {
343 343
 					$methods[] = 'WC_Stripe_Subs_Compat';
344 344
 					$methods[] = 'WC_Stripe_Sepa_Subs_Compat';
345 345
 				} else {
@@ -365,28 +365,28 @@  discard block
 block discarded – undo
365 365
 			 * @since 4.0.0
366 366
 			 * @version 4.0.0
367 367
 			 */
368
-			public function filter_gateway_order_admin( $sections ) {
369
-				unset( $sections['stripe'] );
370
-				unset( $sections['stripe_bancontact'] );
371
-				unset( $sections['stripe_sofort'] );
372
-				unset( $sections['stripe_giropay'] );
373
-				unset( $sections['stripe_eps'] );
374
-				unset( $sections['stripe_ideal'] );
375
-				unset( $sections['stripe_p24'] );
376
-				unset( $sections['stripe_alipay'] );
377
-				unset( $sections['stripe_sepa'] );
378
-				unset( $sections['stripe_multibanco'] );
368
+			public function filter_gateway_order_admin($sections) {
369
+				unset($sections['stripe']);
370
+				unset($sections['stripe_bancontact']);
371
+				unset($sections['stripe_sofort']);
372
+				unset($sections['stripe_giropay']);
373
+				unset($sections['stripe_eps']);
374
+				unset($sections['stripe_ideal']);
375
+				unset($sections['stripe_p24']);
376
+				unset($sections['stripe_alipay']);
377
+				unset($sections['stripe_sepa']);
378
+				unset($sections['stripe_multibanco']);
379 379
 
380 380
 				$sections['stripe']            = 'Stripe';
381
-				$sections['stripe_bancontact'] = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' );
382
-				$sections['stripe_sofort']     = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' );
383
-				$sections['stripe_giropay']    = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' );
384
-				$sections['stripe_eps']        = __( 'Stripe EPS', 'woocommerce-gateway-stripe' );
385
-				$sections['stripe_ideal']      = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' );
386
-				$sections['stripe_p24']        = __( 'Stripe P24', 'woocommerce-gateway-stripe' );
387
-				$sections['stripe_alipay']     = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' );
388
-				$sections['stripe_sepa']       = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' );
389
-				$sections['stripe_multibanco'] = __( 'Stripe Multibanco', 'woocommerce-gateway-stripe' );
381
+				$sections['stripe_bancontact'] = __('Stripe Bancontact', 'woocommerce-gateway-stripe');
382
+				$sections['stripe_sofort']     = __('Stripe SOFORT', 'woocommerce-gateway-stripe');
383
+				$sections['stripe_giropay']    = __('Stripe Giropay', 'woocommerce-gateway-stripe');
384
+				$sections['stripe_eps']        = __('Stripe EPS', 'woocommerce-gateway-stripe');
385
+				$sections['stripe_ideal']      = __('Stripe iDeal', 'woocommerce-gateway-stripe');
386
+				$sections['stripe_p24']        = __('Stripe P24', 'woocommerce-gateway-stripe');
387
+				$sections['stripe_alipay']     = __('Stripe Alipay', 'woocommerce-gateway-stripe');
388
+				$sections['stripe_sepa']       = __('Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe');
389
+				$sections['stripe_multibanco'] = __('Stripe Multibanco', 'woocommerce-gateway-stripe');
390 390
 
391 391
 				return $sections;
392 392
 			}
@@ -397,16 +397,16 @@  discard block
 block discarded – undo
397 397
 			 * @param WC_Email[] $email_classes All existing emails.
398 398
 			 * @return WC_Email[]
399 399
 			 */
400
-			public function add_emails( $email_classes ) {
400
+			public function add_emails($email_classes) {
401 401
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/compat/class-wc-stripe-email-failed-authentication.php';
402 402
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/compat/class-wc-stripe-email-failed-renewal-authentication.php';
403 403
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/compat/class-wc-stripe-email-failed-preorder-authentication.php';
404 404
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/compat/class-wc-stripe-email-failed-authentication-retry.php';
405 405
 
406 406
 				// Add all emails, generated by the gateway.
407
-				$email_classes['WC_Stripe_Email_Failed_Renewal_Authentication']  = new WC_Stripe_Email_Failed_Renewal_Authentication( $email_classes );
408
-				$email_classes['WC_Stripe_Email_Failed_Preorder_Authentication'] = new WC_Stripe_Email_Failed_Preorder_Authentication( $email_classes );
409
-				$email_classes['WC_Stripe_Email_Failed_Authentication_Retry'] = new WC_Stripe_Email_Failed_Authentication_Retry( $email_classes );
407
+				$email_classes['WC_Stripe_Email_Failed_Renewal_Authentication']  = new WC_Stripe_Email_Failed_Renewal_Authentication($email_classes);
408
+				$email_classes['WC_Stripe_Email_Failed_Preorder_Authentication'] = new WC_Stripe_Email_Failed_Preorder_Authentication($email_classes);
409
+				$email_classes['WC_Stripe_Email_Failed_Authentication_Retry'] = new WC_Stripe_Email_Failed_Authentication_Retry($email_classes);
410 410
 
411 411
 				return $email_classes;
412 412
 			}
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/connect/class-wc-stripe-connect-rest-oauth-connect-controller.php';
422 422
 				require_once WC_STRIPE_PLUGIN_PATH . '/includes/connect/class-wc-stripe-connect-rest-deauthorize-controller.php';
423 423
 
424
-				$oauth_init    = new WC_Stripe_Connect_REST_Oauth_Init_Controller( $this->connect, $this->api );
425
-				$oauth_connect = new WC_Stripe_Connect_REST_Oauth_Connect_Controller( $this->connect, $this->api );
426
-				$deauthorize   = new WC_Stripe_Connect_REST_Deauthorize_Controller( $this->connect, $this->api );
424
+				$oauth_init    = new WC_Stripe_Connect_REST_Oauth_Init_Controller($this->connect, $this->api);
425
+				$oauth_connect = new WC_Stripe_Connect_REST_Oauth_Connect_Controller($this->connect, $this->api);
426
+				$deauthorize   = new WC_Stripe_Connect_REST_Deauthorize_Controller($this->connect, $this->api);
427 427
 
428 428
 				$oauth_init->register_routes();
429 429
 				$oauth_connect->register_routes();
Please login to merge, or discard this patch.
includes/connect/class-wc-stripe-connect-api.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if ( ! defined('ABSPATH')) {
3 3
 	exit;
4 4
 }
5 5
 
6
-if ( ! defined( 'WOOCOMMERCE_CONNECT_SERVER_URL' ) ) {
7
-	define( 'WOOCOMMERCE_CONNECT_SERVER_URL', 'https://api.woocommerce.com/' );
6
+if ( ! defined('WOOCOMMERCE_CONNECT_SERVER_URL')) {
7
+	define('WOOCOMMERCE_CONNECT_SERVER_URL', 'https://api.woocommerce.com/');
8 8
 }
9 9
 
10
-if ( ! class_exists( 'WC_Stripe_Connect_API' ) ) {
10
+if ( ! class_exists('WC_Stripe_Connect_API')) {
11 11
 	/**
12 12
 	 * Stripe Connect API class.
13 13
 	 */
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		 * @return array
22 22
 		 */
23 23
 		public function get_stripe_account_details() {
24
-			return $this->request( 'GET', '/stripe/account' );
24
+			return $this->request('GET', '/stripe/account');
25 25
 		}
26 26
 
27 27
 		/**
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 		 *
32 32
 		 * @return array
33 33
 		 */
34
-		public function get_stripe_oauth_init( $return_url ) {
34
+		public function get_stripe_oauth_init($return_url) {
35 35
 
36 36
 			$current_user                   = wp_get_current_user();
37 37
 			$business_data                  = array();
38 38
 			$business_data['url']           = get_site_url();
39
-			$business_data['business_name'] = html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES );
39
+			$business_data['business_name'] = html_entity_decode(get_bloginfo('name'), ENT_QUOTES);
40 40
 			$business_data['first_name']    = $current_user->user_firstname;
41 41
 			$business_data['last_name']     = $current_user->user_lastname;
42 42
 			$business_data['phone']         = '';
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 			$wc_countries = WC()->countries;
46 46
 
47
-			if ( method_exists( $wc_countries, 'get_base_address' ) ) {
47
+			if (method_exists($wc_countries, 'get_base_address')) {
48 48
 				$business_data['country']        = $wc_countries->get_base_country();
49 49
 				$business_data['street_address'] = $wc_countries->get_base_address();
50 50
 				$business_data['city']           = $wc_countries->get_base_city();
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				'businessData' => $business_data,
65 65
 			);
66 66
 
67
-			return $this->request( 'POST', '/stripe/oauth-init', $request );
67
+			return $this->request('POST', '/stripe/oauth-init', $request);
68 68
 		}
69 69
 
70 70
 		/**
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 		 *
75 75
 		 * @return array
76 76
 		 */
77
-		public function get_stripe_oauth_keys( $code ) {
77
+		public function get_stripe_oauth_keys($code) {
78 78
 
79
-			$request = array( 'code' => $code );
79
+			$request = array('code' => $code);
80 80
 
81
-			return $this->request( 'POST', '/stripe/oauth-keys', $request );
81
+			return $this->request('POST', '/stripe/oauth-keys', $request);
82 82
 		}
83 83
 
84 84
 		/**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		 */
89 89
 		public function deauthorize_stripe_account() {
90 90
 
91
-			return $this->request( 'POST', '/stripe/account/deauthorize' );
91
+			return $this->request('POST', '/stripe/account/deauthorize');
92 92
 		}
93 93
 
94 94
 		/**
@@ -100,40 +100,40 @@  discard block
 block discarded – undo
100 100
 		 *
101 101
 		 * @return array|WP_Error
102 102
 		 */
103
-		protected function request( $method, $path, $body = array() ) {
103
+		protected function request($method, $path, $body = array()) {
104 104
 
105
-			if ( ! is_array( $body ) ) {
105
+			if ( ! is_array($body)) {
106 106
 				return new WP_Error(
107 107
 					'request_body_should_be_array',
108
-					__( 'Unable to send request to WooCommerce Connect server. Body must be an array.', 'woocommerce-gateway-stripe' )
108
+					__('Unable to send request to WooCommerce Connect server. Body must be an array.', 'woocommerce-gateway-stripe')
109 109
 				);
110 110
 			}
111 111
 
112
-			$url = trailingslashit( WOOCOMMERCE_CONNECT_SERVER_URL );
113
-			$url = apply_filters( 'wc_connect_server_url', $url );
114
-			$url = trailingslashit( $url ) . ltrim( $path, '/' );
112
+			$url = trailingslashit(WOOCOMMERCE_CONNECT_SERVER_URL);
113
+			$url = apply_filters('wc_connect_server_url', $url);
114
+			$url = trailingslashit($url) . ltrim($path, '/');
115 115
 
116 116
 			// Add useful system information to requests that contain bodies.
117
-			if ( in_array( $method, array( 'POST', 'PUT' ), true ) ) {
118
-				$body = $this->request_body( $body );
119
-				$body = wp_json_encode( apply_filters( 'wc_connect_api_client_body', $body ) );
117
+			if (in_array($method, array('POST', 'PUT'), true)) {
118
+				$body = $this->request_body($body);
119
+				$body = wp_json_encode(apply_filters('wc_connect_api_client_body', $body));
120 120
 
121
-				if ( ! $body ) {
121
+				if ( ! $body) {
122 122
 					return new WP_Error(
123 123
 						'unable_to_json_encode_body',
124
-						__( 'Unable to encode body for request to WooCommerce Connect server.', 'woocommerce-gateway-stripe' )
124
+						__('Unable to encode body for request to WooCommerce Connect server.', 'woocommerce-gateway-stripe')
125 125
 					);
126 126
 				}
127 127
 			}
128 128
 
129 129
 			$headers = $this->request_headers();
130
-			if ( is_wp_error( $headers ) ) {
130
+			if (is_wp_error($headers)) {
131 131
 				return $headers;
132 132
 			}
133 133
 
134 134
 			$http_timeout = 60; // 1 minute
135
-			if ( function_exists( 'wc_set_time_limit' ) ) {
136
-				wc_set_time_limit( $http_timeout + 10 );
135
+			if (function_exists('wc_set_time_limit')) {
136
+				wc_set_time_limit($http_timeout + 10);
137 137
 			}
138 138
 			$args = array(
139 139
 				'headers'     => $headers,
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
 				'timeout'     => $http_timeout,
145 145
 			);
146 146
 
147
-			$args          = apply_filters( 'wc_connect_request_args', $args );
148
-			$response      = wp_remote_request( $url, $args );
149
-			$response_code = wp_remote_retrieve_response_code( $response );
150
-			$content_type  = wp_remote_retrieve_header( $response, 'content-type' );
147
+			$args          = apply_filters('wc_connect_request_args', $args);
148
+			$response      = wp_remote_request($url, $args);
149
+			$response_code = wp_remote_retrieve_response_code($response);
150
+			$content_type  = wp_remote_retrieve_header($response, 'content-type');
151 151
 
152
-			if ( false === strpos( $content_type, 'application/json' ) ) {
153
-				if ( 200 !== $response_code ) {
152
+			if (false === strpos($content_type, 'application/json')) {
153
+				if (200 !== $response_code) {
154 154
 					return new WP_Error(
155 155
 						'wcc_server_error',
156 156
 						sprintf(
157 157
 							// Translators: HTTP error code.
158
-							__( 'Error: The WooCommerce Connect server returned HTTP code: %d', 'woocommerce-gateway-stripe' ),
158
+							__('Error: The WooCommerce Connect server returned HTTP code: %d', 'woocommerce-gateway-stripe'),
159 159
 							$response_code
160 160
 						)
161 161
 					);
@@ -163,32 +163,32 @@  discard block
 block discarded – undo
163 163
 				return $response;
164 164
 			}
165 165
 
166
-			$response_body = wp_remote_retrieve_body( $response );
167
-			if ( ! empty( $response_body ) ) {
168
-				$response_body = json_decode( $response_body );
166
+			$response_body = wp_remote_retrieve_body($response);
167
+			if ( ! empty($response_body)) {
168
+				$response_body = json_decode($response_body);
169 169
 			}
170 170
 
171
-			if ( 200 !== $response_code ) {
172
-				if ( empty( $response_body ) ) {
171
+			if (200 !== $response_code) {
172
+				if (empty($response_body)) {
173 173
 					return new WP_Error(
174 174
 						'wcc_server_empty_response',
175 175
 						sprintf(
176 176
 							// Translators: HTTP error code.
177
-							__( 'Error: The WooCommerce Connect server returned ( %d ) and an empty response body.', 'woocommerce-gateway-stripe' ),
177
+							__('Error: The WooCommerce Connect server returned ( %d ) and an empty response body.', 'woocommerce-gateway-stripe'),
178 178
 							$response_code
179 179
 						)
180 180
 					);
181 181
 				}
182 182
 
183
-				$error   = property_exists( $response_body, 'error' ) ? $response_body->error : '';
184
-				$message = property_exists( $response_body, 'message' ) ? $response_body->message : '';
185
-				$data    = property_exists( $response_body, 'data' ) ? $response_body->data : '';
183
+				$error   = property_exists($response_body, 'error') ? $response_body->error : '';
184
+				$message = property_exists($response_body, 'message') ? $response_body->message : '';
185
+				$data    = property_exists($response_body, 'data') ? $response_body->data : '';
186 186
 
187 187
 				return new WP_Error(
188 188
 					'wcc_server_error_response',
189 189
 					sprintf(
190 190
 						/* translators: %1$s: error code, %2$s: error message, %3$d: HTTP response code */
191
-						__( 'Error: The WooCommerce Connect server returned: %1$s %2$s ( %3$d )', 'woocommerce-gateway-stripe' ),
191
+						__('Error: The WooCommerce Connect server returned: %1$s %2$s ( %3$d )', 'woocommerce-gateway-stripe'),
192 192
 						$error,
193 193
 						$message,
194 194
 						$response_code
@@ -207,13 +207,13 @@  discard block
 block discarded – undo
207 207
 		 *
208 208
 		 * @return array
209 209
 		 */
210
-		protected function request_body( $initial_body = array() ) {
210
+		protected function request_body($initial_body = array()) {
211 211
 
212 212
 			$default_body = array(
213 213
 				'settings' => array(),
214 214
 			);
215 215
 
216
-			$body = array_merge( $default_body, $initial_body );
216
+			$body = array_merge($default_body, $initial_body);
217 217
 
218 218
 			// Add interesting fields to the body of each request.
219 219
 			$body['settings'] = wp_parse_args(
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 					'currency'       => get_woocommerce_currency(),
227 227
 					'stripe_version' => WC_STRIPE_VERSION,
228 228
 					'wc_version'     => WC()->version,
229
-					'wp_version'     => get_bloginfo( 'version' ),
229
+					'wp_version'     => get_bloginfo('version'),
230 230
 				)
231 231
 			);
232 232
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 		protected function request_headers() {
242 242
 
243 243
 			$headers                    = array();
244
-			$locale                     = strtolower( str_replace( '_', '-', get_locale() ) );
245
-			$locale_elements            = explode( '-', $locale );
244
+			$locale                     = strtolower(str_replace('_', '-', get_locale()));
245
+			$locale_elements            = explode('-', $locale);
246 246
 			$lang                       = $locale_elements[0];
247 247
 			$headers['Accept-Language'] = $locale . ',' . $lang;
248 248
 			$headers['Content-Type']    = 'application/json; charset=utf-8';
Please login to merge, or discard this patch.
includes/connect/class-wc-stripe-connect.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined('ABSPATH')) {
4 4
 	exit;
5 5
 }
6 6
 
7
-if ( ! class_exists( 'WC_Stripe_Connect' ) ) {
7
+if ( ! class_exists('WC_Stripe_Connect')) {
8 8
 	/**
9 9
 	 * Stripe Connect class.
10 10
 	 */
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 		 *
25 25
 		 * @param WC_Stripe_Connect_API $api stripe connect api.
26 26
 		 */
27
-		public function __construct( WC_Stripe_Connect_API $api ) {
27
+		public function __construct(WC_Stripe_Connect_API $api) {
28 28
 
29 29
 			$this->api = $api;
30 30
 
31
-			add_action( 'wc_ajax_wc_stripe_oauth_init', array( $this, 'wc_ajax_oauth_init' ) );
32
-			add_action( 'wc_ajax_wc_stripe_clear_keys', array( $this, 'wc_ajax_clear_stripe_keys' ) );
31
+			add_action('wc_ajax_wc_stripe_oauth_init', array($this, 'wc_ajax_oauth_init'));
32
+			add_action('wc_ajax_wc_stripe_clear_keys', array($this, 'wc_ajax_clear_stripe_keys'));
33 33
 		}
34 34
 
35 35
 		/**
@@ -39,23 +39,23 @@  discard block
 block discarded – undo
39 39
 		 *
40 40
 		 * @return string|WP_Error
41 41
 		 */
42
-		public function get_oauth_url( $return_url = '' ) {
42
+		public function get_oauth_url($return_url = '') {
43 43
 
44
-			if ( empty( $return_url ) ) {
45
-				$return_url = admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' );
44
+			if (empty($return_url)) {
45
+				$return_url = admin_url('admin.php?page=wc-settings&tab=checkout&section=stripe');
46 46
 			}
47 47
 
48
-			if ( substr( $return_url, 0, 8 ) !== 'https://' ) {
49
-				return new WP_Error( 'invalid_url_protocol', __( 'Your site must be served over HTTPS in order to connect your Stripe account automatically.', 'woocommerce-gateway-stripe' ) );
48
+			if (substr($return_url, 0, 8) !== 'https://') {
49
+				return new WP_Error('invalid_url_protocol', __('Your site must be served over HTTPS in order to connect your Stripe account automatically.', 'woocommerce-gateway-stripe'));
50 50
 			}
51 51
 
52
-			$result = $this->api->get_stripe_oauth_init( $return_url );
52
+			$result = $this->api->get_stripe_oauth_init($return_url);
53 53
 
54
-			if ( is_wp_error( $result ) ) {
54
+			if (is_wp_error($result)) {
55 55
 				return $result;
56 56
 			}
57 57
 
58
-			update_option( 'stripe_state', $result->state );
58
+			update_option('stripe_state', $result->state);
59 59
 
60 60
 			return $result->oauthUrl; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
61 61
 		}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 			$response = $this->api->deauthorize_stripe_account();
71 71
 
72
-			if ( is_wp_error( $response ) ) {
72
+			if (is_wp_error($response)) {
73 73
 				return $response;
74 74
 			}
75 75
 
@@ -86,21 +86,21 @@  discard block
 block discarded – undo
86 86
 		 *
87 87
 		 * @return string|WP_Error
88 88
 		 */
89
-		public function connect_oauth( $state, $code ) {
89
+		public function connect_oauth($state, $code) {
90 90
 
91
-			if ( get_option( 'stripe_state', false ) !== $state ) {
92
-				return new WP_Error( 'Invalid stripe state' );
91
+			if (get_option('stripe_state', false) !== $state) {
92
+				return new WP_Error('Invalid stripe state');
93 93
 			}
94 94
 
95
-			$response = $this->api->get_stripe_oauth_keys( $code );
95
+			$response = $this->api->get_stripe_oauth_keys($code);
96 96
 
97
-			if ( is_wp_error( $response ) ) {
97
+			if (is_wp_error($response)) {
98 98
 				return $response;
99 99
 			}
100 100
 
101
-			delete_option( 'stripe_state' );
101
+			delete_option('stripe_state');
102 102
 
103
-			return $this->save_stripe_keys( $response );
103
+			return $this->save_stripe_keys($response);
104 104
 		}
105 105
 
106 106
 		/**
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 		 */
109 109
 		public function maybe_connect_oauth() {
110 110
 
111
-			if ( ! get_option( 'stripe_state', false ) ) {
111
+			if ( ! get_option('stripe_state', false)) {
112 112
 				return;
113 113
 			}
114 114
 
115
-			if ( isset( $_GET['wcs_stripe_code'], $_GET['wcs_stripe_state'] ) ) {
116
-				$response = $this->connect_oauth( $_GET['wcs_stripe_state'], $_GET['wcs_stripe_code'] );
115
+			if (isset($_GET['wcs_stripe_code'], $_GET['wcs_stripe_state'])) {
116
+				$response = $this->connect_oauth($_GET['wcs_stripe_state'], $_GET['wcs_stripe_code']);
117 117
 
118
-				wp_safe_redirect( remove_query_arg( array( 'wcs_stripe_state', 'wcs_stripe_code' ) ) );
118
+				wp_safe_redirect(remove_query_arg(array('wcs_stripe_state', 'wcs_stripe_code')));
119 119
 				exit;
120 120
 			}
121 121
 		}
@@ -127,28 +127,28 @@  discard block
 block discarded – undo
127 127
 		 *
128 128
 		 * @return array|WP_Error
129 129
 		 */
130
-		private function save_stripe_keys( $result ) {
130
+		private function save_stripe_keys($result) {
131 131
 
132
-			if ( ! isset( $result->publishableKey, $result->secretKey ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
133
-				return new WP_Error( 'Invalid credentials received from WooCommerce Connect server' );
132
+			if ( ! isset($result->publishableKey, $result->secretKey)) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
133
+				return new WP_Error('Invalid credentials received from WooCommerce Connect server');
134 134
 			}
135 135
 
136
-			$is_test         = false !== strpos( $result->publishableKey, '_test_' ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
136
+			$is_test         = false !== strpos($result->publishableKey, '_test_'); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
137 137
 			$prefix          = $is_test ? 'test_' : '';
138 138
 			$default_options = array();
139 139
 
140
-			$options                                = array_merge( $default_options, get_option( self::SETTINGS_OPTION, array() ) );
140
+			$options                                = array_merge($default_options, get_option(self::SETTINGS_OPTION, array()));
141 141
 			$options['enabled']                     = 'yes';
142 142
 			$options['testmode']                    = $is_test ? 'yes' : 'no';
143
-			$options[ $prefix . 'publishable_key' ] = $result->publishableKey; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
144
-			$options[ $prefix . 'secret_key' ]      = $result->secretKey; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
143
+			$options[$prefix . 'publishable_key'] = $result->publishableKey; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
144
+			$options[$prefix . 'secret_key']      = $result->secretKey; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
145 145
 
146 146
 			// While we are at it, let's also clear the account_id and
147 147
 			// test_account_id if present.
148
-			unset( $options['account_id'] );
149
-			unset( $options['test_account_id'] );
148
+			unset($options['account_id']);
149
+			unset($options['test_account_id']);
150 150
 
151
-			update_option( self::SETTINGS_OPTION, $options );
151
+			update_option(self::SETTINGS_OPTION, $options);
152 152
 
153 153
 			return $result;
154 154
 		}
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
 		 */
159 159
 		private function clear_stripe_keys() {
160 160
 
161
-			$options = get_option( self::SETTINGS_OPTION, array() );
161
+			$options = get_option(self::SETTINGS_OPTION, array());
162 162
 
163
-			if ( 'yes' === $options['testmode'] ) {
163
+			if ('yes' === $options['testmode']) {
164 164
 				$options['test_publishable_key'] = '';
165 165
 				$options['test_secret_key']      = '';
166 166
 			} else {
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 
171 171
 			// While we are at it, let's also clear the account_id and
172 172
 			// test_account_id if present.
173
-			unset( $options['account_id'] );
174
-			unset( $options['test_account_id'] );
173
+			unset($options['account_id']);
174
+			unset($options['test_account_id']);
175 175
 
176
-			update_option( self::SETTINGS_OPTION, $options );
176
+			update_option(self::SETTINGS_OPTION, $options);
177 177
 
178 178
 		}
179 179
 
@@ -182,17 +182,17 @@  discard block
 block discarded – undo
182 182
 		 */
183 183
 		public function wc_ajax_oauth_init() {
184 184
 
185
-			if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], '_wc_stripe_admin_nonce' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash
186
-				wp_die( __( 'You are not authorized to automatically copy Stripe keys.', 'woocommerce-gateway-stripe' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
185
+			if (empty($_POST['nonce']) || ! wp_verify_nonce($_POST['nonce'], '_wc_stripe_admin_nonce')) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash
186
+				wp_die(__('You are not authorized to automatically copy Stripe keys.', 'woocommerce-gateway-stripe')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
187 187
 			}
188 188
 
189 189
 			$oauth_url = $this->get_oauth_url();
190 190
 
191
-			if ( is_wp_error( $oauth_url ) ) {
192
-				wp_send_json_error( $oauth_url->get_error_message() );
191
+			if (is_wp_error($oauth_url)) {
192
+				wp_send_json_error($oauth_url->get_error_message());
193 193
 			}
194 194
 
195
-			wp_send_json_success( $oauth_url );
195
+			wp_send_json_success($oauth_url);
196 196
 		}
197 197
 
198 198
 		/**
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
 		 */
201 201
 		public function wc_ajax_clear_stripe_keys() {
202 202
 
203
-			if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], '_wc_stripe_admin_nonce' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash
204
-				wp_die( __( 'You are not authorized to reset Stripe keys.', 'woocommerce-gateway-stripe' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
203
+			if (empty($_POST['nonce']) || ! wp_verify_nonce($_POST['nonce'], '_wc_stripe_admin_nonce')) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash
204
+				wp_die(__('You are not authorized to reset Stripe keys.', 'woocommerce-gateway-stripe')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
205 205
 			}
206 206
 
207 207
 			$this->clear_stripe_keys();
208 208
 
209
-			wp_send_json_success( admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
209
+			wp_send_json_success(admin_url('admin.php?page=wc-settings&tab=checkout&section=stripe'));
210 210
 		}
211 211
 	}
212 212
 }
Please login to merge, or discard this patch.
includes/admin/stripe-settings.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if ( ! defined('ABSPATH')) {
3 3
 	exit;
4 4
 }
5 5
 
@@ -7,186 +7,186 @@  discard block
 block discarded – undo
7 7
 	'wc_stripe_settings',
8 8
 	array(
9 9
 		'enabled'                       => array(
10
-			'title'       => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
11
-			'label'       => __( 'Enable Stripe', 'woocommerce-gateway-stripe' ),
10
+			'title'       => __('Enable/Disable', 'woocommerce-gateway-stripe'),
11
+			'label'       => __('Enable Stripe', 'woocommerce-gateway-stripe'),
12 12
 			'type'        => 'checkbox',
13 13
 			'description' => '',
14 14
 			'default'     => 'no',
15 15
 		),
16 16
 		'title'                         => array(
17
-			'title'       => __( 'Title', 'woocommerce-gateway-stripe' ),
17
+			'title'       => __('Title', 'woocommerce-gateway-stripe'),
18 18
 			'type'        => 'text',
19
-			'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
20
-			'default'     => __( 'Credit Card (Stripe)', 'woocommerce-gateway-stripe' ),
19
+			'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'),
20
+			'default'     => __('Credit Card (Stripe)', 'woocommerce-gateway-stripe'),
21 21
 			'desc_tip'    => true,
22 22
 		),
23 23
 		'description'                   => array(
24
-			'title'       => __( 'Description', 'woocommerce-gateway-stripe' ),
24
+			'title'       => __('Description', 'woocommerce-gateway-stripe'),
25 25
 			'type'        => 'text',
26
-			'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
27
-			'default'     => __( 'Pay with your credit card via Stripe.', 'woocommerce-gateway-stripe' ),
26
+			'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'),
27
+			'default'     => __('Pay with your credit card via Stripe.', 'woocommerce-gateway-stripe'),
28 28
 			'desc_tip'    => true,
29 29
 		),
30 30
 		'webhook'                       => array(
31
-			'title'       => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
31
+			'title'       => __('Webhook Endpoints', 'woocommerce-gateway-stripe'),
32 32
 			'type'        => 'title',
33 33
 			/* translators: webhook URL */
34 34
 			'description' => $this->display_admin_settings_webhook_description(),
35 35
 		),
36 36
 		'api_credentials'               => array(
37
-			'title' => __( 'API Credentials', 'woocommerce-gateway-stripe' ),
37
+			'title' => __('API Credentials', 'woocommerce-gateway-stripe'),
38 38
 			'type'  => 'title',
39 39
 		),
40 40
 		'testmode'                      => array(
41
-			'title'       => __( 'Test mode', 'woocommerce-gateway-stripe' ),
42
-			'label'       => __( 'Enable Test Mode', 'woocommerce-gateway-stripe' ),
41
+			'title'       => __('Test mode', 'woocommerce-gateway-stripe'),
42
+			'label'       => __('Enable Test Mode', 'woocommerce-gateway-stripe'),
43 43
 			'type'        => 'checkbox',
44
-			'description' => __( 'Place the payment gateway in test mode using test API keys.', 'woocommerce-gateway-stripe' ),
44
+			'description' => __('Place the payment gateway in test mode using test API keys.', 'woocommerce-gateway-stripe'),
45 45
 			'default'     => 'yes',
46 46
 			'desc_tip'    => true,
47 47
 		),
48 48
 		'test_publishable_key'          => array(
49
-			'title'       => __( 'Test Publishable Key', 'woocommerce-gateway-stripe' ),
49
+			'title'       => __('Test Publishable Key', 'woocommerce-gateway-stripe'),
50 50
 			'type'        => 'text',
51
-			'description' => __( 'Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "pk_test_" will be saved.', 'woocommerce-gateway-stripe' ),
51
+			'description' => __('Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "pk_test_" will be saved.', 'woocommerce-gateway-stripe'),
52 52
 			'default'     => '',
53 53
 			'desc_tip'    => true,
54 54
 		),
55 55
 		'test_secret_key'               => array(
56
-			'title'       => __( 'Test Secret Key', 'woocommerce-gateway-stripe' ),
56
+			'title'       => __('Test Secret Key', 'woocommerce-gateway-stripe'),
57 57
 			'type'        => 'password',
58
-			'description' => __( 'Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "sk_test_" or "rk_test_" will be saved.', 'woocommerce-gateway-stripe' ),
58
+			'description' => __('Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "sk_test_" or "rk_test_" will be saved.', 'woocommerce-gateway-stripe'),
59 59
 			'default'     => '',
60 60
 			'desc_tip'    => true,
61 61
 		),
62 62
 		'test_webhook_secret'           => array(
63
-			'title'       => __( 'Test Webhook Secret', 'woocommerce-gateway-stripe' ),
63
+			'title'       => __('Test Webhook Secret', 'woocommerce-gateway-stripe'),
64 64
 			'type'        => 'password',
65
-			'description' => __( 'Get your webhook signing secret from the webhooks section in your stripe account.', 'woocommerce-gateway-stripe' ),
65
+			'description' => __('Get your webhook signing secret from the webhooks section in your stripe account.', 'woocommerce-gateway-stripe'),
66 66
 			'default'     => '',
67 67
 			'desc_tip'    => true,
68 68
 		),
69 69
 		'publishable_key'               => array(
70
-			'title'       => __( 'Live Publishable Key', 'woocommerce-gateway-stripe' ),
70
+			'title'       => __('Live Publishable Key', 'woocommerce-gateway-stripe'),
71 71
 			'type'        => 'text',
72
-			'description' => __( 'Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "pk_live_" will be saved.', 'woocommerce-gateway-stripe' ),
72
+			'description' => __('Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "pk_live_" will be saved.', 'woocommerce-gateway-stripe'),
73 73
 			'default'     => '',
74 74
 			'desc_tip'    => true,
75 75
 		),
76 76
 		'secret_key'                    => array(
77
-			'title'       => __( 'Live Secret Key', 'woocommerce-gateway-stripe' ),
77
+			'title'       => __('Live Secret Key', 'woocommerce-gateway-stripe'),
78 78
 			'type'        => 'password',
79
-			'description' => __( 'Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "sk_live_" or "rk_live_" will be saved.', 'woocommerce-gateway-stripe' ),
79
+			'description' => __('Get your API keys from your stripe account. Invalid values will be rejected. Only values starting with "sk_live_" or "rk_live_" will be saved.', 'woocommerce-gateway-stripe'),
80 80
 			'default'     => '',
81 81
 			'desc_tip'    => true,
82 82
 		),
83 83
 		'webhook_secret'               => array(
84
-			'title'       => __( 'Webhook Secret', 'woocommerce-gateway-stripe' ),
84
+			'title'       => __('Webhook Secret', 'woocommerce-gateway-stripe'),
85 85
 			'type'        => 'password',
86
-			'description' => __( 'Get your webhook signing secret from the webhooks section in your stripe account.', 'woocommerce-gateway-stripe' ),
86
+			'description' => __('Get your webhook signing secret from the webhooks section in your stripe account.', 'woocommerce-gateway-stripe'),
87 87
 			'default'     => '',
88 88
 			'desc_tip'    => true,
89 89
 		),
90 90
 		'inline_cc_form'                => array(
91
-			'title'       => __( 'Inline Credit Card Form', 'woocommerce-gateway-stripe' ),
91
+			'title'       => __('Inline Credit Card Form', 'woocommerce-gateway-stripe'),
92 92
 			'type'        => 'checkbox',
93
-			'description' => __( 'Choose the style you want to show for your credit card form. When unchecked, the credit card form will display separate credit card number field, expiry date field and cvc field.', 'woocommerce-gateway-stripe' ),
93
+			'description' => __('Choose the style you want to show for your credit card form. When unchecked, the credit card form will display separate credit card number field, expiry date field and cvc field.', 'woocommerce-gateway-stripe'),
94 94
 			'default'     => 'no',
95 95
 			'desc_tip'    => true,
96 96
 		),
97 97
 		'statement_descriptor'          => array(
98
-			'title'       => __( 'Statement Descriptor', 'woocommerce-gateway-stripe' ),
98
+			'title'       => __('Statement Descriptor', 'woocommerce-gateway-stripe'),
99 99
 			'type'        => 'text',
100
-			'description' => __( 'Statement descriptors are limited to 22 characters, cannot use the special characters >, <, ", \, \', *, and must not consist solely of numbers. This will appear on your customer\'s statement in capital letters.', 'woocommerce-gateway-stripe' ),
100
+			'description' => __('Statement descriptors are limited to 22 characters, cannot use the special characters >, <, ", \, \', *, and must not consist solely of numbers. This will appear on your customer\'s statement in capital letters.', 'woocommerce-gateway-stripe'),
101 101
 			'default'     => '',
102 102
 			'desc_tip'    => true,
103 103
 		),
104 104
 		'capture'                       => array(
105
-			'title'       => __( 'Capture', 'woocommerce-gateway-stripe' ),
106
-			'label'       => __( 'Capture charge immediately', 'woocommerce-gateway-stripe' ),
105
+			'title'       => __('Capture', 'woocommerce-gateway-stripe'),
106
+			'label'       => __('Capture charge immediately', 'woocommerce-gateway-stripe'),
107 107
 			'type'        => 'checkbox',
108
-			'description' => __( 'Whether or not to immediately capture the charge. When unchecked, the charge issues an authorization and will need to be captured later. Uncaptured charges expire in 7 days.', 'woocommerce-gateway-stripe' ),
108
+			'description' => __('Whether or not to immediately capture the charge. When unchecked, the charge issues an authorization and will need to be captured later. Uncaptured charges expire in 7 days.', 'woocommerce-gateway-stripe'),
109 109
 			'default'     => 'yes',
110 110
 			'desc_tip'    => true,
111 111
 		),
112 112
 		'payment_request'               => array(
113
-			'title'       => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ),
113
+			'title'       => __('Payment Request Buttons', 'woocommerce-gateway-stripe'),
114 114
 			/* translators: 1) br tag 2) opening anchor tag 3) closing anchor tag */
115
-			'label'       => sprintf( __( 'Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) %1$sBy using Apple Pay, you agree to %2$s and %3$s\'s terms of service.', 'woocommerce-gateway-stripe' ), '<br />', '<a href="https://stripe.com/apple-pay/legal" target="_blank">Stripe</a>', '<a href="https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/" target="_blank">Apple</a>' ),
115
+			'label'       => sprintf(__('Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) %1$sBy using Apple Pay, you agree to %2$s and %3$s\'s terms of service.', 'woocommerce-gateway-stripe'), '<br />', '<a href="https://stripe.com/apple-pay/legal" target="_blank">Stripe</a>', '<a href="https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/" target="_blank">Apple</a>'),
116 116
 			'type'        => 'checkbox',
117
-			'description' => __( 'If enabled, users will be able to pay using Apple Pay or Chrome Payment Request if supported by the browser.', 'woocommerce-gateway-stripe' ),
117
+			'description' => __('If enabled, users will be able to pay using Apple Pay or Chrome Payment Request if supported by the browser.', 'woocommerce-gateway-stripe'),
118 118
 			'default'     => 'yes',
119 119
 			'desc_tip'    => true,
120 120
 		),
121 121
 		'payment_request_button_type'   => array(
122
-			'title'       => __( 'Payment Request Button Type', 'woocommerce-gateway-stripe' ),
123
-			'label'       => __( 'Button Type', 'woocommerce-gateway-stripe' ),
122
+			'title'       => __('Payment Request Button Type', 'woocommerce-gateway-stripe'),
123
+			'label'       => __('Button Type', 'woocommerce-gateway-stripe'),
124 124
 			'type'        => 'select',
125
-			'description' => __( 'Select the button type you would like to show.', 'woocommerce-gateway-stripe' ),
125
+			'description' => __('Select the button type you would like to show.', 'woocommerce-gateway-stripe'),
126 126
 			'default'     => 'buy',
127 127
 			'desc_tip'    => true,
128 128
 			'options'     => array(
129
-				'default' => __( 'Default', 'woocommerce-gateway-stripe' ),
130
-				'buy'     => __( 'Buy', 'woocommerce-gateway-stripe' ),
131
-				'donate'  => __( 'Donate', 'woocommerce-gateway-stripe' ),
132
-				'branded' => __( 'Branded', 'woocommerce-gateway-stripe' ),
133
-				'custom'  => __( 'Custom', 'woocommerce-gateway-stripe' ),
129
+				'default' => __('Default', 'woocommerce-gateway-stripe'),
130
+				'buy'     => __('Buy', 'woocommerce-gateway-stripe'),
131
+				'donate'  => __('Donate', 'woocommerce-gateway-stripe'),
132
+				'branded' => __('Branded', 'woocommerce-gateway-stripe'),
133
+				'custom'  => __('Custom', 'woocommerce-gateway-stripe'),
134 134
 			),
135 135
 		),
136 136
 		'payment_request_button_theme'  => array(
137
-			'title'       => __( 'Payment Request Button Theme', 'woocommerce-gateway-stripe' ),
138
-			'label'       => __( 'Button Theme', 'woocommerce-gateway-stripe' ),
137
+			'title'       => __('Payment Request Button Theme', 'woocommerce-gateway-stripe'),
138
+			'label'       => __('Button Theme', 'woocommerce-gateway-stripe'),
139 139
 			'type'        => 'select',
140
-			'description' => __( 'Select the button theme you would like to show.', 'woocommerce-gateway-stripe' ),
140
+			'description' => __('Select the button theme you would like to show.', 'woocommerce-gateway-stripe'),
141 141
 			'default'     => 'dark',
142 142
 			'desc_tip'    => true,
143 143
 			'options'     => array(
144
-				'dark'          => __( 'Dark', 'woocommerce-gateway-stripe' ),
145
-				'light'         => __( 'Light', 'woocommerce-gateway-stripe' ),
146
-				'light-outline' => __( 'Light-Outline', 'woocommerce-gateway-stripe' ),
144
+				'dark'          => __('Dark', 'woocommerce-gateway-stripe'),
145
+				'light'         => __('Light', 'woocommerce-gateway-stripe'),
146
+				'light-outline' => __('Light-Outline', 'woocommerce-gateway-stripe'),
147 147
 			),
148 148
 		),
149 149
 		'payment_request_button_height' => array(
150
-			'title'       => __( 'Payment Request Button Height', 'woocommerce-gateway-stripe' ),
151
-			'label'       => __( 'Button Height', 'woocommerce-gateway-stripe' ),
150
+			'title'       => __('Payment Request Button Height', 'woocommerce-gateway-stripe'),
151
+			'label'       => __('Button Height', 'woocommerce-gateway-stripe'),
152 152
 			'type'        => 'text',
153
-			'description' => __( 'Enter the height you would like the button to be in pixels. Width will always be 100%.', 'woocommerce-gateway-stripe' ),
153
+			'description' => __('Enter the height you would like the button to be in pixels. Width will always be 100%.', 'woocommerce-gateway-stripe'),
154 154
 			'default'     => '44',
155 155
 			'desc_tip'    => true,
156 156
 		),
157 157
 		'payment_request_button_label' => array(
158
-			'title'       => __( 'Payment Request Button Label', 'woocommerce-gateway-stripe' ),
159
-			'label'       => __( 'Button Label', 'woocommerce-gateway-stripe' ),
158
+			'title'       => __('Payment Request Button Label', 'woocommerce-gateway-stripe'),
159
+			'label'       => __('Button Label', 'woocommerce-gateway-stripe'),
160 160
 			'type'        => 'text',
161
-			'description' => __( 'Enter the custom text you would like the button to have.', 'woocommerce-gateway-stripe' ),
162
-			'default'     => __( 'Buy now', 'woocommerce-gateway-stripe' ),
161
+			'description' => __('Enter the custom text you would like the button to have.', 'woocommerce-gateway-stripe'),
162
+			'default'     => __('Buy now', 'woocommerce-gateway-stripe'),
163 163
 			'desc_tip'    => true,
164 164
 		),
165 165
 		'payment_request_button_branded_type' => array(
166
-			'title'       => __( 'Payment Request Branded Button Label Format', 'woocommerce-gateway-stripe' ),
167
-			'label'       => __( 'Branded Button Label Format', 'woocommerce-gateway-stripe' ),
166
+			'title'       => __('Payment Request Branded Button Label Format', 'woocommerce-gateway-stripe'),
167
+			'label'       => __('Branded Button Label Format', 'woocommerce-gateway-stripe'),
168 168
 			'type'        => 'select',
169
-			'description' => __( 'Select the branded button label format.', 'woocommerce-gateway-stripe' ),
169
+			'description' => __('Select the branded button label format.', 'woocommerce-gateway-stripe'),
170 170
 			'default'     => 'long',
171 171
 			'desc_tip'    => true,
172 172
 			'options'     => array(
173
-				'short' => __( 'Logo only', 'woocommerce-gateway-stripe' ),
174
-				'long'  => __( 'Text and logo', 'woocommerce-gateway-stripe' ),
173
+				'short' => __('Logo only', 'woocommerce-gateway-stripe'),
174
+				'long'  => __('Text and logo', 'woocommerce-gateway-stripe'),
175 175
 			),
176 176
 		),
177 177
 		'saved_cards'                   => array(
178
-			'title'       => __( 'Saved Cards', 'woocommerce-gateway-stripe' ),
179
-			'label'       => __( 'Enable Payment via Saved Cards', 'woocommerce-gateway-stripe' ),
178
+			'title'       => __('Saved Cards', 'woocommerce-gateway-stripe'),
179
+			'label'       => __('Enable Payment via Saved Cards', 'woocommerce-gateway-stripe'),
180 180
 			'type'        => 'checkbox',
181
-			'description' => __( 'If enabled, users will be able to pay with a saved card during checkout. Card details are saved on Stripe servers, not on your store.', 'woocommerce-gateway-stripe' ),
181
+			'description' => __('If enabled, users will be able to pay with a saved card during checkout. Card details are saved on Stripe servers, not on your store.', 'woocommerce-gateway-stripe'),
182 182
 			'default'     => 'yes',
183 183
 			'desc_tip'    => true,
184 184
 		),
185 185
 		'logging'                       => array(
186
-			'title'       => __( 'Logging', 'woocommerce-gateway-stripe' ),
187
-			'label'       => __( 'Log debug messages', 'woocommerce-gateway-stripe' ),
186
+			'title'       => __('Logging', 'woocommerce-gateway-stripe'),
187
+			'label'       => __('Log debug messages', 'woocommerce-gateway-stripe'),
188 188
 			'type'        => 'checkbox',
189
-			'description' => __( 'Save debug messages to the WooCommerce System Status log.', 'woocommerce-gateway-stripe' ),
189
+			'description' => __('Save debug messages to the WooCommerce System Status log.', 'woocommerce-gateway-stripe'),
190 190
 			'default'     => 'no',
191 191
 			'desc_tip'    => true,
192 192
 		),
Please login to merge, or discard this patch.