|
@@ -14,20 +14,20 @@ discard block |
|
|
block discarded – undo |
14
|
14
|
* |
15
|
15
|
*/ |
16
|
16
|
|
17
|
|
-if ( ! defined( 'ABSPATH' ) ) { |
|
17
|
+if ( ! defined('ABSPATH')) { |
18
|
18
|
exit; |
19
|
19
|
} |
20
|
20
|
|
21
|
|
-if ( ! class_exists( 'WC_Stripe' ) ) : |
|
21
|
+if ( ! class_exists('WC_Stripe')) : |
22
|
22
|
/** |
23
|
23
|
* Required minimums and constants |
24
|
24
|
*/ |
25
|
|
- define( 'WC_STRIPE_VERSION', '4.0.1' ); |
26
|
|
- define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' ); |
27
|
|
- define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' ); |
28
|
|
- define( 'WC_STRIPE_MAIN_FILE', __FILE__ ); |
29
|
|
- define( 'WC_STRIPE_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) ); |
30
|
|
- define( 'WC_STRIPE_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
25
|
+ define('WC_STRIPE_VERSION', '4.0.1'); |
|
26
|
+ define('WC_STRIPE_MIN_PHP_VER', '5.6.0'); |
|
27
|
+ define('WC_STRIPE_MIN_WC_VER', '2.6.0'); |
|
28
|
+ define('WC_STRIPE_MAIN_FILE', __FILE__); |
|
29
|
+ define('WC_STRIPE_PLUGIN_URL', untrailingslashit(plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__)))); |
|
30
|
+ define('WC_STRIPE_PLUGIN_PATH', untrailingslashit(plugin_dir_path(__FILE__))); |
31
|
31
|
|
32
|
32
|
class WC_Stripe { |
33
|
33
|
|
|
@@ -47,7 +47,7 @@ discard block |
|
|
block discarded – undo |
47
|
47
|
* @return Singleton The *Singleton* instance. |
48
|
48
|
*/ |
49
|
49
|
public static function get_instance() { |
50
|
|
- if ( null === self::$instance ) { |
|
50
|
+ if (null === self::$instance) { |
51
|
51
|
self::$instance = new self(); |
52
|
52
|
} |
53
|
53
|
return self::$instance; |
|
@@ -80,10 +80,10 @@ discard block |
|
|
block discarded – undo |
80
|
80
|
* *Singleton* via the `new` operator from outside of this class. |
81
|
81
|
*/ |
82
|
82
|
private function __construct() { |
83
|
|
- add_action( 'admin_init', array( $this, 'check_environment' ) ); |
84
|
|
- add_action( 'admin_notices', array( $this, 'admin_notices' ), 15 ); |
85
|
|
- add_action( 'plugins_loaded', array( $this, 'init' ) ); |
86
|
|
- add_action( 'wp_loaded', array( $this, 'hide_notices' ) ); |
|
83
|
+ add_action('admin_init', array($this, 'check_environment')); |
|
84
|
+ add_action('admin_notices', array($this, 'admin_notices'), 15); |
|
85
|
+ add_action('plugins_loaded', array($this, 'init')); |
|
86
|
+ add_action('wp_loaded', array($this, 'hide_notices')); |
87
|
87
|
} |
88
|
88
|
|
89
|
89
|
/** |
|
@@ -93,42 +93,42 @@ discard block |
|
|
block discarded – undo |
93
|
93
|
* @version 4.0.0 |
94
|
94
|
*/ |
95
|
95
|
public function init() { |
96
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php' ); |
97
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php' ); |
98
|
|
- include_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php' ); |
|
96
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-logger.php'); |
|
97
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-helper.php'); |
|
98
|
+ include_once(dirname(__FILE__) . '/includes/class-wc-stripe-api.php'); |
99
|
99
|
|
100
|
100
|
// Don't hook anything else in the plugin if we're in an incompatible environment |
101
|
|
- if ( self::get_environment_warning() ) { |
|
101
|
+ if (self::get_environment_warning()) { |
102
|
102
|
return; |
103
|
103
|
} |
104
|
104
|
|
105
|
|
- load_plugin_textdomain( 'woocommerce-gateway-stripe', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); |
106
|
|
- |
107
|
|
- require_once( dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php' ); |
108
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php' ); |
109
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php' ); |
110
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php' ); |
111
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php' ); |
112
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php' ); |
113
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php' ); |
114
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php' ); |
115
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php' ); |
116
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php' ); |
117
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php' ); |
118
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bitcoin.php' ); |
119
|
|
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php' ); |
120
|
|
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-compat.php' ); |
121
|
|
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-compat.php' ); |
122
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php' ); |
123
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php' ); |
124
|
|
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php' ); |
|
105
|
+ load_plugin_textdomain('woocommerce-gateway-stripe', false, plugin_basename(dirname(__FILE__)) . '/languages'); |
|
106
|
+ |
|
107
|
+ require_once(dirname(__FILE__) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php'); |
|
108
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-webhook-handler.php'); |
|
109
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-sepa-payment-token.php'); |
|
110
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-gateway-stripe.php'); |
|
111
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php'); |
|
112
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php'); |
|
113
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php'); |
|
114
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php'); |
|
115
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php'); |
|
116
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php'); |
|
117
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php'); |
|
118
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-gateway-stripe-bitcoin.php'); |
|
119
|
+ require_once(dirname(__FILE__) . '/includes/payment-methods/class-wc-stripe-payment-request.php'); |
|
120
|
+ require_once(dirname(__FILE__) . '/includes/compat/class-wc-stripe-compat.php'); |
|
121
|
+ require_once(dirname(__FILE__) . '/includes/compat/class-wc-stripe-sepa-compat.php'); |
|
122
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-order-handler.php'); |
|
123
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-payment-tokens.php'); |
|
124
|
+ require_once(dirname(__FILE__) . '/includes/class-wc-stripe-customer.php'); |
125
|
125
|
|
126
|
126
|
// REMOVE IN THE FUTURE. |
127
|
|
- require_once( dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php' ); |
|
127
|
+ require_once(dirname(__FILE__) . '/includes/deprecated/class-wc-stripe-apple-pay.php'); |
128
|
128
|
|
129
|
|
- add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) ); |
130
|
|
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); |
131
|
|
- add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) ); |
|
129
|
+ add_filter('woocommerce_payment_gateways', array($this, 'add_gateways')); |
|
130
|
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links')); |
|
131
|
+ add_filter('woocommerce_get_sections_checkout', array($this, 'filter_gateway_order_admin')); |
132
|
132
|
} |
133
|
133
|
|
134
|
134
|
/** |
|
@@ -138,23 +138,23 @@ discard block |
|
|
block discarded – undo |
138
|
138
|
* @version 4.0.0 |
139
|
139
|
*/ |
140
|
140
|
public function hide_notices() { |
141
|
|
- if ( isset( $_GET['wc-stripe-hide-notice'] ) && isset( $_GET['_wc_stripe_notice_nonce'] ) ) { |
142
|
|
- if ( ! wp_verify_nonce( $_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce' ) ) { |
143
|
|
- wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe' ) ); |
|
141
|
+ if (isset($_GET['wc-stripe-hide-notice']) && isset($_GET['_wc_stripe_notice_nonce'])) { |
|
142
|
+ if ( ! wp_verify_nonce($_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce')) { |
|
143
|
+ wp_die(__('Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe')); |
144
|
144
|
} |
145
|
145
|
|
146
|
|
- if ( ! current_user_can( 'manage_woocommerce' ) ) { |
147
|
|
- wp_die( __( 'Cheatin’ huh?', 'woocommerce-gateway-stripe' ) ); |
|
146
|
+ if ( ! current_user_can('manage_woocommerce')) { |
|
147
|
+ wp_die(__('Cheatin’ huh?', 'woocommerce-gateway-stripe')); |
148
|
148
|
} |
149
|
149
|
|
150
|
|
- $notice = wc_clean( $_GET['wc-stripe-hide-notice'] ); |
|
150
|
+ $notice = wc_clean($_GET['wc-stripe-hide-notice']); |
151
|
151
|
|
152
|
|
- switch ( $notice ) { |
|
152
|
+ switch ($notice) { |
153
|
153
|
case 'ssl': |
154
|
|
- update_option( 'wc_stripe_show_ssl_notice', 'no' ); |
|
154
|
+ update_option('wc_stripe_show_ssl_notice', 'no'); |
155
|
155
|
break; |
156
|
156
|
case 'keys': |
157
|
|
- update_option( 'wc_stripe_show_keys_notice', 'no' ); |
|
157
|
+ update_option('wc_stripe_show_keys_notice', 'no'); |
158
|
158
|
break; |
159
|
159
|
} |
160
|
160
|
} |
|
@@ -166,8 +166,8 @@ discard block |
|
|
block discarded – undo |
166
|
166
|
* @since 1.0.0 |
167
|
167
|
* @version 4.0.0 |
168
|
168
|
*/ |
169
|
|
- public function add_admin_notice( $slug, $class, $message, $dismissible = false ) { |
170
|
|
- $this->notices[ $slug ] = array( |
|
169
|
+ public function add_admin_notice($slug, $class, $message, $dismissible = false) { |
|
170
|
+ $this->notices[$slug] = array( |
171
|
171
|
'class' => $class, |
172
|
172
|
'message' => $message, |
173
|
173
|
'dismissible' => $dismissible, |
|
@@ -181,21 +181,21 @@ discard block |
|
|
block discarded – undo |
181
|
181
|
* @version 4.0.0 |
182
|
182
|
*/ |
183
|
183
|
public function admin_notices() { |
184
|
|
- if ( ! current_user_can( 'manage_woocommerce' ) ) { |
|
184
|
+ if ( ! current_user_can('manage_woocommerce')) { |
185
|
185
|
return; |
186
|
186
|
} |
187
|
187
|
|
188
|
|
- foreach ( (array) $this->notices as $notice_key => $notice ) { |
189
|
|
- echo '<div class="' . esc_attr( $notice['class'] ) . '" style="position:relative;">'; |
|
188
|
+ foreach ((array) $this->notices as $notice_key => $notice) { |
|
189
|
+ echo '<div class="' . esc_attr($notice['class']) . '" style="position:relative;">'; |
190
|
190
|
|
191
|
|
- if ( $notice['dismissible'] ) { |
|
191
|
+ if ($notice['dismissible']) { |
192
|
192
|
?> |
193
|
|
- <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-stripe-hide-notice', $notice_key ), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce' ) ); ?>" class="woocommerce-message-close notice-dismiss" style="position:absolute;right:1px;padding:9px;text-decoration:none;"></a> |
|
193
|
+ <a href="<?php echo esc_url(wp_nonce_url(add_query_arg('wc-stripe-hide-notice', $notice_key), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce')); ?>" class="woocommerce-message-close notice-dismiss" style="position:absolute;right:1px;padding:9px;text-decoration:none;"></a> |
194
|
194
|
<?php |
195
|
195
|
} |
196
|
196
|
|
197
|
197
|
echo '<p>'; |
198
|
|
- echo wp_kses( $notice['message'], array( 'a' => array( 'href' => array() ) ) ); |
|
198
|
+ echo wp_kses($notice['message'], array('a' => array('href' => array()))); |
199
|
199
|
echo '</p></div>'; |
200
|
200
|
} |
201
|
201
|
} |
|
@@ -208,26 +208,26 @@ discard block |
|
|
block discarded – undo |
208
|
208
|
* @version 4.0.0 |
209
|
209
|
*/ |
210
|
210
|
public function get_environment_warning() { |
211
|
|
- if ( version_compare( phpversion(), WC_STRIPE_MIN_PHP_VER, '<' ) ) { |
|
211
|
+ if (version_compare(phpversion(), WC_STRIPE_MIN_PHP_VER, '<')) { |
212
|
212
|
/* translators: 1) int version 2) int version */ |
213
|
|
- $message = __( 'WooCommerce Stripe - The minimum PHP version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe' ); |
|
213
|
+ $message = __('WooCommerce Stripe - The minimum PHP version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe'); |
214
|
214
|
|
215
|
|
- return sprintf( $message, WC_STRIPE_MIN_PHP_VER, phpversion() ); |
|
215
|
+ return sprintf($message, WC_STRIPE_MIN_PHP_VER, phpversion()); |
216
|
216
|
} |
217
|
217
|
|
218
|
|
- if ( ! defined( 'WC_VERSION' ) ) { |
219
|
|
- return __( 'WooCommerce Stripe requires WooCommerce to be activated to work.', 'woocommerce-gateway-stripe' ); |
|
218
|
+ if ( ! defined('WC_VERSION')) { |
|
219
|
+ return __('WooCommerce Stripe requires WooCommerce to be activated to work.', 'woocommerce-gateway-stripe'); |
220
|
220
|
} |
221
|
221
|
|
222
|
|
- if ( version_compare( WC_VERSION, WC_STRIPE_MIN_WC_VER, '<' ) ) { |
|
222
|
+ if (version_compare(WC_VERSION, WC_STRIPE_MIN_WC_VER, '<')) { |
223
|
223
|
/* translators: 1) int version 2) int version */ |
224
|
|
- $message = __( 'WooCommerce Stripe - The minimum WooCommerce version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe' ); |
|
224
|
+ $message = __('WooCommerce Stripe - The minimum WooCommerce version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe'); |
225
|
225
|
|
226
|
|
- return sprintf( $message, WC_STRIPE_MIN_WC_VER, WC_VERSION ); |
|
226
|
+ return sprintf($message, WC_STRIPE_MIN_WC_VER, WC_VERSION); |
227
|
227
|
} |
228
|
228
|
|
229
|
|
- if ( ! function_exists( 'curl_init' ) ) { |
230
|
|
- return __( 'WooCommerce Stripe - cURL is not installed.', 'woocommerce-gateway-stripe' ); |
|
229
|
+ if ( ! function_exists('curl_init')) { |
|
230
|
+ return __('WooCommerce Stripe - cURL is not installed.', 'woocommerce-gateway-stripe'); |
231
|
231
|
} |
232
|
232
|
|
233
|
233
|
return false; |
|
@@ -241,11 +241,11 @@ discard block |
|
|
block discarded – undo |
241
|
241
|
* @return string Setting link |
242
|
242
|
*/ |
243
|
243
|
public function get_setting_link() { |
244
|
|
- $use_id_as_section = function_exists( 'WC' ) ? version_compare( WC()->version, '2.6', '>=' ) : false; |
|
244
|
+ $use_id_as_section = function_exists('WC') ? version_compare(WC()->version, '2.6', '>=') : false; |
245
|
245
|
|
246
|
|
- $section_slug = $use_id_as_section ? 'stripe' : strtolower( 'WC_Gateway_Stripe' ); |
|
246
|
+ $section_slug = $use_id_as_section ? 'stripe' : strtolower('WC_Gateway_Stripe'); |
247
|
247
|
|
248
|
|
- return admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug ); |
|
248
|
+ return admin_url('admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug); |
249
|
249
|
} |
250
|
250
|
|
251
|
251
|
/** |
|
@@ -256,37 +256,37 @@ discard block |
|
|
block discarded – undo |
256
|
256
|
* @version 4.0.0 |
257
|
257
|
*/ |
258
|
258
|
public function check_environment() { |
259
|
|
- if ( ! defined( 'IFRAME_REQUEST' ) && ( WC_STRIPE_VERSION !== get_option( 'wc_stripe_version' ) ) ) { |
|
259
|
+ if ( ! defined('IFRAME_REQUEST') && (WC_STRIPE_VERSION !== get_option('wc_stripe_version'))) { |
260
|
260
|
$this->install(); |
261
|
261
|
|
262
|
|
- do_action( 'woocommerce_stripe_updated' ); |
|
262
|
+ do_action('woocommerce_stripe_updated'); |
263
|
263
|
} |
264
|
264
|
|
265
|
265
|
$environment_warning = $this->get_environment_warning(); |
266
|
266
|
|
267
|
|
- if ( $environment_warning && is_plugin_active( plugin_basename( __FILE__ ) ) ) { |
268
|
|
- $this->add_admin_notice( 'bad_environment', 'error', $environment_warning ); |
|
267
|
+ if ($environment_warning && is_plugin_active(plugin_basename(__FILE__))) { |
|
268
|
+ $this->add_admin_notice('bad_environment', 'error', $environment_warning); |
269
|
269
|
} |
270
|
270
|
|
271
|
|
- $show_ssl_notice = get_option( 'wc_stripe_show_ssl_notice' ); |
272
|
|
- $show_keys_notice = get_option( 'wc_stripe_show_keys_notice' ); |
273
|
|
- $options = get_option( 'woocommerce_stripe_settings' ); |
|
271
|
+ $show_ssl_notice = get_option('wc_stripe_show_ssl_notice'); |
|
272
|
+ $show_keys_notice = get_option('wc_stripe_show_keys_notice'); |
|
273
|
+ $options = get_option('woocommerce_stripe_settings'); |
274
|
274
|
|
275
|
|
- if ( isset( $options['enabled'] ) && 'yes' === $options['enabled'] && empty( $show_keys_notice ) ) { |
276
|
|
- $secret = WC_Stripe_API::get_secret_key(); |
|
275
|
+ if (isset($options['enabled']) && 'yes' === $options['enabled'] && empty($show_keys_notice)) { |
|
276
|
+ $secret = WC_Stripe_API::get_secret_key(); |
277
|
277
|
|
278
|
|
- if ( empty( $secret ) && ! ( isset( $_GET['page'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'] ) ) { |
|
278
|
+ if (empty($secret) && ! (isset($_GET['page'], $_GET['section']) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'])) { |
279
|
279
|
$setting_link = $this->get_setting_link(); |
280
|
280
|
/* translators: 1) link */ |
281
|
|
- $this->add_admin_notice( 'keys', 'notice notice-warning', sprintf( __( 'Stripe is almost ready. To get started, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true ); |
|
281
|
+ $this->add_admin_notice('keys', 'notice notice-warning', sprintf(__('Stripe is almost ready. To get started, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true); |
282
|
282
|
} |
283
|
283
|
} |
284
|
284
|
|
285
|
|
- if ( empty( $show_ssl_notice ) && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) { |
|
285
|
+ if (empty($show_ssl_notice) && isset($options['enabled']) && 'yes' === $options['enabled']) { |
286
|
286
|
// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected. |
287
|
|
- if ( ( function_exists( 'wc_site_is_https' ) && ! wc_site_is_https() ) && ( 'no' === get_option( 'woocommerce_force_ssl_checkout' ) && ! class_exists( 'WordPressHTTPS' ) ) ) { |
|
287
|
+ if ((function_exists('wc_site_is_https') && ! wc_site_is_https()) && ('no' === get_option('woocommerce_force_ssl_checkout') && ! class_exists('WordPressHTTPS'))) { |
288
|
288
|
/* translators: 1) link 2) link */ |
289
|
|
- $this->add_admin_notice( 'ssl', 'notice notice-warning', sprintf( __( 'Stripe is enabled, but the <a href="%1$s">force SSL option</a> is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid <a href="%2$s" target="_blank">SSL certificate</a> - Stripe will only work in test mode.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout' ), 'https://en.wikipedia.org/wiki/Transport_Layer_Security' ), true ); |
|
289
|
+ $this->add_admin_notice('ssl', 'notice notice-warning', sprintf(__('Stripe is enabled, but the <a href="%1$s">force SSL option</a> is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid <a href="%2$s" target="_blank">SSL certificate</a> - Stripe will only work in test mode.', 'woocommerce-gateway-stripe'), admin_url('admin.php?page=wc-settings&tab=checkout'), 'https://en.wikipedia.org/wiki/Transport_Layer_Security'), true); |
290
|
290
|
} |
291
|
291
|
} |
292
|
292
|
} |
|
@@ -298,8 +298,8 @@ discard block |
|
|
block discarded – undo |
298
|
298
|
* @version 4.0.0 |
299
|
299
|
*/ |
300
|
300
|
public function update_plugin_version() { |
301
|
|
- delete_option( 'wc_stripe_version' ); |
302
|
|
- update_option( 'wc_stripe_version', WC_STRIPE_VERSION ); |
|
301
|
+ delete_option('wc_stripe_version'); |
|
302
|
+ update_option('wc_stripe_version', WC_STRIPE_VERSION); |
303
|
303
|
} |
304
|
304
|
|
305
|
305
|
/** |
|
@@ -309,8 +309,8 @@ discard block |
|
|
block discarded – undo |
309
|
309
|
* @version 3.1.0 |
310
|
310
|
*/ |
311
|
311
|
public function install() { |
312
|
|
- if ( ! defined( 'WC_STRIPE_INSTALLING' ) ) { |
313
|
|
- define( 'WC_STRIPE_INSTALLING', true ); |
|
312
|
+ if ( ! defined('WC_STRIPE_INSTALLING')) { |
|
313
|
+ define('WC_STRIPE_INSTALLING', true); |
314
|
314
|
} |
315
|
315
|
|
316
|
316
|
$this->update_plugin_version(); |
|
@@ -322,13 +322,13 @@ discard block |
|
|
block discarded – undo |
322
|
322
|
* @since 1.0.0 |
323
|
323
|
* @version 4.0.0 |
324
|
324
|
*/ |
325
|
|
- public function plugin_action_links( $links ) { |
|
325
|
+ public function plugin_action_links($links) { |
326
|
326
|
$plugin_links = array( |
327
|
|
- '<a href="admin.php?page=wc-settings&tab=checkout§ion=stripe">' . esc_html__( 'Settings', 'woocommerce-gateway-stripe' ) . '</a>', |
328
|
|
- '<a href="https://docs.woocommerce.com/document/stripe/">' . esc_html__( 'Docs', 'woocommerce-gateway-stripe' ) . '</a>', |
329
|
|
- '<a href="https://woocommerce.com/contact-us/">' . esc_html__( 'Support', 'woocommerce-gateway-stripe' ) . '</a>', |
|
327
|
+ '<a href="admin.php?page=wc-settings&tab=checkout§ion=stripe">' . esc_html__('Settings', 'woocommerce-gateway-stripe') . '</a>', |
|
328
|
+ '<a href="https://docs.woocommerce.com/document/stripe/">' . esc_html__('Docs', 'woocommerce-gateway-stripe') . '</a>', |
|
329
|
+ '<a href="https://woocommerce.com/contact-us/">' . esc_html__('Support', 'woocommerce-gateway-stripe') . '</a>', |
330
|
330
|
); |
331
|
|
- return array_merge( $plugin_links, $links ); |
|
331
|
+ return array_merge($plugin_links, $links); |
332
|
332
|
} |
333
|
333
|
|
334
|
334
|
/** |
|
@@ -337,8 +337,8 @@ discard block |
|
|
block discarded – undo |
337
|
337
|
* @since 1.0.0 |
338
|
338
|
* @version 4.0.0 |
339
|
339
|
*/ |
340
|
|
- public function add_gateways( $methods ) { |
341
|
|
- if ( class_exists( 'WC_Subscriptions_Order' ) && function_exists( 'wcs_create_renewal_order' ) || class_exists( 'WC_Pre_Orders_Order' ) ) { |
|
340
|
+ public function add_gateways($methods) { |
|
341
|
+ if (class_exists('WC_Subscriptions_Order') && function_exists('wcs_create_renewal_order') || class_exists('WC_Pre_Orders_Order')) { |
342
|
342
|
$methods[] = 'WC_Stripe_Compat'; |
343
|
343
|
$methods[] = 'WC_Stripe_Sepa_Compat'; |
344
|
344
|
} else { |
|
@@ -363,26 +363,26 @@ discard block |
|
|
block discarded – undo |
363
|
363
|
* @since 4.0.0 |
364
|
364
|
* @version 4.0.0 |
365
|
365
|
*/ |
366
|
|
- public function filter_gateway_order_admin( $sections ) { |
367
|
|
- unset( $sections['stripe'] ); |
368
|
|
- unset( $sections['stripe_bancontact'] ); |
369
|
|
- unset( $sections['stripe_sofort'] ); |
370
|
|
- unset( $sections['stripe_giropay'] ); |
371
|
|
- unset( $sections['stripe_ideal'] ); |
372
|
|
- unset( $sections['stripe_p24'] ); |
373
|
|
- unset( $sections['stripe_alipay'] ); |
374
|
|
- unset( $sections['stripe_sepa'] ); |
375
|
|
- unset( $sections['stripe_bitcoin'] ); |
|
366
|
+ public function filter_gateway_order_admin($sections) { |
|
367
|
+ unset($sections['stripe']); |
|
368
|
+ unset($sections['stripe_bancontact']); |
|
369
|
+ unset($sections['stripe_sofort']); |
|
370
|
+ unset($sections['stripe_giropay']); |
|
371
|
+ unset($sections['stripe_ideal']); |
|
372
|
+ unset($sections['stripe_p24']); |
|
373
|
+ unset($sections['stripe_alipay']); |
|
374
|
+ unset($sections['stripe_sepa']); |
|
375
|
+ unset($sections['stripe_bitcoin']); |
376
|
376
|
|
377
|
377
|
$sections['stripe'] = 'Stripe'; |
378
|
|
- $sections['stripe_bancontact'] = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' ); |
379
|
|
- $sections['stripe_sofort'] = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' ); |
380
|
|
- $sections['stripe_giropay'] = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' ); |
381
|
|
- $sections['stripe_ideal'] = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' ); |
382
|
|
- $sections['stripe_p24'] = __( 'Stripe P24', 'woocommerce-gateway-stripe' ); |
383
|
|
- $sections['stripe_alipay'] = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' ); |
384
|
|
- $sections['stripe_sepa'] = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' ); |
385
|
|
- $sections['stripe_bitcoin'] = __( 'Stripe Bitcoin', 'woocommerce-gateway-stripe' ); |
|
378
|
+ $sections['stripe_bancontact'] = __('Stripe Bancontact', 'woocommerce-gateway-stripe'); |
|
379
|
+ $sections['stripe_sofort'] = __('Stripe SOFORT', 'woocommerce-gateway-stripe'); |
|
380
|
+ $sections['stripe_giropay'] = __('Stripe Giropay', 'woocommerce-gateway-stripe'); |
|
381
|
+ $sections['stripe_ideal'] = __('Stripe iDeal', 'woocommerce-gateway-stripe'); |
|
382
|
+ $sections['stripe_p24'] = __('Stripe P24', 'woocommerce-gateway-stripe'); |
|
383
|
+ $sections['stripe_alipay'] = __('Stripe Alipay', 'woocommerce-gateway-stripe'); |
|
384
|
+ $sections['stripe_sepa'] = __('Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe'); |
|
385
|
+ $sections['stripe_bitcoin'] = __('Stripe Bitcoin', 'woocommerce-gateway-stripe'); |
386
|
386
|
|
387
|
387
|
return $sections; |
388
|
388
|
} |