WooCommerce Stripe Payment Gateway - Version 4.1.5

Version Description

  • 2018-05-28 =
  • Tweak - Refactor initialization of plugin.
  • Tweak - Webhook failed handler now handles all payment methods.
  • Tweak - Make sure 3DS object is in pending status before redirecting.
  • Tweak - CSS styling.
  • Add - Username to the description field of the Stripe customer when created.
  • Add - GDPR retention setting and logic.
  • Fix - Payment request payments were redirected to Pay Order when it should be Order Received.
  • Update - Stripe API version to 2018-05-21.

See changelog for all versions.

=

Download this release

Release Info

Developer royho
Plugin Icon 128x128 WooCommerce Stripe Payment Gateway
Version 4.1.5
Comparing to
See all releases

Code changes from version 4.1.4 to 4.1.5

assets/css/stripe-styles.css CHANGED
@@ -1,14 +1,13 @@
1
- #add_payment_method #payment_method_stripe { margin: 25px 0 25px 25px; }
2
- #add_payment_method #payment_method_stripe_sepa { margin: 25px 0 25px 25px; }
3
- #add_payment_method .woocommerce-PaymentMethod label { margin-left: 10px; }
4
#add_payment_method li { clear: right; }
5
#add_payment_method #wc-stripe_sepa-form { padding: 10px; }
6
- form#order_review #payment_method_stripe { margin: 25px 0 25px 25px; }
7
form#order_review #payment_method_stripe_sepa { margin: 25px 0 25px 25px; }
8
form#order_review .payment_methods label { margin-left: 10px; }
9
form#order_review li { clear: right; }
10
form#order_review #wc-stripe_sepa-form { padding: 10px; }
11
-
12
.woocommerce-checkout #payment .payment_method_stripe,
13
#add_payment_method #payment .payment_method_stripe { position: relative; }
14
@@ -40,64 +39,64 @@ form#order_review #wc-stripe_sepa-form { padding: 10px; }
40
#add_payment_method #payment .payment_method_stripe_sofort { position: relative; }
41
42
.woocommerce-checkout #payment input#payment_method_stripe,
43
- #add_payment_method #payment input#payment_method_stripe { position: absolute; top: 6px; }
44
45
.woocommerce-checkout #payment input#payment_method_stripe_bancontact,
46
- #add_payment_method #payment input#payment_method_stripe_bancontact { position: absolute; top: 6px; }
47
48
.woocommerce-checkout #payment input#payment_method_stripe_alipay,
49
- #add_payment_method #payment input#payment_method_stripe_alipay { position: absolute; top: 6px; }
50
51
.woocommerce-checkout #payment input#payment_method_stripe_eps,
52
- #add_payment_method #payment input#payment_method_stripe_eps { position: absolute; top: 6px; }
53
54
.woocommerce-checkout #payment input#payment_method_stripe_giropay,
55
- #add_payment_method #payment input#payment_method_stripe_giropay { position: absolute; top: 6px; }
56
57
.woocommerce-checkout #payment input#payment_method_stripe_ideal,
58
- #add_payment_method #payment input#payment_method_stripe_ideal { position: absolute; top: 6px; }
59
60
.woocommerce-checkout #payment input#payment_method_stripe_multibanco,
61
- #add_payment_method #payment input#payment_method_stripe_multibanco { position: absolute; top: 6px; }
62
63
.woocommerce-checkout #payment input#payment_method_stripe_p24,
64
- #add_payment_method #payment input#payment_method_stripe_p24 { position: absolute; top: 6px; }
65
66
.woocommerce-checkout #payment input#payment_method_stripe_sepa,
67
- #add_payment_method #payment input#payment_method_stripe_sepa { position: absolute; top: 6px; }
68
69
.woocommerce-checkout #payment input#payment_method_stripe_sofort,
70
- #add_payment_method #payment input#payment_method_stripe_sofort { position: absolute; top: 6px; }
71
72
.woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe],
73
- #add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 25px; }
74
75
.woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact],
76
- #add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 25px; }
77
78
.woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay],
79
- #add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 25px; }
80
81
.woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps],
82
- #add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 25px; }
83
84
.woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay],
85
- #add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 25px; }
86
87
.woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal],
88
- #add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 25px; }
89
90
.woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco],
91
- #add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 25px; }
92
93
.woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24],
94
- #add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 25px; }
95
96
.woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa],
97
- #add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 25px; }
98
99
.woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort],
100
- #add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left: 25px; }
101
102
.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon,
103
#add_payment_method #payment ul.payment_methods li img.stripe-icon { float: right; max-width: 40px; padding-left: 3px; margin: 0; }
@@ -130,28 +129,32 @@ form#order_review #wc-stripe_sepa-form { padding: 10px; }
130
#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon { max-width: 50px; }
131
132
.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand,
133
- #add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/credit-card.svg' ); display: block; width: 30px; height: 24px; }
134
135
.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand,
136
- #add_payment_method #payment ul.payment_methods li .stripe-visa-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/visa.svg' ); display: block; width: 30px; height: 24px; }
137
138
.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand,
139
- #add_payment_method #payment ul.payment_methods li .stripe-amex-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/amex.svg' ); display: block; width: 30px; height: 24px; }
140
141
.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand,
142
- #add_payment_method #payment ul.payment_methods li .stripe-diners-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/diners.svg' ); display: block; width: 30px; height: 24px; }
143
144
.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand,
145
- #add_payment_method #payment ul.payment_methods li .stripe-discover-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/discover.svg' ); display: block; width: 30px; height: 24px; }
146
147
.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand,
148
- #add_payment_method #payment ul.payment_methods li .stripe-jcb-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/jcb.svg' ); display: block; width: 30px; height: 24px; }
149
150
.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand,
151
- #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; }
152
153
.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand,
154
- #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 10px; right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; }
155
156
.woocommerce-checkout #payment ul.payment_methods .stripe-card-group,
157
#add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; }
1
+ #add_payment_method .woocommerce-PaymentMethod > label { display: block; padding: 1.41575em; padding-top: 0; }
2
#add_payment_method li { clear: right; }
3
#add_payment_method #wc-stripe_sepa-form { padding: 10px; }
4
+ form#order_review #payment_method_stripe { margin: 0; }
5
form#order_review #payment_method_stripe_sepa { margin: 25px 0 25px 25px; }
6
form#order_review .payment_methods label { margin-left: 10px; }
7
form#order_review li { clear: right; }
8
form#order_review #wc-stripe_sepa-form { padding: 10px; }
9
+ .wc-stripe-elements-field { border:1px solid #ddd; margin:5px 0; padding:5px; background-color:#fff; outline:0; }
10
+ .clear { clear: both; }
11
.woocommerce-checkout #payment .payment_method_stripe,
12
#add_payment_method #payment .payment_method_stripe { position: relative; }
13
39
#add_payment_method #payment .payment_method_stripe_sofort { position: relative; }
40
41
.woocommerce-checkout #payment input#payment_method_stripe,
42
+ #add_payment_method #payment input#payment_method_stripe { position: absolute; }
43
44
.woocommerce-checkout #payment input#payment_method_stripe_bancontact,
45
+ #add_payment_method #payment input#payment_method_stripe_bancontact { position: absolute; }
46
47
.woocommerce-checkout #payment input#payment_method_stripe_alipay,
48
+ #add_payment_method #payment input#payment_method_stripe_alipay { position: absolute; }
49
50
.woocommerce-checkout #payment input#payment_method_stripe_eps,
51
+ #add_payment_method #payment input#payment_method_stripe_eps { position: absolute; }
52
53
.woocommerce-checkout #payment input#payment_method_stripe_giropay,
54
+ #add_payment_method #payment input#payment_method_stripe_giropay { position: absolute; }
55
56
.woocommerce-checkout #payment input#payment_method_stripe_ideal,
57
+ #add_payment_method #payment input#payment_method_stripe_ideal { position: absolute; }
58
59
.woocommerce-checkout #payment input#payment_method_stripe_multibanco,
60
+ #add_payment_method #payment input#payment_method_stripe_multibanco { position: absolute; }
61
62
.woocommerce-checkout #payment input#payment_method_stripe_p24,
63
+ #add_payment_method #payment input#payment_method_stripe_p24 { position: absolute; }
64
65
.woocommerce-checkout #payment input#payment_method_stripe_sepa,
66
+ #add_payment_method #payment input#payment_method_stripe_sepa { position: absolute; }
67
68
.woocommerce-checkout #payment input#payment_method_stripe_sofort,
69
+ #add_payment_method #payment input#payment_method_stripe_sofort { position: absolute; }
70
71
.woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe],
72
+ #add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; }
73
74
.woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact],
75
+ #add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; }
76
77
.woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay],
78
+ #add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; }
79
80
.woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps],
81
+ #add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; }
82
83
.woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay],
84
+ #add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; }
85
86
.woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal],
87
+ #add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; }
88
89
.woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco],
90
+ #add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; }
91
92
.woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24],
93
+ #add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; }
94
95
.woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa],
96
+ #add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; }
97
98
.woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort],
99
+ #add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; }
100
101
.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon,
102
#add_payment_method #payment ul.payment_methods li img.stripe-icon { float: right; max-width: 40px; padding-left: 3px; margin: 0; }
129
#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon { max-width: 50px; }
130
131
.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand,
132
+ #add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/credit-card.svg' ); display: block; width: 30px; height: 24px; }
133
134
.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand,
135
+ #add_payment_method #payment ul.payment_methods li .stripe-visa-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/visa.svg' ); display: block; width: 30px; height: 24px; }
136
137
.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand,
138
+ #add_payment_method #payment ul.payment_methods li .stripe-amex-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/amex.svg' ); display: block; width: 30px; height: 24px; }
139
140
.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand,
141
+ #add_payment_method #payment ul.payment_methods li .stripe-diners-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/diners.svg' ); display: block; width: 30px; height: 24px; }
142
143
.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand,
144
+ #add_payment_method #payment ul.payment_methods li .stripe-discover-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/discover.svg' ); display: block; width: 30px; height: 24px; }
145
146
.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand,
147
+ #add_payment_method #payment ul.payment_methods li .stripe-jcb-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/jcb.svg' ); display: block; width: 30px; height: 24px; }
148
149
.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand,
150
+ #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; }
151
152
.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand,
153
+ #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 6px; right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; }
154
155
.woocommerce-checkout #payment ul.payment_methods .stripe-card-group,
156
#add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; }
157
+
158
+ .woocommerce-SavedPaymentMethods.wc-saved-payment-methods label { display: inline; }
159
+
160
+ .woocommerce-PaymentMethods.payment_methods { list-style-type: none; }
changelog.txt CHANGED
@@ -1,5 +1,15 @@
1
*** Changelog ***
2
3
= 4.1.4 - 2018-05-22 =
4
* Tweak - Improve performance when getting source id and charge id from database.
5
* Add - GDPR privacy support.
1
*** Changelog ***
2
3
+ = 4.1.5 - 2018-05-28 =
4
+ * Tweak - Refactor initialization of plugin.
5
+ * Tweak - Webhook failed handler now handles all payment methods.
6
+ * Tweak - Make sure 3DS object is in pending status before redirecting.
7
+ * Tweak - CSS styling.
8
+ * Add - Username to the description field of the Stripe customer when created.
9
+ * Add - GDPR retention setting and logic.
10
+ * Fix - Payment request payments were redirected to Pay Order when it should be Order Received.
11
+ * Update - Stripe API version to 2018-05-21.
12
+
13
= 4.1.4 - 2018-05-22 =
14
* Tweak - Improve performance when getting source id and charge id from database.
15
* Add - GDPR privacy support.
includes/admin/class-wc-stripe-admin-notices.php CHANGED
@@ -175,9 +175,9 @@ class WC_Stripe_Admin_Notices {
175
176
if ( empty( $show_ssl_notice ) ) {
177
// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected.
178
- if ( ( function_exists( 'wc_site_is_https' ) && ! wc_site_is_https() ) && ( 'no' === get_option( 'woocommerce_force_ssl_checkout' ) && ! class_exists( 'WordPressHTTPS' ) ) ) {
179
- /* translators: 1) link 2) link */
180
- $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 );
181
}
182
}
183
}
175
176
if ( empty( $show_ssl_notice ) ) {
177
// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected.
178
+ if ( function_exists( 'wc_site_is_https' ) && ! wc_site_is_https() ) {
179
+ /* translators: 1) link */
180
+ $this->add_admin_notice( 'ssl', 'notice notice-warning', sprintf( __( 'Stripe is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href="%1$s" target="_blank">SSL certificate</a> - Stripe will only work in test mode.', 'woocommerce-gateway-stripe' ), 'https://en.wikipedia.org/wiki/Transport_Layer_Security' ), true );
181
}
182
}
183
}
includes/admin/class-wc-stripe-privacy.php CHANGED
@@ -21,6 +21,32 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
21
22
$this->add_eraser( 'woocommerce-gateway-stripe-customer-data', __( 'WooCommerce Stripe Customer Data', 'woocommerce-gateway-stripe' ), array( $this, 'customer_data_eraser' ) );
23
$this->add_eraser( 'woocommerce-gateway-stripe-order-data', __( 'WooCommerce Stripe Data', 'woocommerce-gateway-stripe' ), array( $this, 'order_data_eraser' ) );
24
}
25
26
/**
@@ -211,11 +237,15 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
211
* @return array An array of personal data in name value pairs
212
*/
213
public function customer_data_eraser( $email_address, $page ) {
214
- $page = (int) $page;
215
- $user = get_user_by( 'email', $email_address ); // Check if user has an ID in the DB to load stored personal data.
216
217
- $stripe_customer_id = get_user_meta( $user->ID, '_stripe_customer_id', true );
218
- $stripe_source_id = get_user_meta( $user->ID, '_stripe_source_id', true );
219
220
$items_removed = false;
221
$messages = array();
@@ -298,16 +328,12 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
298
return array( false, false, array() );
299
}
300
301
- $order_age = strtotime( 'now' ) - $order->get_date_created()->getTimestamp();
302
-
303
- // If order age is longer than specified days, don't do anything to it
304
- // TODO: Figure out if 180 is the real number
305
- if ( $order_age < DAY_IN_SECONDS * 180 ) {
306
- return array( false, true, array( sprintf( __( 'Order ID %d is less than 180 days (Stripe)' ), $order->get_id() ) ) );
307
}
308
309
if ( $subscription->has_status( apply_filters( 'wc_stripe_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {
310
- return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription' ), $order->get_id() ) ) );
311
}
312
313
$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );
@@ -337,6 +363,10 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
337
$stripe_refund_id = get_post_meta( $order_id, '_stripe_refund_id', true );
338
$stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
339
340
if ( empty( $stripe_source_id ) && empty( $stripe_refund_id ) && empty( $stripe_customer_id ) ) {
341
return array( false, false, array() );
342
}
@@ -347,6 +377,46 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
347
348
return array( true, false, array( __( 'Stripe personal data erased.', 'woocommerce-gateway-stripe' ) ) );
349
}
350
}
351
352
new WC_Stripe_Privacy();
21
22
$this->add_eraser( 'woocommerce-gateway-stripe-customer-data', __( 'WooCommerce Stripe Customer Data', 'woocommerce-gateway-stripe' ), array( $this, 'customer_data_eraser' ) );
23
$this->add_eraser( 'woocommerce-gateway-stripe-order-data', __( 'WooCommerce Stripe Data', 'woocommerce-gateway-stripe' ), array( $this, 'order_data_eraser' ) );
24
+
25
+ add_filter( 'woocommerce_get_settings_account', array( $this, 'account_settings' ) );
26
+ }
27
+
28
+ /**
29
+ * Add retention settings to account tab.
30
+ *
31
+ * @param array $settings
32
+ * @return array $settings Updated
33
+ */
34
+ public function account_settings( $settings ) {
35
+ $insert_setting = array(
36
+ array(
37
+ 'title' => __( 'Retain Stripe Data', 'woocommerce-gateway-stripe' ),
38
+ 'desc_tip' => __( 'Retains any Stripe data such as Stripe customer ID, source ID.', 'woocommerce-gateway-stripe' ),
39
+ 'id' => 'woocommerce_gateway_stripe_retention',
40
+ 'type' => 'relative_date_selector',
41
+ 'placeholder' => __( 'N/A', 'woocommerce-gateway-stripe' ),
42
+ 'default' => '',
43
+ 'autoload' => false,
44
+ ),
45
+ );
46
+
47
+ array_splice( $settings, ( count( $settings ) - 1 ), 0, $insert_setting );
48
+
49
+ return $settings;
50
}
51
52
/**
237
* @return array An array of personal data in name value pairs
238
*/
239
public function customer_data_eraser( $email_address, $page ) {
240
+ $page = (int) $page;
241
+ $user = get_user_by( 'email', $email_address ); // Check if user has an ID in the DB to load stored personal data.
242
+ $stripe_customer_id = '';
243
+ $stripe_source_id = '';
244
245
+ if ( $user instanceof WP_User ) {
246
+ $stripe_customer_id = get_user_meta( $user->ID, '_stripe_customer_id', true );
247
+ $stripe_source_id = get_user_meta( $user->ID, '_stripe_source_id', true );
248
+ }
249
250
$items_removed = false;
251
$messages = array();
328
return array( false, false, array() );
329
}
330
331
+ if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
332
+ return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
333
}
334
335
if ( $subscription->has_status( apply_filters( 'wc_stripe_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {
336
+ return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
337
}
338
339
$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );
363
$stripe_refund_id = get_post_meta( $order_id, '_stripe_refund_id', true );
364
$stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
365
366
+ if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
367
+ return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
368
+ }
369
+
370
if ( empty( $stripe_source_id ) && empty( $stripe_refund_id ) && empty( $stripe_customer_id ) ) {
371
return array( false, false, array() );
372
}
377
378
return array( true, false, array( __( 'Stripe personal data erased.', 'woocommerce-gateway-stripe' ) ) );
379
}
380
+
381
+ /**
382
+ * Checks if create date is passed retention duration.
383
+ *
384
+ */
385
+ public function is_retention_expired( $created_date ) {
386
+ $retention = wc_parse_relative_date_option( get_option( 'woocommerce_gateway_stripe_retention' ) );
387
+ $is_expired = false;
388
+ $time_span = time() - strtotime( $created_date );
389
+ if ( empty( $retention ) || empty( $created_date ) ) {
390
+ return false;
391
+ }
392
+ switch ( $retention['unit'] ) {
393
+ case 'days':
394
+ $retention = $retention['number'] * DAY_IN_SECONDS;
395
+ if ( $time_span > $retention ) {
396
+ $is_expired = true;
397
+ }
398
+ break;
399
+ case 'weeks':
400
+ $retention = $retention['number'] * WEEK_IN_SECONDS;
401
+ if ( $time_span > $retention ) {
402
+ $is_expired = true;
403
+ }
404
+ break;
405
+ case 'months':
406
+ $retention = $retention['number'] * MONTH_IN_SECONDS;
407
+ if ( $time_span > $retention ) {
408
+ $is_expired = true;
409
+ }
410
+ break;
411
+ case 'years':
412
+ $retention = $retention['number'] * YEAR_IN_SECONDS;
413
+ if ( $time_span > $retention ) {
414
+ $is_expired = true;
415
+ }
416
+ break;
417
+ }
418
+ return $is_expired;
419
+ }
420
}
421
422
new WC_Stripe_Privacy();
includes/class-wc-gateway-stripe.php CHANGED
@@ -361,14 +361,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
361
<?php esc_html_e( 'Credit or debit card', 'woocommerce-gateway-stripe' ); ?>
362
</label>
363
364
- <div id="stripe-card-element" style="background:#fff;padding:0 1em;border:1px solid #ddd;margin:5px 0;padding:10px 5px;">
365
<!-- a Stripe Element will be inserted here. -->
366
</div>
367
<?php } else { ?>
368
<div class="form-row form-row-wide">
369
<label for="stripe-card-element"><?php esc_html_e( 'Card Number', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
370
<div class="stripe-card-group">
371
- <div id="stripe-card-element" style="background:#fff;padding:0 1em;border:1px solid #ddd;margin:5px 0;padding:10px 5px;">
372
<!-- a Stripe Element will be inserted here. -->
373
</div>
374
@@ -379,14 +379,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
379
<div class="form-row form-row-first">
380
<label for="stripe-exp-element"><?php esc_html_e( 'Expiry Date', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
381
382
- <div id="stripe-exp-element" style="background:#fff;padding:0 1em;border:1px solid #ddd;margin:5px 0;padding:10px 5px;">
383
<!-- a Stripe Element will be inserted here. -->
384
</div>
385
</div>
386
387
<div class="form-row form-row-last">
388
<label for="stripe-cvc-element"><?php esc_html_e( 'Card Code (CVC)', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
389
- <div id="stripe-cvc-element" style="background:#fff;padding:0 1em;border:1px solid #ddd;margin:5px 0;padding:10px 5px;">
390
<!-- a Stripe Element will be inserted here. -->
391
</div>
392
</div>
@@ -626,11 +626,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
626
* @return bool
627
*/
628
public function maybe_redirect_stripe_checkout() {
629
return (
630
$this->stripe_checkout &&
631
! isset( $_POST['stripe_checkout_order'] ) &&
632
! $this->is_using_saved_payment_method() &&
633
- ! is_wc_endpoint_url( 'order-pay' )
634
);
635
}
636
@@ -723,12 +726,18 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
723
$order->save();
724
}
725
726
- WC_Stripe_Logger::log( 'Info: Redirecting to 3DS...' );
727
-
728
- return array(
729
- 'result' => 'success',
730
- 'redirect' => esc_url_raw( $response->redirect->url ),
731
- );
732
}
733
734
WC_Stripe_Logger::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
361
<?php esc_html_e( 'Credit or debit card', 'woocommerce-gateway-stripe' ); ?>
362
</label>
363
364
+ <div id="stripe-card-element" class="wc-stripe-elements-field">
365
<!-- a Stripe Element will be inserted here. -->
366
</div>
367
<?php } else { ?>
368
<div class="form-row form-row-wide">
369
<label for="stripe-card-element"><?php esc_html_e( 'Card Number', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
370
<div class="stripe-card-group">
371
+ <div id="stripe-card-element" class="wc-stripe-elements-field">
372
<!-- a Stripe Element will be inserted here. -->
373
</div>
374
379
<div class="form-row form-row-first">
380
<label for="stripe-exp-element"><?php esc_html_e( 'Expiry Date', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
381
382
+ <div id="stripe-exp-element" class="wc-stripe-elements-field">
383
<!-- a Stripe Element will be inserted here. -->
384
</div>
385
</div>
386
387
<div class="form-row form-row-last">
388
<label for="stripe-cvc-element"><?php esc_html_e( 'Card Code (CVC)', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span></label>
389
+ <div id="stripe-cvc-element" class="wc-stripe-elements-field">
390
<!-- a Stripe Element will be inserted here. -->
391
</div>
392
</div>
626
* @return bool
627
*/
628
public function maybe_redirect_stripe_checkout() {
629
+ $is_payment_request = ( isset( $_POST ) && isset( $_POST['payment_request_type'] ) );
630
+
631
return (
632
$this->stripe_checkout &&
633
! isset( $_POST['stripe_checkout_order'] ) &&
634
! $this->is_using_saved_payment_method() &&
635
+ ! is_wc_endpoint_url( 'order-pay' ) &&
636
+ ! $is_payment_request
637
);
638
}
639
726
$order->save();
727
}
728
729
+ /*
730
+ * Make sure after creating 3DS object it is in pending status
731
+ * before redirecting.
732
+ */
733
+ if ( 'pending' === $response->redirect->status ) {
734
+ WC_Stripe_Logger::log( 'Info: Redirecting to 3DS...' );
735
+
736
+ return array(
737
+ 'result' => 'success',
738
+ 'redirect' => esc_url_raw( $response->redirect->url ),
739
+ );
740
+ }
741
}
742
743
WC_Stripe_Logger::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
includes/class-wc-stripe-api.php CHANGED
@@ -14,7 +14,7 @@ class WC_Stripe_API {
14
* Stripe API Endpoint
15
*/
16
const ENDPOINT = 'https://api.stripe.com/v1/';
17
- const STRIPE_API_VERSION = '2018-02-28';
18
19
/**
20
* Secret API Key.
@@ -99,13 +99,15 @@ class WC_Stripe_API {
99
public static function request( $request, $api = 'charges', $method = 'POST', $with_headers = false ) {
100
WC_Stripe_Logger::log( "{$api} request: " . print_r( $request, true ) );
101
102
- $headers = self::get_headers();
103
104
if ( 'charges' === $api && 'POST' === $method ) {
105
- $customer = ! empty( $request['customer'] ) ? $request['customer'] : '';
106
- $source = ! empty( $request['source'] ) ? $request['source'] : $customer;
107
108
- $headers['Idempotency-Key'] = apply_filters( 'wc_stripe_idempotency_key', $request['metadata']['order_id'] . '-' . $source, $request );
109
}
110
111
$response = wp_safe_remote_post(
@@ -119,7 +121,11 @@ class WC_Stripe_API {
119
);
120
121
if ( is_wp_error( $response ) || empty( $response['body'] ) ) {
122
- WC_Stripe_Logger::log( 'Error Response: ' . print_r( $response, true ) );
123
throw new WC_Stripe_Exception( print_r( $response, true ), __( 'There was a problem connecting to the Stripe API endpoint.', 'woocommerce-gateway-stripe' ) );
124
}
125
14
* Stripe API Endpoint
15
*/
16
const ENDPOINT = 'https://api.stripe.com/v1/';
17
+ const STRIPE_API_VERSION = '2018-05-21';
18
19
/**
20
* Secret API Key.
99
public static function request( $request, $api = 'charges', $method = 'POST', $with_headers = false ) {
100
WC_Stripe_Logger::log( "{$api} request: " . print_r( $request, true ) );
101
102
+ $headers = self::get_headers();
103
+ $idempotency_key = '';
104
105
if ( 'charges' === $api && 'POST' === $method ) {
106
+ $customer = ! empty( $request['customer'] ) ? $request['customer'] : '';
107
+ $source = ! empty( $request['source'] ) ? $request['source'] : $customer;
108
+ $idempotency_key = apply_filters( 'wc_stripe_idempotency_key', $request['metadata']['order_id'] . '-' . $source, $request );
109
110
+ $headers['Idempotency-Key'] = $idempotency_key;
111
}
112
113
$response = wp_safe_remote_post(
121
);
122
123
if ( is_wp_error( $response ) || empty( $response['body'] ) ) {
124
+ WC_Stripe_Logger::log( 'Error Response: ' . print_r( $response, true ) . PHP_EOL . PHP_EOL . 'Failed request: ' . print_r( array(
125
+ 'api' => $api,
126
+ 'request' => $request,
127
+ 'idempotency_key' => $idempotency_key,
128
+ ), true ) );
129
throw new WC_Stripe_Exception( print_r( $response, true ), __( 'There was a problem connecting to the Stripe API endpoint.', 'woocommerce-gateway-stripe' ) );
130
}
131
includes/class-wc-stripe-customer.php CHANGED
@@ -100,15 +100,16 @@ class WC_Stripe_Customer {
100
*/
101
public function create_customer( $args = array() ) {
102
$billing_email = isset( $_POST['billing_email'] ) ? filter_var( $_POST['billing_email'], FILTER_SANITIZE_EMAIL ) : '';
103
- $user = $this->get_user();
104
105
if ( $user ) {
106
$billing_first_name = get_user_meta( $user->ID, 'billing_first_name', true );
107
$billing_last_name = get_user_meta( $user->ID, 'billing_last_name', true );
108
109
$defaults = array(
110
'email' => $user->user_email,
111
- 'description' => $billing_first_name . ' ' . $billing_last_name,
112
);
113
} else {
114
$defaults = array(
100
*/
101
public function create_customer( $args = array() ) {
102
$billing_email = isset( $_POST['billing_email'] ) ? filter_var( $_POST['billing_email'], FILTER_SANITIZE_EMAIL ) : '';
103
+ $user = $this->get_user();
104
105
if ( $user ) {
106
$billing_first_name = get_user_meta( $user->ID, 'billing_first_name', true );
107
$billing_last_name = get_user_meta( $user->ID, 'billing_last_name', true );
108
+ $description = __( 'Name', 'woocommerce-gateway-stripe' ) . ': ' . $billing_first_name . ' ' . $billing_last_name . ' ' . __( 'Username', 'woocommerce-gateway-stripe' ) . ': ' . $user->user_login;
109
110
$defaults = array(
111
'email' => $user->user_email,
112
+ 'description' => $description,
113
);
114
} else {
115
$defaults = array(
includes/class-wc-stripe-webhook-handler.php CHANGED
@@ -366,11 +366,10 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
366
}
367
368
/**
369
- * Process webhook charge failed. This is used for payment methods
370
- * that takes time to clear which is asynchronous. e.g. SEPA, SOFORT.
371
*
372
* @since 4.0.0
373
- * @version 4.0.0
374
* @param object $notification
375
*/
376
public function process_webhook_charge_failed( $notification ) {
@@ -383,7 +382,8 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
383
384
$order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
385
386
- if ( 'on-hold' !== $order->get_status() ) {
387
return;
388
}
389
366
}
367
368
/**
369
+ * Process webhook charge failed.
370
*
371
* @since 4.0.0
372
+ * @since 4.1.5 Can handle any fail payments from any methods.
373
* @param object $notification
374
*/
375
public function process_webhook_charge_failed( $notification ) {
382
383
$order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
384
385
+ // If order status is already in failed status don't continue.
386
+ if ( 'failed' === $order->get_status() ) {
387
return;
388
}
389
includes/payment-methods/class-wc-gateway-stripe-sepa.php CHANGED
@@ -223,13 +223,13 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
223
<label for="stripe-sepa-owner">
224
<?php esc_html_e( 'IBAN Account Name.', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span>
225
</label>
226
- <input id="stripe-sepa-owner" name="stripe_sepa_owner" value="" style="border:1px solid #ddd;margin:5px 0;padding:10px 5px;background-color:#fff;outline:0;" />
227
</p>
228
<p class="form-row form-row-wide">
229
<label for="stripe-sepa-iban">
230
<?php esc_html_e( 'IBAN Account Number.', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span>
231
</label>
232
- <input id="stripe-sepa-iban" name="stripe_sepa_iban" value="" style="border:1px solid #ddd;margin:5px 0;padding:10px 5px;background-color:#fff;outline:0;" />
233
</p>
234
<!-- Used to display form errors -->
235
<div class="stripe-source-errors" role="alert"></div>
223
<label for="stripe-sepa-owner">
224
<?php esc_html_e( 'IBAN Account Name.', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span>
225
</label>
226
+ <input id="stripe-sepa-owner" class="wc-stripe-elements-field" name="stripe_sepa_owner" value="" />
227
</p>
228
<p class="form-row form-row-wide">
229
<label for="stripe-sepa-iban">
230
<?php esc_html_e( 'IBAN Account Number.', 'woocommerce-gateway-stripe' ); ?> <span class="required">*</span>
231
</label>
232
+ <input id="stripe-sepa-iban" class="wc-stripe-elements-field" name="stripe_sepa_iban" value="" />
233
</p>
234
<!-- Used to display form errors -->
235
<div class="stripe-source-errors" role="alert"></div>
languages/woocommerce-gateway-stripe.pot CHANGED
@@ -2,10 +2,10 @@
2
# This file is distributed under the same license as the WooCommerce Stripe Gateway package.
3
msgid ""
4
msgstr ""
5
- "Project-Id-Version: WooCommerce Stripe Gateway 4.1.3\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
- "POT-Creation-Date: 2018-05-07 13:34:19+00:00\n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=utf-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
@@ -63,7 +63,7 @@ msgid "Stripe charge complete (Charge ID: %s)"
63
msgstr ""
64
65
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:464
66
- #: includes/class-wc-gateway-stripe.php:687
67
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:134
68
#: includes/compat/class-wc-stripe-subs-compat.php:96
69
msgid "Payment processing failed. Please retry."
@@ -135,12 +135,11 @@ msgid ""
135
msgstr ""
136
137
#: includes/admin/class-wc-stripe-admin-notices.php:180
138
- #. translators: 1) link 2) link
139
msgid ""
140
- "Stripe is enabled, but the <a href=\"%1$s\">force SSL option</a> is "
141
- "disabled; your checkout may not be secure! Please enable SSL and ensure "
142
- "your server has a valid <a href=\"%2$s\" target=\"_blank\">SSL "
143
- "certificate</a> - Stripe will only work in test mode."
144
msgstr ""
145
146
#: includes/admin/class-wc-stripe-admin-notices.php:203
@@ -155,6 +154,102 @@ msgstr ""
155
msgid "Cheatin&#8217; huh?"
156
msgstr ""
157
158
#: includes/admin/stripe-alipay-settings.php:9
159
msgid "Relevant Payer Geography: China"
160
msgstr ""
@@ -673,10 +768,6 @@ msgstr ""
673
msgid "You will be redirected to SOFORT."
674
msgstr ""
675
676
- #: includes/class-wc-gateway-stripe.php:116
677
- msgid "Stripe"
678
- msgstr ""
679
-
680
#: includes/class-wc-gateway-stripe.php:118
681
#. translators: 1) link to Stripe register page 2) link to Stripe api keys page
682
msgid ""
@@ -739,7 +830,7 @@ msgid "Please fill in required checkout fields first"
739
msgstr ""
740
741
#: includes/class-wc-gateway-stripe.php:478
742
- #: includes/class-wc-gateway-stripe.php:682
743
#: includes/compat/class-wc-stripe-subs-compat.php:91
744
msgid ""
745
"Sorry, we're not accepting prepaid cards at this time. Your credit card has "
@@ -758,14 +849,14 @@ msgstr ""
758
msgid "Place Order"
759
msgstr ""
760
761
- #: includes/class-wc-gateway-stripe.php:763
762
#: includes/class-wc-stripe-order-handler.php:140
763
#: includes/class-wc-stripe-webhook-handler.php:187
764
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:348
765
msgid "This card is no longer available and has been removed."
766
msgstr ""
767
768
- #: includes/class-wc-gateway-stripe.php:782
769
#: includes/class-wc-stripe-order-handler.php:158
770
#: includes/class-wc-stripe-webhook-handler.php:206
771
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:222
@@ -776,26 +867,26 @@ msgid ""
776
"later."
777
msgstr ""
778
779
- #: includes/class-wc-gateway-stripe.php:859
780
#. translators: error message
781
msgid "This represents the fee Stripe collects for the transaction."
782
msgstr ""
783
784
- #: includes/class-wc-gateway-stripe.php:860
785
msgid "Stripe Fee:"
786
msgstr ""
787
788
- #: includes/class-wc-gateway-stripe.php:896
789
msgid ""
790
"This represents the net total that will be credited to your Stripe bank "
791
"account. This may be in the currency that is set in your Stripe account."
792
msgstr ""
793
794
- #: includes/class-wc-gateway-stripe.php:897
795
msgid "Stripe Payout:"
796
msgstr ""
797
798
- #: includes/class-wc-stripe-api.php:123 includes/class-wc-stripe-api.php:154
799
msgid "There was a problem connecting to the Stripe API endpoint."
800
msgstr ""
801
@@ -824,7 +915,15 @@ msgid ""
824
"the issue. (Logging must be enabled to see recorded logs)"
825
msgstr ""
826
827
- #: includes/class-wc-stripe-customer.php:188
828
msgid "Unable to add payment source."
829
msgstr ""
830
@@ -1003,14 +1102,6 @@ msgstr ""
1003
msgid "Via SEPA Direct Debit ending in %1$s"
1004
msgstr ""
1005
1006
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:429
1007
- #: includes/compat/class-wc-stripe-subs-compat.php:481
1008
- #: includes/compat/class-wc-stripe-subs-compat.php:483
1009
- #: includes/compat/class-wc-stripe-subs-compat.php:496
1010
- #: includes/compat/class-wc-stripe-subs-compat.php:498
1011
- msgid "N/A"
1012
- msgstr ""
1013
-
1014
#: includes/compat/class-wc-stripe-subs-compat.php:481
1015
#: includes/compat/class-wc-stripe-subs-compat.php:496
1016
#. translators: 1) card brand 2) last 4 digits
@@ -1018,7 +1109,7 @@ msgid "Via %1$s card ending in %2$s"
1018
msgstr ""
1019
1020
#: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1021
- #: woocommerce-gateway-stripe.php:250
1022
msgid "Stripe Alipay"
1023
msgstr ""
1024
@@ -1047,27 +1138,27 @@ msgid "Add Payment"
1047
msgstr ""
1048
1049
#: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1050
- #: woocommerce-gateway-stripe.php:244
1051
msgid "Stripe Bancontact"
1052
msgstr ""
1053
1054
#: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1055
- #: woocommerce-gateway-stripe.php:247
1056
msgid "Stripe EPS"
1057
msgstr ""
1058
1059
#: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1060
- #: woocommerce-gateway-stripe.php:246
1061
msgid "Stripe Giropay"
1062
msgstr ""
1063
1064
#: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1065
- #: woocommerce-gateway-stripe.php:248
1066
msgid "Stripe iDeal"
1067
msgstr ""
1068
1069
#: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1070
- #: woocommerce-gateway-stripe.php:252
1071
msgid "Stripe Multibanco"
1072
msgstr ""
1073
@@ -1096,12 +1187,12 @@ msgid "Awaiting Multibanco payment"
1096
msgstr ""
1097
1098
#: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1099
- #: woocommerce-gateway-stripe.php:249
1100
msgid "Stripe P24"
1101
msgstr ""
1102
1103
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1104
- #: woocommerce-gateway-stripe.php:251
1105
msgid "Stripe SEPA Direct Debit"
1106
msgstr ""
1107
@@ -1132,7 +1223,7 @@ msgid ""
1132
msgstr ""
1133
1134
#: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1135
- #: woocommerce-gateway-stripe.php:245
1136
msgid "Stripe SOFORT"
1137
msgstr ""
1138
@@ -1179,21 +1270,22 @@ msgstr ""
1179
msgid "Discount"
1180
msgstr ""
1181
1182
- #: woocommerce-gateway-stripe.php:31
1183
msgid ""
1184
"Stripe requires WooCommerce to be installed and active. You can download %s "
1185
"here."
1186
msgstr ""
1187
1188
- #: woocommerce-gateway-stripe.php:191
1189
msgid "Settings"
1190
msgstr ""
1191
1192
- #: woocommerce-gateway-stripe.php:192
1193
msgid "Docs"
1194
msgstr ""
1195
1196
- #: woocommerce-gateway-stripe.php:193
1197
msgid "Support"
1198
msgstr ""
1199
2
# This file is distributed under the same license as the WooCommerce Stripe Gateway package.
3
msgid ""
4
msgstr ""
5
+ "Project-Id-Version: WooCommerce Stripe Gateway 4.1.4\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
+ "POT-Creation-Date: 2018-05-28 21:53:47+00:00\n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=utf-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
63
msgstr ""
64
65
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:464
66
+ #: includes/class-wc-gateway-stripe.php:690
67
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:134
68
#: includes/compat/class-wc-stripe-subs-compat.php:96
69
msgid "Payment processing failed. Please retry."
135
msgstr ""
136
137
#: includes/admin/class-wc-stripe-admin-notices.php:180
138
+ #. translators: 1) link
139
msgid ""
140
+ "Stripe is enabled, but a SSL certificate is not detected. Your checkout may "
141
+ "not be secure! Please ensure your server has a valid <a href=\"%1$s\" "
142
+ "target=\"_blank\">SSL certificate</a> - Stripe will only work in test mode."
143
msgstr ""
144
145
#: includes/admin/class-wc-stripe-admin-notices.php:203
154
msgid "Cheatin&#8217; huh?"
155
msgstr ""
156
157
+ #: includes/admin/class-wc-stripe-privacy.php:12
158
+ #: includes/class-wc-gateway-stripe.php:116
159
+ msgid "Stripe"
160
+ msgstr ""
161
+
162
+ #: includes/admin/class-wc-stripe-privacy.php:14
163
+ msgid "WooCommerce Stripe Order Data"
164
+ msgstr ""
165
+
166
+ #: includes/admin/class-wc-stripe-privacy.php:17
167
+ msgid "WooCommerce Stripe Subscriptions Data"
168
+ msgstr ""
169
+
170
+ #: includes/admin/class-wc-stripe-privacy.php:20
171
+ #: includes/admin/class-wc-stripe-privacy.php:22
172
+ msgid "WooCommerce Stripe Customer Data"
173
+ msgstr ""
174
+
175
+ #: includes/admin/class-wc-stripe-privacy.php:23
176
+ msgid "WooCommerce Stripe Data"
177
+ msgstr ""
178
+
179
+ #: includes/admin/class-wc-stripe-privacy.php:37
180
+ msgid "Retain Stripe Data"
181
+ msgstr ""
182
+
183
+ #: includes/admin/class-wc-stripe-privacy.php:38
184
+ msgid "Retains any Stripe data such as Stripe customer ID, source ID."
185
+ msgstr ""
186
+
187
+ #: includes/admin/class-wc-stripe-privacy.php:41
188
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:429
189
+ #: includes/compat/class-wc-stripe-subs-compat.php:481
190
+ #: includes/compat/class-wc-stripe-subs-compat.php:483
191
+ #: includes/compat/class-wc-stripe-subs-compat.php:496
192
+ #: includes/compat/class-wc-stripe-subs-compat.php:498
193
+ msgid "N/A"
194
+ msgstr ""
195
+
196
+ #: includes/admin/class-wc-stripe-privacy.php:83
197
+ msgid ""
198
+ "By using this extension, you may be storing personal data or sharing data "
199
+ "with an external service. <a href=\"%s\" target=\"_blank\">Learn more about "
200
+ "how this works, including what you may want to include in your privacy "
201
+ "policy.</a>"
202
+ msgstr ""
203
+
204
+ #: includes/admin/class-wc-stripe-privacy.php:106
205
+ msgid "Orders"
206
+ msgstr ""
207
+
208
+ #: includes/admin/class-wc-stripe-privacy.php:110
209
+ #: includes/admin/class-wc-stripe-privacy.php:175
210
+ #: includes/admin/class-wc-stripe-privacy.php:215
211
+ msgid "Stripe payment id"
212
+ msgstr ""
213
+
214
+ #: includes/admin/class-wc-stripe-privacy.php:114
215
+ #: includes/admin/class-wc-stripe-privacy.php:179
216
+ #: includes/admin/class-wc-stripe-privacy.php:219
217
+ msgid "Stripe customer id"
218
+ msgstr ""
219
+
220
+ #: includes/admin/class-wc-stripe-privacy.php:171
221
+ msgid "Subscriptions"
222
+ msgstr ""
223
+
224
+ #: includes/admin/class-wc-stripe-privacy.php:211
225
+ msgid "Customer Data"
226
+ msgstr ""
227
+
228
+ #: includes/admin/class-wc-stripe-privacy.php:257
229
+ msgid "Stripe User Data Erased."
230
+ msgstr ""
231
+
232
+ #: includes/admin/class-wc-stripe-privacy.php:332
233
+ #: includes/admin/class-wc-stripe-privacy.php:367
234
+ msgid ""
235
+ "Order ID %d is less than set retention days. Personal data retained. "
236
+ "(Stripe)"
237
+ msgstr ""
238
+
239
+ #: includes/admin/class-wc-stripe-privacy.php:336
240
+ msgid ""
241
+ "Order ID %d contains an active Subscription. Personal data retained. "
242
+ "(Stripe)"
243
+ msgstr ""
244
+
245
+ #: includes/admin/class-wc-stripe-privacy.php:351
246
+ msgid "Stripe Subscription Data Erased."
247
+ msgstr ""
248
+
249
+ #: includes/admin/class-wc-stripe-privacy.php:378
250
+ msgid "Stripe personal data erased."
251
+ msgstr ""
252
+
253
#: includes/admin/stripe-alipay-settings.php:9
254
msgid "Relevant Payer Geography: China"
255
msgstr ""
768
msgid "You will be redirected to SOFORT."
769
msgstr ""
770
771
#: includes/class-wc-gateway-stripe.php:118
772
#. translators: 1) link to Stripe register page 2) link to Stripe api keys page
773
msgid ""
830
msgstr ""
831
832
#: includes/class-wc-gateway-stripe.php:478
833
+ #: includes/class-wc-gateway-stripe.php:685
834
#: includes/compat/class-wc-stripe-subs-compat.php:91
835
msgid ""
836
"Sorry, we're not accepting prepaid cards at this time. Your credit card has "
849
msgid "Place Order"
850
msgstr ""
851
852
+ #: includes/class-wc-gateway-stripe.php:772
853
#: includes/class-wc-stripe-order-handler.php:140
854
#: includes/class-wc-stripe-webhook-handler.php:187
855
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:348
856
msgid "This card is no longer available and has been removed."
857
msgstr ""
858
859
+ #: includes/class-wc-gateway-stripe.php:791
860
#: includes/class-wc-stripe-order-handler.php:158
861
#: includes/class-wc-stripe-webhook-handler.php:206
862
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:222
867
"later."
868
msgstr ""
869
870
+ #: includes/class-wc-gateway-stripe.php:868
871
#. translators: error message
872
msgid "This represents the fee Stripe collects for the transaction."
873
msgstr ""
874
875
+ #: includes/class-wc-gateway-stripe.php:869
876
msgid "Stripe Fee:"
877
msgstr ""
878
879
+ #: includes/class-wc-gateway-stripe.php:905
880
msgid ""
881
"This represents the net total that will be credited to your Stripe bank "
882
"account. This may be in the currency that is set in your Stripe account."
883
msgstr ""
884
885
+ #: includes/class-wc-gateway-stripe.php:906
886
msgid "Stripe Payout:"
887
msgstr ""
888
889
+ #: includes/class-wc-stripe-api.php:129 includes/class-wc-stripe-api.php:160
890
msgid "There was a problem connecting to the Stripe API endpoint."
891
msgstr ""
892
915
"the issue. (Logging must be enabled to see recorded logs)"
916
msgstr ""
917
918
+ #: includes/class-wc-stripe-customer.php:108
919
+ msgid "Name"
920
+ msgstr ""
921
+
922
+ #: includes/class-wc-stripe-customer.php:108
923
+ msgid "Username"
924
+ msgstr ""
925
+
926
+ #: includes/class-wc-stripe-customer.php:189
927
msgid "Unable to add payment source."
928
msgstr ""
929
1102
msgid "Via SEPA Direct Debit ending in %1$s"
1103
msgstr ""
1104
1105
#: includes/compat/class-wc-stripe-subs-compat.php:481
1106
#: includes/compat/class-wc-stripe-subs-compat.php:496
1107
#. translators: 1) card brand 2) last 4 digits
1109
msgstr ""
1110
1111
#: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1112
+ #: woocommerce-gateway-stripe.php:255
1113
msgid "Stripe Alipay"
1114
msgstr ""
1115
1138
msgstr ""
1139
1140
#: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1141
+ #: woocommerce-gateway-stripe.php:249
1142
msgid "Stripe Bancontact"
1143
msgstr ""
1144
1145
#: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1146
+ #: woocommerce-gateway-stripe.php:252
1147
msgid "Stripe EPS"
1148
msgstr ""
1149
1150
#: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1151
+ #: woocommerce-gateway-stripe.php:251
1152
msgid "Stripe Giropay"
1153
msgstr ""
1154
1155
#: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1156
+ #: woocommerce-gateway-stripe.php:253
1157
msgid "Stripe iDeal"
1158
msgstr ""
1159
1160
#: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1161
+ #: woocommerce-gateway-stripe.php:257
1162
msgid "Stripe Multibanco"
1163
msgstr ""
1164
1187
msgstr ""
1188
1189
#: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1190
+ #: woocommerce-gateway-stripe.php:254
1191
msgid "Stripe P24"
1192
msgstr ""
1193
1194
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1195
+ #: woocommerce-gateway-stripe.php:256
1196
msgid "Stripe SEPA Direct Debit"
1197
msgstr ""
1198
1223
msgstr ""
1224
1225
#: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1226
+ #: woocommerce-gateway-stripe.php:250
1227
msgid "Stripe SOFORT"
1228
msgstr ""
1229
1270
msgid "Discount"
1271
msgstr ""
1272
1273
+ #: woocommerce-gateway-stripe.php:30
1274
+ #. translators: 1. URL link.
1275
msgid ""
1276
"Stripe requires WooCommerce to be installed and active. You can download %s "
1277
"here."
1278
msgstr ""
1279
1280
+ #: woocommerce-gateway-stripe.php:196
1281
msgid "Settings"
1282
msgstr ""
1283
1284
+ #: woocommerce-gateway-stripe.php:197
1285
msgid "Docs"
1286
msgstr ""
1287
1288
+ #: woocommerce-gateway-stripe.php:198
1289
msgid "Support"
1290
msgstr ""
1291
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort,
4
Requires at least: 4.4
5
Tested up to: 4.9
6
Requires PHP: 5.6
7
- Stable tag: 4.1.4
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
Attributions: thorsten-stripe
@@ -101,10 +101,15 @@ If you get stuck, you can ask for help in the Plugin Forum.
101
102
== Changelog ==
103
104
- = 4.1.4 - 2018-05-22 =
105
- * Tweak - Improve performance when getting source id and charge id from database.
106
- * Add - GDPR privacy support.
107
- * Update - WC 3.4 compatibility.
108
109
[See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
110
4
Requires at least: 4.4
5
Tested up to: 4.9
6
Requires PHP: 5.6
7
+ Stable tag: 4.1.5
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
Attributions: thorsten-stripe
101
102
== Changelog ==
103
104
+ = 4.1.5 - 2018-05-28 =
105
+ * Tweak - Refactor initialization of plugin.
106
+ * Tweak - Webhook failed handler now handles all payment methods.
107
+ * Tweak - Make sure 3DS object is in pending status before redirecting.
108
+ * Tweak - CSS styling.
109
+ * Add - Username to the description field of the Stripe customer when created.
110
+ * Add - GDPR retention setting and logic.
111
+ * Fix - Payment request payments were redirected to Pay Order when it should be Order Received.
112
+ * Update - Stripe API version to 2018-05-21.
113
114
[See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
115
woocommerce-gateway-stripe.php CHANGED
@@ -5,7 +5,7 @@
5
* Description: Take credit card payments on your store using Stripe.
6
* Author: WooCommerce
7
* Author URI: https://woocommerce.com/
8
- * Version: 4.1.4
9
* Requires at least: 4.4
10
* Tested up to: 4.9
11
* WC requires at least: 2.6
@@ -19,8 +19,6 @@ if ( ! defined( 'ABSPATH' ) ) {
19
exit;
20
}
21
22
- require_once( dirname( __FILE__ ) . '/woo-includes/woo-functions.php' );
23
-
24
/**
25
* WooCommerce fallback notice.
26
*
@@ -28,236 +26,240 @@ require_once( dirname( __FILE__ ) . '/woo-includes/woo-functions.php' );
28
* @return string
29
*/
30
function woocommerce_stripe_missing_wc_notice() {
31
echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-stripe' ), '<a href="https://woocommerce.com/" target="_blank">WooCommerce</a>' ) . '</strong></p></div>';
32
}
33
34
- if ( ! wc_stripe_is_wc_active() ) {
35
- add_action( 'admin_notices', 'woocommerce_stripe_missing_wc_notice' );
36
- return;
37
- }
38
-
39
- if ( ! class_exists( 'WC_Stripe' ) ) :
40
- /**
41
- * Required minimums and constants
42
- */
43
- define( 'WC_STRIPE_VERSION', '4.1.4' );
44
- define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
45
- define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
46
- define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
47
- define( 'WC_STRIPE_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
48
- define( 'WC_STRIPE_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
49
50
- class WC_Stripe {
51
52
- /**
53
- * @var Singleton The reference the *Singleton* instance of this class
54
- */
55
- private static $instance;
56
57
/**
58
- * @var Reference to logging class.
59
*/
60
- private static $log;
61
62
- /**
63
- * Returns the *Singleton* instance of this class.
64
- *
65
- * @return Singleton The *Singleton* instance.
66
- */
67
- public static function get_instance() {
68
- if ( null === self::$instance ) {
69
- self::$instance = new self();
70
}
71
- return self::$instance;
72
- }
73
74
- /**
75
- * Private clone method to prevent cloning of the instance of the
76
- * *Singleton* instance.
77
- *
78
- * @return void
79
- */
80
- private function __clone() {}
81
82
- /**
83
- * Private unserialize method to prevent unserializing of the *Singleton*
84
- * instance.
85
- *
86
- * @return void
87
- */
88
- private function __wakeup() {}
89
90
- /**
91
- * Protected constructor to prevent creating a new instance of the
92
- * *Singleton* via the `new` operator from outside of this class.
93
- */
94
- private function __construct() {
95
- add_action( 'admin_init', array( $this, 'install' ) );
96
- add_action( 'plugins_loaded', array( $this, 'init' ) );
97
- }
98
99
- /**
100
- * Init the plugin after plugins_loaded so environment variables are set.
101
- *
102
- * @since 1.0.0
103
- * @version 4.0.0
104
- */
105
- public function init() {
106
- if ( is_admin() ) {
107
- require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-privacy.php' );
108
- }
109
110
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-exception.php' );
111
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php' );
112
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php' );
113
- include_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php' );
114
-
115
- load_plugin_textdomain( 'woocommerce-gateway-stripe', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
116
-
117
- require_once( dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php' );
118
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php' );
119
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php' );
120
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-apple-pay-registration.php' );
121
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-pre-orders-compat.php' );
122
- require_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php' );
123
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php' );
124
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php' );
125
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php' );
126
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php' );
127
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php' );
128
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php' );
129
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php' );
130
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php' );
131
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php' );
132
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php' );
133
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php' );
134
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php' );
135
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php' );
136
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php' );
137
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php' );
138
-
139
- if ( is_admin() ) {
140
- require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-admin-notices.php' );
141
}
142
143
- // REMOVE IN THE FUTURE.
144
- require_once( dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php' );
145
-
146
- add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) );
147
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
148
-
149
- if ( version_compare( WC_VERSION, '3.4', '<' ) ) {
150
- add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) );
151
}
152
- }
153
154
- /**
155
- * Updates the plugin version in db
156
- *
157
- * @since 3.1.0
158
- * @version 4.0.0
159
- */
160
- public function update_plugin_version() {
161
- delete_option( 'wc_stripe_version' );
162
- update_option( 'wc_stripe_version', WC_STRIPE_VERSION );
163
- }
164
165
- /**
166
- * Handles upgrade routines.
167
- *
168
- * @since 3.1.0
169
- * @version 3.1.0
170
- */
171
- public function install() {
172
- if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
173
- return;
174
- }
175
176
- if ( ! defined( 'IFRAME_REQUEST' ) && ( WC_STRIPE_VERSION !== get_option( 'wc_stripe_version' ) ) ) {
177
- do_action( 'woocommerce_stripe_updated' );
178
179
- if ( ! defined( 'WC_STRIPE_INSTALLING' ) ) {
180
- define( 'WC_STRIPE_INSTALLING', true );
181
}
182
-
183
- $this->update_plugin_version();
184
}
185
- }
186
187
- /**
188
- * Adds plugin action links.
189
- *
190
- * @since 1.0.0
191
- * @version 4.0.0
192
- */
193
- public function plugin_action_links( $links ) {
194
- $plugin_links = array(
195
- '<a href="admin.php?page=wc-settings&tab=checkout&section=stripe">' . esc_html__( 'Settings', 'woocommerce-gateway-stripe' ) . '</a>',
196
- '<a href="https://docs.woocommerce.com/document/stripe/">' . esc_html__( 'Docs', 'woocommerce-gateway-stripe' ) . '</a>',
197
- '<a href="https://woocommerce.com/contact-us/">' . esc_html__( 'Support', 'woocommerce-gateway-stripe' ) . '</a>',
198
- );
199
- return array_merge( $plugin_links, $links );
200
- }
201
-
202
- /**
203
- * Add the gateways to WooCommerce.
204
- *
205
- * @since 1.0.0
206
- * @version 4.0.0
207
- */
208
- public function add_gateways( $methods ) {
209
- if ( class_exists( 'WC_Subscriptions_Order' ) && function_exists( 'wcs_create_renewal_order' ) ) {
210
- $methods[] = 'WC_Stripe_Subs_Compat';
211
- $methods[] = 'WC_Stripe_Sepa_Subs_Compat';
212
- } else {
213
- $methods[] = 'WC_Gateway_Stripe';
214
- $methods[] = 'WC_Gateway_Stripe_Sepa';
215
}
216
217
- $methods[] = 'WC_Gateway_Stripe_Bancontact';
218
- $methods[] = 'WC_Gateway_Stripe_Sofort';
219
- $methods[] = 'WC_Gateway_Stripe_Giropay';
220
- $methods[] = 'WC_Gateway_Stripe_Eps';
221
- $methods[] = 'WC_Gateway_Stripe_Ideal';
222
- $methods[] = 'WC_Gateway_Stripe_P24';
223
- $methods[] = 'WC_Gateway_Stripe_Alipay';
224
- $methods[] = 'WC_Gateway_Stripe_Multibanco';
225
226
- return $methods;
227
- }
228
229
- /**
230
- * Modifies the order of the gateways displayed in admin.
231
- *
232
- * @since 4.0.0
233
- * @version 4.0.0
234
- */
235
- public function filter_gateway_order_admin( $sections ) {
236
- unset( $sections['stripe'] );
237
- unset( $sections['stripe_bancontact'] );
238
- unset( $sections['stripe_sofort'] );
239
- unset( $sections['stripe_giropay'] );
240
- unset( $sections['stripe_eps'] );
241
- unset( $sections['stripe_ideal'] );
242
- unset( $sections['stripe_p24'] );
243
- unset( $sections['stripe_alipay'] );
244
- unset( $sections['stripe_sepa'] );
245
- unset( $sections['stripe_multibanco'] );
246
-
247
- $sections['stripe'] = 'Stripe';
248
- $sections['stripe_bancontact'] = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' );
249
- $sections['stripe_sofort'] = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' );
250
- $sections['stripe_giropay'] = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' );
251
- $sections['stripe_eps'] = __( 'Stripe EPS', 'woocommerce-gateway-stripe' );
252
- $sections['stripe_ideal'] = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' );
253
- $sections['stripe_p24'] = __( 'Stripe P24', 'woocommerce-gateway-stripe' );
254
- $sections['stripe_alipay'] = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' );
255
- $sections['stripe_sepa'] = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' );
256
- $sections['stripe_multibanco'] = __( 'Stripe Multibanco', 'woocommerce-gateway-stripe' );
257
-
258
- return $sections;
259
}
260
- }
261
262
- WC_Stripe::get_instance();
263
- endif;
5
* Description: Take credit card payments on your store using Stripe.
6
* Author: WooCommerce
7
* Author URI: https://woocommerce.com/
8
+ * Version: 4.1.5
9
* Requires at least: 4.4
10
* Tested up to: 4.9
11
* WC requires at least: 2.6
19
exit;
20
}
21
22
/**
23
* WooCommerce fallback notice.
24
*
26
* @return string
27
*/
28
function woocommerce_stripe_missing_wc_notice() {
29
+ /* translators: 1. URL link. */
30
echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-stripe' ), '<a href="https://woocommerce.com/" target="_blank">WooCommerce</a>' ) . '</strong></p></div>';
31
}
32
33
+ add_action( 'plugins_loaded', 'woocommerce_gateway_stripe_init' );
34
35
+ function woocommerce_gateway_stripe_init() {
36
+ load_plugin_textdomain( 'woocommerce-gateway-stripe', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
37
38
+ if ( ! class_exists( 'WooCommerce' ) ) {
39
+ add_action( 'admin_notices', 'woocommerce_stripe_missing_wc_notice' );
40
+ return;
41
+ }
42
43
+ if ( ! class_exists( 'WC_Stripe' ) ) :
44
/**
45
+ * Required minimums and constants
46
*/
47
+ define( 'WC_STRIPE_VERSION', '4.1.5' );
48
+ define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
49
+ define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
50
+ define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
51
+ define( 'WC_STRIPE_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
52
+ define( 'WC_STRIPE_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
53
+
54
+ class WC_Stripe {
55
+
56
+ /**
57
+ * @var Singleton The reference the *Singleton* instance of this class
58
+ */
59
+ private static $instance;
60
+
61
+ /**
62
+ * @var Reference to logging class.
63
+ */
64
+ private static $log;
65
+
66
+ /**
67
+ * Returns the *Singleton* instance of this class.
68
+ *
69
+ * @return Singleton The *Singleton* instance.
70
+ */
71
+ public static function get_instance() {
72
+ if ( null === self::$instance ) {
73
+ self::$instance = new self();
74
+ }
75
+ return self::$instance;
76
+ }
77
78
+ /**
79
+ * Private clone method to prevent cloning of the instance of the
80
+ * *Singleton* instance.
81
+ *
82
+ * @return void
83
+ */
84
+ private function __clone() {}
85
+
86
+ /**
87
+ * Private unserialize method to prevent unserializing of the *Singleton*
88
+ * instance.
89
+ *
90
+ * @return void
91
+ */
92
+ private function __wakeup() {}
93
+
94
+ /**
95
+ * Protected constructor to prevent creating a new instance of the
96
+ * *Singleton* via the `new` operator from outside of this class.
97
+ */
98
+ private function __construct() {
99
+ add_action( 'admin_init', array( $this, 'install' ) );
100
+ $this->init();
101
}
102
103
+ /**
104
+ * Init the plugin after plugins_loaded so environment variables are set.
105
+ *
106
+ * @since 1.0.0
107
+ * @version 4.0.0
108
+ */
109
+ public function init() {
110
+ if ( is_admin() ) {
111
+ require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-privacy.php' );
112
+ }
113
114
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-exception.php' );
115
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php' );
116
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php' );
117
+ include_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php' );
118
+ require_once( dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php' );
119
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php' );
120
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php' );
121
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-apple-pay-registration.php' );
122
+ require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-pre-orders-compat.php' );
123
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php' );
124
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php' );
125
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php' );
126
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php' );
127
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php' );
128
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php' );
129
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php' );
130
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php' );
131
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php' );
132
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php' );
133
+ require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php' );
134
+ require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php' );
135
+ require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php' );
136
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php' );
137
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php' );
138
+ require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php' );
139
+
140
+ if ( is_admin() ) {
141
+ require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-admin-notices.php' );
142
+ }
143
144
+ // REMOVE IN THE FUTURE.
145
+ require_once( dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php' );
146
147
+ add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) );
148
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
149
150
+ if ( version_compare( WC_VERSION, '3.4', '<' ) ) {
151
+ add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) );
152
+ }
153
}
154
155
+ /**
156
+ * Updates the plugin version in db
157
+ *
158
+ * @since 3.1.0
159
+ * @version 4.0.0
160
+ */
161
+ public function update_plugin_version() {
162
+ delete_option( 'wc_stripe_version' );
163
+ update_option( 'wc_stripe_version', WC_STRIPE_VERSION );
164
}
165
166
+ /**
167
+ * Handles upgrade routines.
168
+ *
169
+ * @since 3.1.0
170
+ * @version 3.1.0
171
+ */
172
+ public function install() {
173
+ if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
174
+ return;
175
+ }
176
177
+ if ( ! defined( 'IFRAME_REQUEST' ) && ( WC_STRIPE_VERSION !== get_option( 'wc_stripe_version' ) ) ) {
178
+ do_action( 'woocommerce_stripe_updated' );
179
180
+ if ( ! defined( 'WC_STRIPE_INSTALLING' ) ) {
181
+ define( 'WC_STRIPE_INSTALLING', true );
182
+ }
183
184
+ $this->update_plugin_version();
185
}
186
}
187
188
+ /**
189
+ * Adds plugin action links.
190
+ *
191
+ * @since 1.0.0
192
+ * @version 4.0.0
193
+ */
194
+ public function plugin_action_links( $links ) {
195
+ $plugin_links = array(
196
+ '<a href="admin.php?page=wc-settings&tab=checkout&section=stripe">' . esc_html__( 'Settings', 'woocommerce-gateway-stripe' ) . '</a>',
197
+ '<a href="https://docs.woocommerce.com/document/stripe/">' . esc_html__( 'Docs', 'woocommerce-gateway-stripe' ) . '</a>',
198
+ '<a href="https://woocommerce.com/contact-us/">' . esc_html__( 'Support', 'woocommerce-gateway-stripe' ) . '</a>',
199
+ );
200
+ return array_merge( $plugin_links, $links );
201
}
202
203
+ /**
204
+ * Add the gateways to WooCommerce.
205
+ *
206
+ * @since 1.0.0
207
+ * @version 4.0.0
208
+ */
209
+ public function add_gateways( $methods ) {
210
+ if ( class_exists( 'WC_Subscriptions_Order' ) && function_exists( 'wcs_create_renewal_order' ) ) {
211
+ $methods[] = 'WC_Stripe_Subs_Compat';
212
+ $methods[] = 'WC_Stripe_Sepa_Subs_Compat';
213
+ } else {
214
+ $methods[] = 'WC_Gateway_Stripe';
215
+ $methods[] = 'WC_Gateway_Stripe_Sepa';
216
+ }
217
218
+ $methods[] = 'WC_Gateway_Stripe_Bancontact';
219
+ $methods[] = 'WC_Gateway_Stripe_Sofort';
220
+ $methods[] = 'WC_Gateway_Stripe_Giropay';
221
+ $methods[] = 'WC_Gateway_Stripe_Eps';
222
+ $methods[] = 'WC_Gateway_Stripe_Ideal';
223
+ $methods[] = 'WC_Gateway_Stripe_P24';
224
+ $methods[] = 'WC_Gateway_Stripe_Alipay';
225
+ $methods[] = 'WC_Gateway_Stripe_Multibanco';
226
227
+ return $methods;
228
+ }
229
+
230
+ /**
231
+ * Modifies the order of the gateways displayed in admin.
232
+ *
233
+ * @since 4.0.0
234
+ * @version 4.0.0
235
+ */
236
+ public function filter_gateway_order_admin( $sections ) {
237
+ unset( $sections['stripe'] );
238
+ unset( $sections['stripe_bancontact'] );
239
+ unset( $sections['stripe_sofort'] );
240
+ unset( $sections['stripe_giropay'] );
241
+ unset( $sections['stripe_eps'] );
242
+ unset( $sections['stripe_ideal'] );
243
+ unset( $sections['stripe_p24'] );
244
+ unset( $sections['stripe_alipay'] );
245
+ unset( $sections['stripe_sepa'] );
246
+ unset( $sections['stripe_multibanco'] );
247
+
248
+ $sections['stripe'] = 'Stripe';
249
+ $sections['stripe_bancontact'] = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' );
250
+ $sections['stripe_sofort'] = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' );
251
+ $sections['stripe_giropay'] = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' );
252
+ $sections['stripe_eps'] = __( 'Stripe EPS', 'woocommerce-gateway-stripe' );
253
+ $sections['stripe_ideal'] = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' );
254
+ $sections['stripe_p24'] = __( 'Stripe P24', 'woocommerce-gateway-stripe' );
255
+ $sections['stripe_alipay'] = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' );
256
+ $sections['stripe_sepa'] = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' );
257
+ $sections['stripe_multibanco'] = __( 'Stripe Multibanco', 'woocommerce-gateway-stripe' );
258
+
259
+ return $sections;
260
+ }
261
}
262
263
+ WC_Stripe::get_instance();
264
+ endif;
265
+ }