@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -7,40 +7,40 @@ discard block |
||
7 | 7 | 'wc_stripe_sofort_settings', |
8 | 8 | array( |
9 | 9 | 'geo_target' => array( |
10 | - 'description' => __( 'Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe' ), |
|
10 | + 'description' => __('Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'title', |
12 | 12 | ), |
13 | 13 | 'guide' => array( |
14 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
14 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
15 | 15 | 'type' => 'title', |
16 | 16 | ), |
17 | 17 | 'activation' => array( |
18 | - '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 | + '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'), |
|
19 | 19 | 'type' => 'title', |
20 | 20 | ), |
21 | 21 | 'enabled' => array( |
22 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
23 | - 'label' => __( 'Enable Stripe SOFORT', 'woocommerce-gateway-stripe' ), |
|
22 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
23 | + 'label' => __('Enable Stripe SOFORT', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'checkbox', |
25 | 25 | 'description' => '', |
26 | 26 | 'default' => 'no', |
27 | 27 | ), |
28 | 28 | 'title' => array( |
29 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
29 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
30 | 30 | 'type' => 'text', |
31 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
32 | - 'default' => __( 'SOFORT', 'woocommerce-gateway-stripe' ), |
|
31 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
32 | + 'default' => __('SOFORT', 'woocommerce-gateway-stripe'), |
|
33 | 33 | 'desc_tip' => true, |
34 | 34 | ), |
35 | 35 | 'description' => array( |
36 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
36 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
37 | 37 | 'type' => 'text', |
38 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
39 | - 'default' => __( 'You will be redirected to SOFORT.', 'woocommerce-gateway-stripe' ), |
|
38 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
39 | + 'default' => __('You will be redirected to SOFORT.', 'woocommerce-gateway-stripe'), |
|
40 | 40 | 'desc_tip' => true, |
41 | 41 | ), |
42 | 42 | 'webhook' => array( |
43 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
43 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
44 | 44 | 'type' => 'title', |
45 | 45 | /* translators: webhook URL */ |
46 | 46 | '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 | |
@@ -7,36 +7,36 @@ discard block |
||
7 | 7 | 'wc_stripe_p24_settings', |
8 | 8 | array( |
9 | 9 | 'geo_target' => array( |
10 | - 'description' => __( 'Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe' ), |
|
10 | + 'description' => __('Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'title', |
12 | 12 | ), |
13 | 13 | 'activation' => array( |
14 | - '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 | + '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'), |
|
15 | 15 | 'type' => 'title', |
16 | 16 | ), |
17 | 17 | 'enabled' => array( |
18 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
19 | - 'label' => __( 'Enable Stripe P24', 'woocommerce-gateway-stripe' ), |
|
18 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
19 | + 'label' => __('Enable Stripe P24', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'type' => 'checkbox', |
21 | 21 | 'description' => '', |
22 | 22 | 'default' => 'no', |
23 | 23 | ), |
24 | 24 | 'title' => array( |
25 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
25 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
26 | 26 | 'type' => 'text', |
27 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
28 | - 'default' => __( 'Przelewy24 (P24)', 'woocommerce-gateway-stripe' ), |
|
27 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
28 | + 'default' => __('Przelewy24 (P24)', 'woocommerce-gateway-stripe'), |
|
29 | 29 | 'desc_tip' => true, |
30 | 30 | ), |
31 | 31 | 'description' => array( |
32 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
32 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
33 | 33 | 'type' => 'text', |
34 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
35 | - 'default' => __( 'You will be redirected to P24.', 'woocommerce-gateway-stripe' ), |
|
34 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
35 | + 'default' => __('You will be redirected to P24.', 'woocommerce-gateway-stripe'), |
|
36 | 36 | 'desc_tip' => true, |
37 | 37 | ), |
38 | 38 | 'webhook' => array( |
39 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
39 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
40 | 40 | 'type' => 'title', |
41 | 41 | /* translators: webhook URL */ |
42 | 42 | '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 | |
@@ -7,40 +7,40 @@ discard block |
||
7 | 7 | 'wc_stripe_alipay_settings', |
8 | 8 | array( |
9 | 9 | 'geo_target' => array( |
10 | - 'description' => __( 'Relevant Payer Geography: China', 'woocommerce-gateway-stripe' ), |
|
10 | + 'description' => __('Relevant Payer Geography: China', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'title', |
12 | 12 | ), |
13 | 13 | 'guide' => array( |
14 | - 'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#alipay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ), |
|
14 | + 'description' => __('<a href="https://stripe.com/payments/payment-methods-guide#alipay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe'), |
|
15 | 15 | 'type' => 'title', |
16 | 16 | ), |
17 | 17 | 'activation' => array( |
18 | - '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 | + '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'), |
|
19 | 19 | 'type' => 'title', |
20 | 20 | ), |
21 | 21 | 'enabled' => array( |
22 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
23 | - 'label' => __( 'Enable Stripe Alipay', 'woocommerce-gateway-stripe' ), |
|
22 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
23 | + 'label' => __('Enable Stripe Alipay', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'checkbox', |
25 | 25 | 'description' => '', |
26 | 26 | 'default' => 'no', |
27 | 27 | ), |
28 | 28 | 'title' => array( |
29 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
29 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
30 | 30 | 'type' => 'text', |
31 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
32 | - 'default' => __( 'Alipay', 'woocommerce-gateway-stripe' ), |
|
31 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
32 | + 'default' => __('Alipay', 'woocommerce-gateway-stripe'), |
|
33 | 33 | 'desc_tip' => true, |
34 | 34 | ), |
35 | 35 | 'description' => array( |
36 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
36 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
37 | 37 | 'type' => 'text', |
38 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
39 | - 'default' => __( 'You will be redirected to Alipay.', 'woocommerce-gateway-stripe' ), |
|
38 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
39 | + 'default' => __('You will be redirected to Alipay.', 'woocommerce-gateway-stripe'), |
|
40 | 40 | 'desc_tip' => true, |
41 | 41 | ), |
42 | 42 | 'webhook' => array( |
43 | - 'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ), |
|
43 | + 'title' => __('Webhook Endpoints', 'woocommerce-gateway-stripe'), |
|
44 | 44 | 'type' => 'title', |
45 | 45 | /* translators: webhook URL */ |
46 | 46 | 'description' => $this->display_admin_settings_webhook_description(), |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @since 4.0.2 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if ( ! defined('ABSPATH')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | * @param string $error_message Full response |
24 | 24 | * @param string $localized_message user-friendly translated error message |
25 | 25 | */ |
26 | - public function __construct( $error_message = '', $localized_message = '' ) { |
|
26 | + public function __construct($error_message = '', $localized_message = '') { |
|
27 | 27 | $this->localized_message = $localized_message; |
28 | - parent::__construct( $error_message ); |
|
28 | + parent::__construct($error_message); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; // Exit if accessed directly |
4 | 4 | } |
5 | 5 | |
6 | 6 | // if uninstall not called from WordPress exit |
7 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
7 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) { |
|
8 | 8 | exit; |
9 | 9 | } |
10 | 10 | |
@@ -13,31 +13,31 @@ discard block |
||
13 | 13 | * wp-config.php. This is to prevent data loss when deleting the plugin from the backend |
14 | 14 | * and to ensure only the site owner can perform this action. |
15 | 15 | */ |
16 | -if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) { |
|
16 | +if (defined('WC_REMOVE_ALL_DATA') && true === WC_REMOVE_ALL_DATA) { |
|
17 | 17 | // Delete options. |
18 | - delete_option( 'woocommerce_stripe_settings' ); |
|
19 | - delete_option( 'wc_stripe_show_styles_notice' ); |
|
20 | - delete_option( 'wc_stripe_show_request_api_notice' ); |
|
21 | - delete_option( 'wc_stripe_show_apple_pay_notice' ); |
|
22 | - delete_option( 'wc_stripe_show_ssl_notice' ); |
|
23 | - delete_option( 'wc_stripe_show_keys_notice' ); |
|
24 | - delete_option( 'wc_stripe_show_alipay_notice' ); |
|
25 | - delete_option( 'wc_stripe_show_bancontact_notice' ); |
|
26 | - delete_option( 'wc_stripe_show_bitcoin_notice' ); |
|
27 | - delete_option( 'wc_stripe_show_eps_notice' ); |
|
28 | - delete_option( 'wc_stripe_show_giropay_notice' ); |
|
29 | - delete_option( 'wc_stripe_show_ideal_notice' ); |
|
30 | - delete_option( 'wc_stripe_show_multibanco_notice' ); |
|
31 | - delete_option( 'wc_stripe_show_p24_notice' ); |
|
32 | - delete_option( 'wc_stripe_show_sepa_notice' ); |
|
33 | - delete_option( 'wc_stripe_show_sofort_notice' ); |
|
34 | - delete_option( 'wc_stripe_version' ); |
|
35 | - delete_option( 'woocommerce_stripe_bancontact_settings' ); |
|
36 | - delete_option( 'woocommerce_stripe_alipay_settings' ); |
|
37 | - delete_option( 'woocommerce_stripe_bitcoin_settings' ); |
|
38 | - delete_option( 'woocommerce_stripe_ideal_settings' ); |
|
39 | - delete_option( 'woocommerce_stripe_p24_settings' ); |
|
40 | - delete_option( 'woocommerce_stripe_giropay_settings' ); |
|
41 | - delete_option( 'woocommerce_stripe_sepa_settings' ); |
|
42 | - delete_option( 'woocommerce_stripe_sofort_settings' ); |
|
18 | + delete_option('woocommerce_stripe_settings'); |
|
19 | + delete_option('wc_stripe_show_styles_notice'); |
|
20 | + delete_option('wc_stripe_show_request_api_notice'); |
|
21 | + delete_option('wc_stripe_show_apple_pay_notice'); |
|
22 | + delete_option('wc_stripe_show_ssl_notice'); |
|
23 | + delete_option('wc_stripe_show_keys_notice'); |
|
24 | + delete_option('wc_stripe_show_alipay_notice'); |
|
25 | + delete_option('wc_stripe_show_bancontact_notice'); |
|
26 | + delete_option('wc_stripe_show_bitcoin_notice'); |
|
27 | + delete_option('wc_stripe_show_eps_notice'); |
|
28 | + delete_option('wc_stripe_show_giropay_notice'); |
|
29 | + delete_option('wc_stripe_show_ideal_notice'); |
|
30 | + delete_option('wc_stripe_show_multibanco_notice'); |
|
31 | + delete_option('wc_stripe_show_p24_notice'); |
|
32 | + delete_option('wc_stripe_show_sepa_notice'); |
|
33 | + delete_option('wc_stripe_show_sofort_notice'); |
|
34 | + delete_option('wc_stripe_version'); |
|
35 | + delete_option('woocommerce_stripe_bancontact_settings'); |
|
36 | + delete_option('woocommerce_stripe_alipay_settings'); |
|
37 | + delete_option('woocommerce_stripe_bitcoin_settings'); |
|
38 | + delete_option('woocommerce_stripe_ideal_settings'); |
|
39 | + delete_option('woocommerce_stripe_p24_settings'); |
|
40 | + delete_option('woocommerce_stripe_giropay_settings'); |
|
41 | + delete_option('woocommerce_stripe_sepa_settings'); |
|
42 | + delete_option('woocommerce_stripe_sofort_settings'); |
|
43 | 43 | } |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; // Exit if accessed directly |
4 | 4 | } |
5 | 5 | |
6 | 6 | echo $email_heading . "\n\n"; |
7 | 7 | |
8 | 8 | // translators: %1$s: name of the blog, %2$s: link to checkout payment url, note: no full stop due to url at the end |
9 | -printf( esc_html_x( 'The automatic payment to renew your subscription with %1$s has failed. To reactivate the subscription, please login and authorize the renewal from your account page: %2$s', 'In failed renewal authentication email', 'woocommerce-gateway-stripe' ), esc_html( get_bloginfo( 'name' ) ), esc_attr( $authorization_url ) ); |
|
9 | +printf(esc_html_x('The automatic payment to renew your subscription with %1$s has failed. To reactivate the subscription, please login and authorize the renewal from your account page: %2$s', 'In failed renewal authentication email', 'woocommerce-gateway-stripe'), esc_html(get_bloginfo('name')), esc_attr($authorization_url)); |
|
10 | 10 | |
11 | 11 | echo "\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; |
12 | 12 | |
13 | -do_action( 'woocommerce_subscriptions_email_order_details', $order, $sent_to_admin, $plain_text, $email ); |
|
13 | +do_action('woocommerce_subscriptions_email_order_details', $order, $sent_to_admin, $plain_text, $email); |
|
14 | 14 | |
15 | 15 | echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; |
16 | 16 | |
17 | -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); |
|
17 | +echo apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text')); |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; // Exit if accessed directly |
4 | 4 | } |
5 | 5 | ?> |
6 | 6 | |
7 | -<?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?> |
|
7 | +<?php do_action('woocommerce_email_header', $email_heading, $email); ?> |
|
8 | 8 | |
9 | 9 | <p> |
10 | 10 | <?php |
11 | 11 | // translators: %1$s: name of the blog, %2$s: link to payment re-authentication URL, note: no full stop due to url at the end |
12 | - echo wp_kses( sprintf( _x( 'The automatic payment to renew your subscription with %1$s has failed. To reactivate the subscription, please login and authorize the renewal from your account page: %2$s', 'In failed renewal authentication email', 'woocommerce-gateway-stripe' ), esc_html( get_bloginfo( 'name' ) ), '<a href="' . esc_url( $authorization_url ) . '">' . esc_html__( 'Authorize the payment »', 'woocommerce-gateway-stripe' ) . '</a>' ), array( 'a' => array( 'href' => true ) ) ); ?> |
|
12 | + echo wp_kses(sprintf(_x('The automatic payment to renew your subscription with %1$s has failed. To reactivate the subscription, please login and authorize the renewal from your account page: %2$s', 'In failed renewal authentication email', 'woocommerce-gateway-stripe'), esc_html(get_bloginfo('name')), '<a href="' . esc_url($authorization_url) . '">' . esc_html__('Authorize the payment »', 'woocommerce-gateway-stripe') . '</a>'), array('a' => array('href' => true))); ?> |
|
13 | 13 | </p> |
14 | 14 | |
15 | -<?php do_action( 'woocommerce_subscriptions_email_order_details', $order, $sent_to_admin, $plain_text, $email ); ?> |
|
15 | +<?php do_action('woocommerce_subscriptions_email_order_details', $order, $sent_to_admin, $plain_text, $email); ?> |
|
16 | 16 | |
17 | -<?php do_action( 'woocommerce_email_footer', $email ); ?> |
|
17 | +<?php do_action('woocommerce_email_footer', $email); ?> |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'email_heading' => $this->get_heading(), |
31 | 31 | 'sent_to_admin' => false, |
32 | 32 | 'plain_text' => false, |
33 | - 'authorization_url' => $this->get_authorization_url( $this->object ), |
|
33 | + 'authorization_url' => $this->get_authorization_url($this->object), |
|
34 | 34 | 'email' => $this, |
35 | 35 | ), |
36 | 36 | '', |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'email_heading' => $this->get_heading(), |
54 | 54 | 'sent_to_admin' => false, |
55 | 55 | 'plain_text' => true, |
56 | - 'authorization_url' => $this->get_authorization_url( $this->object ), |
|
56 | + 'authorization_url' => $this->get_authorization_url($this->object), |
|
57 | 57 | 'email' => $this, |
58 | 58 | ), |
59 | 59 | '', |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @param WC_Order $order The order whose payment needs authentication. |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - public function get_authorization_url( $order ) { |
|
72 | - return add_query_arg( 'wc-stripe-confirmation', 1, $order->get_checkout_payment_url( false ) ); |
|
71 | + public function get_authorization_url($order) { |
|
72 | + return add_query_arg('wc-stripe-confirmation', 1, $order->get_checkout_payment_url(false)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | $this->form_fields = array( |
83 | 83 | 'enabled' => array( |
84 | - 'title' => _x( 'Enable/Disable', 'an email notification', 'woocommerce-gateway-stripe' ), |
|
84 | + 'title' => _x('Enable/Disable', 'an email notification', 'woocommerce-gateway-stripe'), |
|
85 | 85 | 'type' => 'checkbox', |
86 | - 'label' => __( 'Enable this email notification', 'woocommerce-gateway-stripe' ), |
|
86 | + 'label' => __('Enable this email notification', 'woocommerce-gateway-stripe'), |
|
87 | 87 | 'default' => 'yes', |
88 | 88 | ), |
89 | 89 | |
@@ -98,29 +98,29 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @param WC_Order $order The renewal order whose payment failed. |
100 | 100 | */ |
101 | - public function trigger( $order ) { |
|
102 | - if ( ! $this->is_enabled() ) { |
|
101 | + public function trigger($order) { |
|
102 | + if ( ! $this->is_enabled()) { |
|
103 | 103 | return; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $this->object = $order; |
107 | 107 | |
108 | - if ( method_exists( $order, 'get_billing_email' ) ) { |
|
108 | + if (method_exists($order, 'get_billing_email')) { |
|
109 | 109 | $this->recipient = $order->get_billing_email(); |
110 | 110 | } else { |
111 | 111 | $this->recipient = $order->billing_email; |
112 | 112 | } |
113 | 113 | |
114 | 114 | $this->find['order_date'] = '{order_date}'; |
115 | - if ( function_exists( 'wc_format_datetime' ) ) { // WC 3.0+ |
|
116 | - $this->replace['order_date'] = wc_format_datetime( $order->get_date_created() ); |
|
115 | + if (function_exists('wc_format_datetime')) { // WC 3.0+ |
|
116 | + $this->replace['order_date'] = wc_format_datetime($order->get_date_created()); |
|
117 | 117 | } else { // WC < 3.0 |
118 | - $this->replace['order_date'] = $order->date_created->date_i18n( wc_date_format() ); |
|
118 | + $this->replace['order_date'] = $order->date_created->date_i18n(wc_date_format()); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | $this->find['order_number'] = '{order_number}'; |
122 | 122 | $this->replace['order_number'] = $order->get_order_number(); |
123 | 123 | |
124 | - $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); |
|
124 | + $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments()); |
|
125 | 125 | } |
126 | 126 | } |
@@ -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 | |
@@ -21,20 +21,20 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param WC_Email[] $email_classes All existing instances of WooCommerce emails. |
23 | 23 | */ |
24 | - public function __construct( $email_classes = array() ) { |
|
24 | + public function __construct($email_classes = array()) { |
|
25 | 25 | $this->id = 'failed_preorder_sca_authentication'; |
26 | - $this->title = __( 'Pre-order Payment Action Needed', 'woocommerce-gateway-stripe' ); |
|
27 | - $this->description = __( 'This is an order notification sent to the customer once a pre-order is complete, but additional payment steps are required.', 'woocommerce-gateway-stripe' ); |
|
26 | + $this->title = __('Pre-order Payment Action Needed', 'woocommerce-gateway-stripe'); |
|
27 | + $this->description = __('This is an order notification sent to the customer once a pre-order is complete, but additional payment steps are required.', 'woocommerce-gateway-stripe'); |
|
28 | 28 | $this->customer_email = true; |
29 | 29 | |
30 | 30 | $this->template_html = 'emails/failed-preorder-authentication.php'; |
31 | 31 | $this->template_plain = 'emails/plain/failed-preorder-authentication.php'; |
32 | - $this->template_base = plugin_dir_path( WC_STRIPE_MAIN_FILE ) . 'templates/'; |
|
32 | + $this->template_base = plugin_dir_path(WC_STRIPE_MAIN_FILE) . 'templates/'; |
|
33 | 33 | |
34 | 34 | // Use the "authentication required" hook to add the correct, later hook. |
35 | - add_action( 'wc_gateway_stripe_process_payment_authentication_required', array( $this, 'trigger' ) ); |
|
35 | + add_action('wc_gateway_stripe_process_payment_authentication_required', array($this, 'trigger')); |
|
36 | 36 | |
37 | - if ( isset( $email_classes['WC_Pre_Orders_Email_Pre_Order_Available'] ) ) { |
|
37 | + if (isset($email_classes['WC_Pre_Orders_Email_Pre_Order_Available'])) { |
|
38 | 38 | $this->original_email = $email_classes['WC_Pre_Orders_Email_Pre_Order_Available']; |
39 | 39 | } |
40 | 40 | |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @param WC_Order $order The order whose payment is failing. |
50 | 50 | */ |
51 | - public function trigger( $order ) { |
|
52 | - if ( class_exists( 'WC_Pre_Orders_Order' ) && WC_Pre_Orders_Order::order_contains_pre_order( $order->get_id() ) ) { |
|
53 | - if ( isset( $this->original_email ) ) { |
|
54 | - remove_action( 'wc_pre_order_status_completed_notification', array( $this->original_email, 'trigger' ), 10, 2 ); |
|
51 | + public function trigger($order) { |
|
52 | + if (class_exists('WC_Pre_Orders_Order') && WC_Pre_Orders_Order::order_contains_pre_order($order->get_id())) { |
|
53 | + if (isset($this->original_email)) { |
|
54 | + remove_action('wc_pre_order_status_completed_notification', array($this->original_email, 'trigger'), 10, 2); |
|
55 | 55 | } |
56 | 56 | |
57 | - add_action( 'wc_pre_orders_pre_order_completed', array( $this, 'send_email' ), 10, 2 ); |
|
57 | + add_action('wc_pre_orders_pre_order_completed', array($this, 'send_email'), 10, 2); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | * @param WC_Order $order The order that is being paid. |
65 | 65 | * @param string $message The message, which should be added to the email. |
66 | 66 | */ |
67 | - public function send_email( $order, $message ) { |
|
67 | + public function send_email($order, $message) { |
|
68 | 68 | $this->custom_message = $message; |
69 | 69 | |
70 | - parent::trigger( $order ); |
|
70 | + parent::trigger($order); |
|
71 | 71 | |
72 | 72 | // Restore the action of the original email for other bulk actions. |
73 | - if ( isset( $this->original_email ) ) { |
|
74 | - add_action( 'wc_pre_order_status_completed_notification', array( $this->original_email, 'trigger' ), 10, 2 ); |
|
73 | + if (isset($this->original_email)) { |
|
74 | + add_action('wc_pre_order_status_completed_notification', array($this->original_email, 'trigger'), 10, 2); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @return string |
82 | 82 | */ |
83 | 83 | public function get_default_subject() { |
84 | - return __( 'Payment authorization needed for pre-order {order_number}', 'woocommerce-gateway-stripe' ); |
|
84 | + return __('Payment authorization needed for pre-order {order_number}', 'woocommerce-gateway-stripe'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @return string |
91 | 91 | */ |
92 | 92 | public function get_default_heading() { |
93 | - return __( 'Payment authorization needed for pre-order {order_number}', 'woocommerce-gateway-stripe' ); |
|
93 | + return __('Payment authorization needed for pre-order {order_number}', 'woocommerce-gateway-stripe'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |