@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_bancontact_settings', |
|
| 6 | +return apply_filters('wc_stripe_bancontact_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Belgium', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Belgium', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'guide' => array( |
| 13 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#bancontact" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#bancontact" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'activation' => array( |
| 17 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 18 | 18 | 'type' => 'title', |
| 19 | 19 | ), |
| 20 | 20 | 'enabled' => array( |
| 21 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 22 | - 'label' => __( 'Enable Stripe Bancontact', 'woocommerce-gateway-stripe' ), |
|
| 21 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 22 | + 'label' => __('Enable Stripe Bancontact', 'woocommerce-gateway-stripe'), |
|
| 23 | 23 | 'type' => 'checkbox', |
| 24 | 24 | 'description' => '', |
| 25 | 25 | 'default' => 'no', |
| 26 | 26 | ), |
| 27 | 27 | 'title' => array( |
| 28 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 28 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 29 | 29 | 'type' => 'text', |
| 30 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 31 | - 'default' => __( 'Bancontact', 'woocommerce-gateway-stripe' ), |
|
| 30 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 31 | + 'default' => __('Bancontact', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'desc_tip' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'description' => array( |
| 35 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 35 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 36 | 36 | 'type' => 'text', |
| 37 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 38 | - 'default' => __( 'You will be redirected to Bancontact.', 'woocommerce-gateway-stripe' ), |
|
| 37 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 38 | + 'default' => __('You will be redirected to Bancontact.', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'desc_tip' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'webhook' => array( |
| 42 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 42 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 43 | 43 | 'type' => 'title', |
| 44 | 44 | /* translators: webhook URL */ |
| 45 | 45 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,41 +1,41 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_p24_settings', |
|
| 6 | +return apply_filters('wc_stripe_p24_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'activation' => array( |
| 13 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'enabled' => array( |
| 17 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 18 | - 'label' => __( 'Enable Stripe P24', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 18 | + 'label' => __('Enable Stripe P24', 'woocommerce-gateway-stripe'), |
|
| 19 | 19 | 'type' => 'checkbox', |
| 20 | 20 | 'description' => '', |
| 21 | 21 | 'default' => 'no', |
| 22 | 22 | ), |
| 23 | 23 | 'title' => array( |
| 24 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 24 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 25 | 25 | 'type' => 'text', |
| 26 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 27 | - 'default' => __( 'Przelewy24 (P24)', 'woocommerce-gateway-stripe' ), |
|
| 26 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 27 | + 'default' => __('Przelewy24 (P24)', 'woocommerce-gateway-stripe'), |
|
| 28 | 28 | 'desc_tip' => true, |
| 29 | 29 | ), |
| 30 | 30 | 'description' => array( |
| 31 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 31 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'type' => 'text', |
| 33 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 34 | - 'default' => __( 'You will be redirected to P24.', 'woocommerce-gateway-stripe' ), |
|
| 33 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 34 | + 'default' => __('You will be redirected to P24.', 'woocommerce-gateway-stripe'), |
|
| 35 | 35 | 'desc_tip' => true, |
| 36 | 36 | ), |
| 37 | 37 | 'webhook' => array( |
| 38 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 38 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'type' => 'title', |
| 40 | 40 | /* translators: webhook URL */ |
| 41 | 41 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | * @since 4.1.0 |
| 22 | 22 | */ |
| 23 | 23 | public function __construct() { |
| 24 | - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
| 25 | - add_action( 'wp_loaded', array( $this, 'hide_notices' ) ); |
|
| 24 | + add_action('admin_notices', array($this, 'admin_notices')); |
|
| 25 | + add_action('wp_loaded', array($this, 'hide_notices')); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | * @since 1.0.0 |
| 32 | 32 | * @version 4.0.0 |
| 33 | 33 | */ |
| 34 | - public function add_admin_notice( $slug, $class, $message, $dismissible = false ) { |
|
| 35 | - $this->notices[ $slug ] = array( |
|
| 34 | + public function add_admin_notice($slug, $class, $message, $dismissible = false) { |
|
| 35 | + $this->notices[$slug] = array( |
|
| 36 | 36 | 'class' => $class, |
| 37 | 37 | 'message' => $message, |
| 38 | 38 | 'dismissible' => $dismissible, |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @version 4.0.0 |
| 47 | 47 | */ |
| 48 | 48 | public function admin_notices() { |
| 49 | - if ( ! current_user_can( 'manage_woocommerce' ) ) { |
|
| 49 | + if ( ! current_user_can('manage_woocommerce')) { |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -56,17 +56,17 @@ discard block |
||
| 56 | 56 | // All other payment methods. |
| 57 | 57 | $this->payment_methods_check_environment(); |
| 58 | 58 | |
| 59 | - foreach ( (array) $this->notices as $notice_key => $notice ) { |
|
| 60 | - echo '<div class="' . esc_attr( $notice['class'] ) . '" style="position:relative;">'; |
|
| 59 | + foreach ((array) $this->notices as $notice_key => $notice) { |
|
| 60 | + echo '<div class="' . esc_attr($notice['class']) . '" style="position:relative;">'; |
|
| 61 | 61 | |
| 62 | - if ( $notice['dismissible'] ) { |
|
| 62 | + if ($notice['dismissible']) { |
|
| 63 | 63 | ?> |
| 64 | - <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> |
|
| 64 | + <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> |
|
| 65 | 65 | <?php |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | echo '<p>'; |
| 69 | - echo wp_kses( $notice['message'], array( 'a' => array( 'href' => array() ) ) ); |
|
| 69 | + echo wp_kses($notice['message'], array('a' => array('href' => array()))); |
|
| 70 | 70 | echo '</p></div>'; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -100,53 +100,53 @@ discard block |
||
| 100 | 100 | * @version 4.0.0 |
| 101 | 101 | */ |
| 102 | 102 | public function stripe_check_environment() { |
| 103 | - $show_ssl_notice = get_option( 'wc_stripe_show_ssl_notice' ); |
|
| 104 | - $show_keys_notice = get_option( 'wc_stripe_show_keys_notice' ); |
|
| 105 | - $options = get_option( 'woocommerce_stripe_settings' ); |
|
| 106 | - $testmode = ( isset( $options['testmode'] ) && 'yes' === $options['testmode'] ) ? true : false; |
|
| 107 | - $test_pub_key = isset( $options['test_publishable_key'] ) ? $options['test_publishable_key'] : ''; |
|
| 108 | - $test_secret_key = isset( $options['test_secret_key'] ) ? $options['test_secret_key'] : ''; |
|
| 109 | - $live_pub_key = isset( $options['publishable_key'] ) ? $options['publishable_key'] : ''; |
|
| 110 | - $live_secret_key = isset( $options['secret_key'] ) ? $options['secret_key'] : ''; |
|
| 111 | - |
|
| 112 | - if ( isset( $options['enabled'] ) && 'yes' === $options['enabled'] && empty( $show_keys_notice ) ) { |
|
| 103 | + $show_ssl_notice = get_option('wc_stripe_show_ssl_notice'); |
|
| 104 | + $show_keys_notice = get_option('wc_stripe_show_keys_notice'); |
|
| 105 | + $options = get_option('woocommerce_stripe_settings'); |
|
| 106 | + $testmode = (isset($options['testmode']) && 'yes' === $options['testmode']) ? true : false; |
|
| 107 | + $test_pub_key = isset($options['test_publishable_key']) ? $options['test_publishable_key'] : ''; |
|
| 108 | + $test_secret_key = isset($options['test_secret_key']) ? $options['test_secret_key'] : ''; |
|
| 109 | + $live_pub_key = isset($options['publishable_key']) ? $options['publishable_key'] : ''; |
|
| 110 | + $live_secret_key = isset($options['secret_key']) ? $options['secret_key'] : ''; |
|
| 111 | + |
|
| 112 | + if (isset($options['enabled']) && 'yes' === $options['enabled'] && empty($show_keys_notice)) { |
|
| 113 | 113 | $secret = WC_Stripe_API::get_secret_key(); |
| 114 | 114 | |
| 115 | - if ( empty( $secret ) && ! ( isset( $_GET['page'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'] ) ) { |
|
| 115 | + if (empty($secret) && ! (isset($_GET['page'], $_GET['section']) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'])) { |
|
| 116 | 116 | $setting_link = $this->get_setting_link(); |
| 117 | 117 | /* translators: 1) link */ |
| 118 | - $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 ); |
|
| 118 | + $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); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // Check if keys are entered properly per live/test mode. |
| 122 | - if ( $testmode ) { |
|
| 122 | + if ($testmode) { |
|
| 123 | 123 | if ( |
| 124 | - ! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key ) |
|
| 125 | - || ( ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key ) |
|
| 126 | - && ! empty( $test_secret_key ) && ! preg_match( '/^rk_test_/', $test_secret_key ) ) ) |
|
| 124 | + ! empty($test_pub_key) && ! preg_match('/^pk_test_/', $test_pub_key) |
|
| 125 | + || ( ! empty($test_secret_key) && ! preg_match('/^sk_test_/', $test_secret_key) |
|
| 126 | + && ! empty($test_secret_key) && ! preg_match('/^rk_test_/', $test_secret_key)) ) |
|
| 127 | 127 | { |
| 128 | 128 | $setting_link = $this->get_setting_link(); |
| 129 | 129 | /* translators: 1) link */ |
| 130 | - $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true ); |
|
| 130 | + $this->add_admin_notice('keys', 'notice notice-error', sprintf(__('Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true); |
|
| 131 | 131 | } |
| 132 | 132 | } else { |
| 133 | 133 | if ( |
| 134 | - ! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key ) |
|
| 135 | - || ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key ) |
|
| 136 | - && ! empty( $live_secret_key ) && ! preg_match( '/^rk_live_/', $live_secret_key ) ) ) |
|
| 134 | + ! empty($live_pub_key) && ! preg_match('/^pk_live_/', $live_pub_key) |
|
| 135 | + || ( ! empty($live_secret_key) && ! preg_match('/^sk_live_/', $live_secret_key) |
|
| 136 | + && ! empty($live_secret_key) && ! preg_match('/^rk_live_/', $live_secret_key)) ) |
|
| 137 | 137 | { |
| 138 | 138 | $setting_link = $this->get_setting_link(); |
| 139 | 139 | /* translators: 1) link */ |
| 140 | - $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true ); |
|
| 140 | + $this->add_admin_notice('keys', 'notice notice-error', sprintf(__('Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if ( empty( $show_ssl_notice ) && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) { |
|
| 145 | + if (empty($show_ssl_notice) && isset($options['enabled']) && 'yes' === $options['enabled']) { |
|
| 146 | 146 | // Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected. |
| 147 | - if ( ( function_exists( 'wc_site_is_https' ) && ! wc_site_is_https() ) && ( 'no' === get_option( 'woocommerce_force_ssl_checkout' ) && ! class_exists( 'WordPressHTTPS' ) ) ) { |
|
| 147 | + if ((function_exists('wc_site_is_https') && ! wc_site_is_https()) && ('no' === get_option('woocommerce_force_ssl_checkout') && ! class_exists('WordPressHTTPS'))) { |
|
| 148 | 148 | /* translators: 1) link 2) link */ |
| 149 | - $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 ); |
|
| 149 | + $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); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -159,16 +159,16 @@ discard block |
||
| 159 | 159 | public function payment_methods_check_environment() { |
| 160 | 160 | $payment_methods = $this->get_payment_methods(); |
| 161 | 161 | |
| 162 | - foreach ( $payment_methods as $method => $class ) { |
|
| 163 | - $show_notice = get_option( 'wc_stripe_show_' . strtolower( $method ) . '_notice' ); |
|
| 162 | + foreach ($payment_methods as $method => $class) { |
|
| 163 | + $show_notice = get_option('wc_stripe_show_' . strtolower($method) . '_notice'); |
|
| 164 | 164 | $gateway = new $class(); |
| 165 | 165 | |
| 166 | - if ( 'yes' !== $gateway->enabled || 'no' === $show_notice ) { |
|
| 166 | + if ('yes' !== $gateway->enabled || 'no' === $show_notice) { |
|
| 167 | 167 | continue; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - if ( ! in_array( get_woocommerce_currency(), $gateway->get_supported_currency() ) ) { |
|
| 171 | - $this->add_admin_notice( $method, 'notice notice-error', sprintf( __( '%s is enabled - it requires store currency to be set to %s', 'woocommerce-gateway-stripe' ), $method, implode( ', ', $gateway->get_supported_currency() ) ), true ); |
|
| 170 | + if ( ! in_array(get_woocommerce_currency(), $gateway->get_supported_currency())) { |
|
| 171 | + $this->add_admin_notice($method, 'notice notice-error', sprintf(__('%s is enabled - it requires store currency to be set to %s', 'woocommerce-gateway-stripe'), $method, implode(', ', $gateway->get_supported_currency())), true); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -180,53 +180,53 @@ discard block |
||
| 180 | 180 | * @version 4.0.0 |
| 181 | 181 | */ |
| 182 | 182 | public function hide_notices() { |
| 183 | - if ( isset( $_GET['wc-stripe-hide-notice'] ) && isset( $_GET['_wc_stripe_notice_nonce'] ) ) { |
|
| 184 | - if ( ! wp_verify_nonce( $_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce' ) ) { |
|
| 185 | - wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe' ) ); |
|
| 183 | + if (isset($_GET['wc-stripe-hide-notice']) && isset($_GET['_wc_stripe_notice_nonce'])) { |
|
| 184 | + if ( ! wp_verify_nonce($_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce')) { |
|
| 185 | + wp_die(__('Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe')); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if ( ! current_user_can( 'manage_woocommerce' ) ) { |
|
| 189 | - wp_die( __( 'Cheatin’ huh?', 'woocommerce-gateway-stripe' ) ); |
|
| 188 | + if ( ! current_user_can('manage_woocommerce')) { |
|
| 189 | + wp_die(__('Cheatin’ huh?', 'woocommerce-gateway-stripe')); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $notice = wc_clean( $_GET['wc-stripe-hide-notice'] ); |
|
| 192 | + $notice = wc_clean($_GET['wc-stripe-hide-notice']); |
|
| 193 | 193 | |
| 194 | - switch ( $notice ) { |
|
| 194 | + switch ($notice) { |
|
| 195 | 195 | case 'ssl': |
| 196 | - update_option( 'wc_stripe_show_ssl_notice', 'no' ); |
|
| 196 | + update_option('wc_stripe_show_ssl_notice', 'no'); |
|
| 197 | 197 | break; |
| 198 | 198 | case 'keys': |
| 199 | - update_option( 'wc_stripe_show_keys_notice', 'no' ); |
|
| 199 | + update_option('wc_stripe_show_keys_notice', 'no'); |
|
| 200 | 200 | break; |
| 201 | 201 | case 'Alipay': |
| 202 | - update_option( 'wc_stripe_show_alipay_notice', 'no' ); |
|
| 202 | + update_option('wc_stripe_show_alipay_notice', 'no'); |
|
| 203 | 203 | break; |
| 204 | 204 | case 'Bancontact': |
| 205 | - update_option( 'wc_stripe_show_bancontact_notice', 'no' ); |
|
| 205 | + update_option('wc_stripe_show_bancontact_notice', 'no'); |
|
| 206 | 206 | break; |
| 207 | 207 | case 'Bitcoin': |
| 208 | - update_option( 'wc_stripe_show_bitcoin_notice', 'no' ); |
|
| 208 | + update_option('wc_stripe_show_bitcoin_notice', 'no'); |
|
| 209 | 209 | break; |
| 210 | 210 | case 'EPS': |
| 211 | - update_option( 'wc_stripe_show_eps_notice', 'no' ); |
|
| 211 | + update_option('wc_stripe_show_eps_notice', 'no'); |
|
| 212 | 212 | break; |
| 213 | 213 | case 'Giropay': |
| 214 | - update_option( 'wc_stripe_show_giropay_notice', 'no' ); |
|
| 214 | + update_option('wc_stripe_show_giropay_notice', 'no'); |
|
| 215 | 215 | break; |
| 216 | 216 | case 'iDeal': |
| 217 | - update_option( 'wc_stripe_show_ideal_notice', 'no' ); |
|
| 217 | + update_option('wc_stripe_show_ideal_notice', 'no'); |
|
| 218 | 218 | break; |
| 219 | 219 | case 'Multibanco': |
| 220 | - update_option( 'wc_stripe_show_multibanco_notice', 'no' ); |
|
| 220 | + update_option('wc_stripe_show_multibanco_notice', 'no'); |
|
| 221 | 221 | break; |
| 222 | 222 | case 'P24': |
| 223 | - update_option( 'wc_stripe_show_p24_notice', 'no' ); |
|
| 223 | + update_option('wc_stripe_show_p24_notice', 'no'); |
|
| 224 | 224 | break; |
| 225 | 225 | case 'SEPA': |
| 226 | - update_option( 'wc_stripe_show_sepa_notice', 'no' ); |
|
| 226 | + update_option('wc_stripe_show_sepa_notice', 'no'); |
|
| 227 | 227 | break; |
| 228 | 228 | case 'SOFORT': |
| 229 | - update_option( 'wc_stripe_show_sofort_notice', 'no' ); |
|
| 229 | + update_option('wc_stripe_show_sofort_notice', 'no'); |
|
| 230 | 230 | break; |
| 231 | 231 | } |
| 232 | 232 | } |
@@ -240,11 +240,11 @@ discard block |
||
| 240 | 240 | * @return string Setting link |
| 241 | 241 | */ |
| 242 | 242 | public function get_setting_link() { |
| 243 | - $use_id_as_section = function_exists( 'WC' ) ? version_compare( WC()->version, '2.6', '>=' ) : false; |
|
| 243 | + $use_id_as_section = function_exists('WC') ? version_compare(WC()->version, '2.6', '>=') : false; |
|
| 244 | 244 | |
| 245 | - $section_slug = $use_id_as_section ? 'stripe' : strtolower( 'WC_Gateway_Stripe' ); |
|
| 245 | + $section_slug = $use_id_as_section ? 'stripe' : strtolower('WC_Gateway_Stripe'); |
|
| 246 | 246 | |
| 247 | - return admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug ); |
|
| 247 | + return admin_url('admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_giropay_settings', |
|
| 6 | +return apply_filters('wc_stripe_giropay_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Germany', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Germany', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'guide' => array( |
| 13 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#giropay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#giropay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'activation' => array( |
| 17 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 18 | 18 | 'type' => 'title', |
| 19 | 19 | ), |
| 20 | 20 | 'enabled' => array( |
| 21 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 22 | - 'label' => __( 'Enable Stripe Giropay', 'woocommerce-gateway-stripe' ), |
|
| 21 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 22 | + 'label' => __('Enable Stripe Giropay', 'woocommerce-gateway-stripe'), |
|
| 23 | 23 | 'type' => 'checkbox', |
| 24 | 24 | 'description' => '', |
| 25 | 25 | 'default' => 'no', |
| 26 | 26 | ), |
| 27 | 27 | 'title' => array( |
| 28 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 28 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 29 | 29 | 'type' => 'text', |
| 30 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 31 | - 'default' => __( 'Giropay', 'woocommerce-gateway-stripe' ), |
|
| 30 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 31 | + 'default' => __('Giropay', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'desc_tip' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'description' => array( |
| 35 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 35 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 36 | 36 | 'type' => 'text', |
| 37 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 38 | - 'default' => __( 'You will be redirected to Giropay.', 'woocommerce-gateway-stripe' ), |
|
| 37 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 38 | + 'default' => __('You will be redirected to Giropay.', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'desc_tip' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'webhook' => array( |
| 42 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 42 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 43 | 43 | 'type' => 'title', |
| 44 | 44 | /* translators: webhook URL */ |
| 45 | 45 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,41 +1,41 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_multibanco_settings', |
|
| 6 | +return apply_filters('wc_stripe_multibanco_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Portugal', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Portugal', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'activation' => array( |
| 13 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'enabled' => array( |
| 17 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 18 | - 'label' => __( 'Enable Stripe Multibanco', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 18 | + 'label' => __('Enable Stripe Multibanco', 'woocommerce-gateway-stripe'), |
|
| 19 | 19 | 'type' => 'checkbox', |
| 20 | 20 | 'description' => '', |
| 21 | 21 | 'default' => 'no', |
| 22 | 22 | ), |
| 23 | 23 | 'title' => array( |
| 24 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 24 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 25 | 25 | 'type' => 'text', |
| 26 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 27 | - 'default' => __( 'Multibanco', 'woocommerce-gateway-stripe' ), |
|
| 26 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 27 | + 'default' => __('Multibanco', 'woocommerce-gateway-stripe'), |
|
| 28 | 28 | 'desc_tip' => true, |
| 29 | 29 | ), |
| 30 | 30 | 'description' => array( |
| 31 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 31 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'type' => 'text', |
| 33 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 34 | - 'default' => __( 'You will be redirected to Multibanco.', 'woocommerce-gateway-stripe' ), |
|
| 33 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 34 | + 'default' => __('You will be redirected to Multibanco.', 'woocommerce-gateway-stripe'), |
|
| 35 | 35 | 'desc_tip' => true, |
| 36 | 36 | ), |
| 37 | 37 | 'webhook' => array( |
| 38 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 38 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'type' => 'title', |
| 40 | 40 | /* translators: webhook URL */ |
| 41 | 41 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_sepa_settings', |
|
| 6 | +return apply_filters('wc_stripe_sepa_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, Luxembourg, Italy, Portugal, Austria, Ireland', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, Luxembourg, Italy, Portugal, Austria, Ireland', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'guide' => array( |
| 13 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sepa-direct-debit" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#sepa-direct-debit" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'activation' => array( |
| 17 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 18 | 18 | 'type' => 'title', |
| 19 | 19 | ), |
| 20 | 20 | 'enabled' => array( |
| 21 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 22 | - 'label' => __( 'Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' ), |
|
| 21 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 22 | + 'label' => __('Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe'), |
|
| 23 | 23 | 'type' => 'checkbox', |
| 24 | 24 | 'description' => '', |
| 25 | 25 | 'default' => 'no', |
| 26 | 26 | ), |
| 27 | 27 | 'title' => array( |
| 28 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 28 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 29 | 29 | 'type' => 'text', |
| 30 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 31 | - 'default' => __( 'SEPA Direct Debit', 'woocommerce-gateway-stripe' ), |
|
| 30 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 31 | + 'default' => __('SEPA Direct Debit', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'desc_tip' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'description' => array( |
| 35 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 35 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 36 | 36 | 'type' => 'text', |
| 37 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 38 | - 'default' => __( 'Mandate Information.', 'woocommerce-gateway-stripe' ), |
|
| 37 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 38 | + 'default' => __('Mandate Information.', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'desc_tip' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'webhook' => array( |
| 42 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 42 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 43 | 43 | 'type' => 'title', |
| 44 | 44 | /* translators: webhook URL */ |
| 45 | 45 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_bitcoin_settings', |
|
| 6 | +return apply_filters('wc_stripe_bitcoin_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Global', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Global', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'guide' => array( |
| 13 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#bitcoin" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#bitcoin" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'activation' => array( |
| 17 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 18 | 18 | 'type' => 'title', |
| 19 | 19 | ), |
| 20 | 20 | 'enabled' => array( |
| 21 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 22 | - 'label' => __( 'Enable Stripe Bitcoin', 'woocommerce-gateway-stripe' ), |
|
| 21 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 22 | + 'label' => __('Enable Stripe Bitcoin', 'woocommerce-gateway-stripe'), |
|
| 23 | 23 | 'type' => 'checkbox', |
| 24 | 24 | 'description' => '', |
| 25 | 25 | 'default' => 'no', |
| 26 | 26 | ), |
| 27 | 27 | 'title' => array( |
| 28 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 28 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 29 | 29 | 'type' => 'text', |
| 30 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 31 | - 'default' => __( 'Bitcoin', 'woocommerce-gateway-stripe' ), |
|
| 30 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 31 | + 'default' => __('Bitcoin', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'desc_tip' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'description' => array( |
| 35 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 35 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 36 | 36 | 'type' => 'text', |
| 37 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 38 | - 'default' => __( 'Bitcoin payment information will be provided when you place the order.', 'woocommerce-gateway-stripe' ), |
|
| 37 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 38 | + 'default' => __('Bitcoin payment information will be provided when you place the order.', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'desc_tip' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'webhook' => array( |
| 42 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 42 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 43 | 43 | 'type' => 'title', |
| 44 | 44 | /* translators: webhook URL */ |
| 45 | 45 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -return apply_filters( 'wc_stripe_sofort_settings', |
|
| 6 | +return apply_filters('wc_stripe_sofort_settings', |
|
| 7 | 7 | array( |
| 8 | 8 | 'geo_target' => array( |
| 9 | - 'description' => __( 'Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe' ), |
|
| 9 | + 'description' => __('Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe'), |
|
| 10 | 10 | 'type' => 'title', |
| 11 | 11 | ), |
| 12 | 12 | 'guide' => array( |
| 13 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
| 13 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
| 14 | 14 | 'type' => 'title', |
| 15 | 15 | ), |
| 16 | 16 | 'activation' => array( |
| 17 | - 'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ), |
|
| 17 | + 'description' => __('Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe'), |
|
| 18 | 18 | 'type' => 'title', |
| 19 | 19 | ), |
| 20 | 20 | 'enabled' => array( |
| 21 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
| 22 | - 'label' => __( 'Enable Stripe SOFORT', 'woocommerce-gateway-stripe' ), |
|
| 21 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
| 22 | + 'label' => __('Enable Stripe SOFORT', 'woocommerce-gateway-stripe'), |
|
| 23 | 23 | 'type' => 'checkbox', |
| 24 | 24 | 'description' => '', |
| 25 | 25 | 'default' => 'no', |
| 26 | 26 | ), |
| 27 | 27 | 'title' => array( |
| 28 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
| 28 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
| 29 | 29 | 'type' => 'text', |
| 30 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 31 | - 'default' => __( 'SOFORT', 'woocommerce-gateway-stripe' ), |
|
| 30 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 31 | + 'default' => __('SOFORT', 'woocommerce-gateway-stripe'), |
|
| 32 | 32 | 'desc_tip' => true, |
| 33 | 33 | ), |
| 34 | 34 | 'description' => array( |
| 35 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
| 35 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
| 36 | 36 | 'type' => 'text', |
| 37 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
| 38 | - 'default' => __( 'You will be redirected to SOFORT.', 'woocommerce-gateway-stripe' ), |
|
| 37 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
| 38 | + 'default' => __('You will be redirected to SOFORT.', 'woocommerce-gateway-stripe'), |
|
| 39 | 39 | 'desc_tip' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'webhook' => array( |
| 42 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
| 42 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
| 43 | 43 | 'type' => 'title', |
| 44 | 44 | /* translators: webhook URL */ |
| 45 | 45 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if ( ! defined('ABSPATH')) { |
|
| 3 | 3 | exit; // Exit if accessed directly |
| 4 | 4 | } |
| 5 | 5 | |
@@ -20,24 +20,24 @@ discard block |
||
| 20 | 20 | * @since 4.0.0 |
| 21 | 21 | * @version 4.0.0 |
| 22 | 22 | */ |
| 23 | - public static function log( $message, $start_time = null, $end_time = null ) { |
|
| 24 | - if ( apply_filters( 'wc_stripe_logging', true, $message ) ) { |
|
| 25 | - if ( empty( self::$logger ) ) { |
|
| 23 | + public static function log($message, $start_time = null, $end_time = null) { |
|
| 24 | + if (apply_filters('wc_stripe_logging', true, $message)) { |
|
| 25 | + if (empty(self::$logger)) { |
|
| 26 | 26 | self::$logger = new WC_Logger(); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $settings = get_option( 'woocommerce_stripe_settings' ); |
|
| 29 | + $settings = get_option('woocommerce_stripe_settings'); |
|
| 30 | 30 | |
| 31 | - if ( empty( $settings ) || isset( $settings['logging'] ) && 'yes' !== $settings['logging'] ) { |
|
| 31 | + if (empty($settings) || isset($settings['logging']) && 'yes' !== $settings['logging']) { |
|
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ( ! is_null( $start_time ) ) { |
|
| 35 | + if ( ! is_null($start_time)) { |
|
| 36 | 36 | |
| 37 | - $formatted_start_time = date_i18n( get_option( 'date_format' ) . ' g:ia', $start_time ); |
|
| 38 | - $end_time = is_null( $end_time ) ? current_time( 'timestamp' ) : $end_time; |
|
| 39 | - $formatted_end_time = date_i18n( get_option( 'date_format' ) . ' g:ia', $end_time ); |
|
| 40 | - $elapsed_time = round( abs( $end_time - $start_time ) / 60, 2 ); |
|
| 37 | + $formatted_start_time = date_i18n(get_option('date_format') . ' g:ia', $start_time); |
|
| 38 | + $end_time = is_null($end_time) ? current_time('timestamp') : $end_time; |
|
| 39 | + $formatted_end_time = date_i18n(get_option('date_format') . ' g:ia', $end_time); |
|
| 40 | + $elapsed_time = round(abs($end_time - $start_time) / 60, 2); |
|
| 41 | 41 | |
| 42 | 42 | $log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n"; |
| 43 | 43 | $log_entry .= '====Start Log ' . $formatted_start_time . '====' . "\n" . $message . "\n"; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - self::$logger->add( self::WC_LOG_FILENAME, $log_entry ); |
|
| 52 | + self::$logger->add(self::WC_LOG_FILENAME, $log_entry); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | } |