WooCommerce Stripe Payment Gateway - Version 4.5.1

Version Description

  • 2020-08-12 =
  • Add - Support for Bulgaria, Czech Republic, Greece, Cyprus, Malta, Slovenia
  • Add - Additional metadata for order status change events when tracking is permitted

See changelog for all versions.

Download this release

Release Info

Developer woothemes
Plugin Icon 128x128 WooCommerce Stripe Payment Gateway
Version 4.5.1
Comparing to
See all releases

Code changes from version 4.5.0 to 4.5.1

changelog.txt CHANGED
@@ -1,5 +1,34 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 4.3.3 2020-04-08 =
4
  * Fix - Fix Payment Request issue when product attribute has quotes
5
  * Fix - Fix "no such customer" error on checkout after the keys have been changed
1
  *** Changelog ***
2
 
3
+ = 4.5.1 - 2020-08-12 =
4
+ * Add - Support for Bulgaria, Czech Republic, Greece, Cyprus, Malta, Slovenia
5
+ * Add - Additional metadata for order status change events when tracking is permitted
6
+
7
+ = 4.5.0 2020-06-24 =
8
+ * Tweak - Improve branded Google Pay button user agent detection.
9
+ * Add - New filter to manage the display of payment request buttons in cart.
10
+ * Fix - Display Apple Pay button with text if branded type is text and logo.
11
+ * Fix - Prevent branded payment request button duplication when checkout is re-calculated.
12
+ * Fix - Payment request buttons on a single product page now correctly show the product name instead of a subtotal.
13
+ * Fix - Quotes in variadic product attributes no longer cause payment request buttons to show only the cheapest variation.
14
+
15
+ = 4.4.0 2020-05-21 =
16
+ * Tweak - Remove support for WooCommerce versions lower than 3.0.
17
+ * Tweak - Update plugin assets.
18
+ * Tweak - Improve performance on order pay screen.
19
+ * Tweak - Compress payment methods SVGs.
20
+ * Add - Support for custom payment request button.
21
+ * Fix - Prevent users from entering secret key in the public key field and stop it from showing if they did.
22
+ * Fix - Revert caching layer removal to speed up My Account subscriptions tab.
23
+ * Fix - Bug where source ID was not set resulting in an uncaught exception.
24
+ * Fix - Collecting level 3 data triggers a warning.
25
+ * Fix - Custom button class typo.
26
+ * Fix - Payment Request incorrect shipping option passed.
27
+ * Fix - Payment Requests, like Apple Pay, not initially showing correct quantity if used on Product Page.
28
+ * Fix - State abbreviation breaks Payment Request button.
29
+ * Fix - Stripe Payment Request button using incorrect Google Pay brand asset by adding a special branded button.
30
+ * Fix - Move docs and support links in the plugins list page.
31
+
32
  = 4.3.3 2020-04-08 =
33
  * Fix - Fix Payment Request issue when product attribute has quotes
34
  * Fix - Fix "no such customer" error on checkout after the keys have been changed
includes/class-wc-stripe-order-handler.php CHANGED
@@ -28,6 +28,7 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
28
  add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) );
29
  add_action( 'woocommerce_order_status_cancelled', array( $this, 'cancel_payment' ) );
30
  add_action( 'woocommerce_order_status_refunded', array( $this, 'cancel_payment' ) );
 
31
  }
32
 
33
  /**
@@ -333,6 +334,50 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
333
  do_action( 'woocommerce_stripe_process_manual_cancel', $order );
334
  }
335
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
337
 
338
  new WC_Stripe_Order_Handler();
28
  add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) );
29
  add_action( 'woocommerce_order_status_cancelled', array( $this, 'cancel_payment' ) );
30
  add_action( 'woocommerce_order_status_refunded', array( $this, 'cancel_payment' ) );
31
+ add_filter( 'woocommerce_tracks_event_properties', array( $this, 'woocommerce_tracks_event_properties' ), 10, 2 );
32
  }
33
 
34
  /**
334
  do_action( 'woocommerce_stripe_process_manual_cancel', $order );
335
  }
336
  }
337
+
338
+ /**
339
+ * Filter. Adds additional meta data to Tracks events.
340
+ * Note that this filter is only called if WC_Site_Tracking::is_tracking_enabled.
341
+ *
342
+ * @since 4.5.1
343
+ * @param array Properties to be appended to.
344
+ * @param string Event name, e.g. orders_edit_status_change.
345
+ */
346
+ public function woocommerce_tracks_event_properties( $properties, $prefixed_event_name ) {
347
+ // Not the desired event? Bail.
348
+ if ( 'wcadmin_orders_edit_status_change' != $prefixed_event_name ) {
349
+ return $properties;
350
+ }
351
+
352
+ // Properties not an array? Bail.
353
+ if ( ! is_array( $properties ) ) {
354
+ return $properties;
355
+ }
356
+
357
+ // No payment_method in properties? Bail.
358
+ if ( ! array_key_exists( 'payment_method', $properties ) ) {
359
+ return $properties;
360
+ }
361
+
362
+ // Not stripe? Bail.
363
+ if ( 'stripe' != $properties[ 'payment_method' ] ) {
364
+ return $properties;
365
+ }
366
+
367
+ // Due diligence done. Collect the metadata.
368
+ $is_live = true;
369
+ $stripe_settings = get_option( 'woocommerce_stripe_settings', array() );
370
+ if ( array_key_exists( 'testmode', $stripe_settings ) ) {
371
+ $is_live = 'no' === $stripe_settings[ 'testmode' ];
372
+ }
373
+
374
+ $properties[ 'admin_email' ] = get_option( 'admin_email' );
375
+ $properties[ 'is_live' ] = $is_live;
376
+ $properties[ 'woocommerce_gateway_stripe_version' ] = WC_STRIPE_VERSION;
377
+ $properties[ 'woocommerce_default_country' ] = get_option( 'woocommerce_default_country' );
378
+
379
+ return $properties;
380
+ }
381
  }
382
 
383
  new WC_Stripe_Order_Handler();
includes/payment-methods/class-wc-stripe-payment-request.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  /**
3
  * Stripe Payment Request API
 
 
4
  *
5
  * @package WooCommerce_Stripe/Classes/Payment_Request
6
  * @since 4.0.0
@@ -92,26 +94,10 @@ class WC_Stripe_Payment_Request {
92
  return;
93
  }
94
 
95
- $wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 );
96
-
97
- if ( ! in_array( $wc_default_country, $this->get_stripe_supported_countries() ) ) {
98
- return;
99
- }
100
-
101
  add_action( 'template_redirect', array( $this, 'set_session' ) );
102
  $this->init();
103
  }
104
 
105
- /**
106
- * List of supported countries by Stripe.
107
- *
108
- * @since 4.1.3
109
- * @return array The list of countries.
110
- */
111
- public function get_stripe_supported_countries() {
112
- return apply_filters( 'wc_stripe_supported_countries', array( 'AT', 'AU', 'BE', 'BR', 'CA', 'CH', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'HK', 'IE', 'IN', 'IT', 'JP', 'LT', 'LU', 'LV', 'MX', 'NL', 'NZ', 'NO', 'PH', 'PL', 'PR', 'PT', 'RO', 'SE', 'SG', 'SK', 'US' ) );
113
- }
114
-
115
  /**
116
  * Checks if keys are set and valid.
117
  *
1
  <?php
2
  /**
3
  * Stripe Payment Request API
4
+ * Adds support for Apple Pay and Chrome Payment Request API buttons.
5
+ * Utilizes the Stripe Payment Request Button to support checkout from the product detail and cart pages.
6
  *
7
  * @package WooCommerce_Stripe/Classes/Payment_Request
8
  * @since 4.0.0
94
  return;
95
  }
96
 
 
 
 
 
 
 
97
  add_action( 'template_redirect', array( $this, 'set_session' ) );
98
  $this->init();
99
  }
100
 
 
 
 
 
 
 
 
 
 
 
101
  /**
102
  * Checks if keys are set and valid.
103
  *
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.5.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
- "POT-Creation-Date: 2020-06-24 03:55: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"
@@ -55,7 +55,7 @@ msgid "Stripe charge awaiting payment: %s."
55
  msgstr ""
56
 
57
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:436
58
- #: includes/class-wc-stripe-order-handler.php:297
59
  #: includes/class-wc-stripe-webhook-handler.php:340
60
  #: includes/class-wc-stripe-webhook-handler.php:390
61
  #. translators: transaction id
@@ -920,7 +920,7 @@ msgid "Stripe Payout:"
920
  msgstr ""
921
 
922
  #: includes/class-wc-gateway-stripe.php:824
923
- #: includes/class-wc-stripe-order-handler.php:157
924
  #: includes/class-wc-stripe-webhook-handler.php:233
925
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:278
926
  #: includes/compat/class-wc-stripe-subs-compat.php:317
@@ -1081,7 +1081,7 @@ msgid "An error occurred while processing the card."
1081
  msgstr ""
1082
 
1083
  #: includes/class-wc-stripe-helper.php:212
1084
- #: includes/class-wc-stripe-order-handler.php:95
1085
  msgid "Unable to process this payment, please try again or use alternative method."
1086
  msgstr ""
1087
 
@@ -1106,21 +1106,21 @@ msgstr ""
1106
  msgid "Payment verification error: %s"
1107
  msgstr ""
1108
 
1109
- #: includes/class-wc-stripe-order-handler.php:139
1110
  #: includes/class-wc-stripe-webhook-handler.php:214
1111
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:349
1112
  msgid "This card is no longer available and has been removed."
1113
  msgstr ""
1114
 
1115
- #: includes/class-wc-stripe-order-handler.php:189
1116
  #. translators: error message
1117
  msgid "Stripe payment failed: %s"
1118
  msgstr ""
1119
 
1120
- #: includes/class-wc-stripe-order-handler.php:240
1121
- #: includes/class-wc-stripe-order-handler.php:255
1122
- #: includes/class-wc-stripe-order-handler.php:271
1123
- #: includes/class-wc-stripe-order-handler.php:286
1124
  #. translators: error message
1125
  msgid "Unable to capture charge! %s"
1126
  msgstr ""
@@ -1315,7 +1315,7 @@ msgid ""
1315
  msgstr ""
1316
 
1317
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1318
- #: woocommerce-gateway-stripe.php:292
1319
  msgid "Stripe Alipay"
1320
  msgstr ""
1321
 
@@ -1344,27 +1344,27 @@ msgid "Add Payment"
1344
  msgstr ""
1345
 
1346
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1347
- #: woocommerce-gateway-stripe.php:286
1348
  msgid "Stripe Bancontact"
1349
  msgstr ""
1350
 
1351
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1352
- #: woocommerce-gateway-stripe.php:289
1353
  msgid "Stripe EPS"
1354
  msgstr ""
1355
 
1356
  #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1357
- #: woocommerce-gateway-stripe.php:288
1358
  msgid "Stripe Giropay"
1359
  msgstr ""
1360
 
1361
  #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1362
- #: woocommerce-gateway-stripe.php:290
1363
  msgid "Stripe iDeal"
1364
  msgstr ""
1365
 
1366
  #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1367
- #: woocommerce-gateway-stripe.php:294
1368
  msgid "Stripe Multibanco"
1369
  msgstr ""
1370
 
@@ -1393,12 +1393,12 @@ msgid "Awaiting Multibanco payment"
1393
  msgstr ""
1394
 
1395
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1396
- #: woocommerce-gateway-stripe.php:291
1397
  msgid "Stripe P24"
1398
  msgstr ""
1399
 
1400
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1401
- #: woocommerce-gateway-stripe.php:293
1402
  msgid "Stripe SEPA Direct Debit"
1403
  msgstr ""
1404
 
@@ -1425,61 +1425,61 @@ msgid ""
1425
  msgstr ""
1426
 
1427
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1428
- #: woocommerce-gateway-stripe.php:287
1429
  msgid "Stripe SOFORT"
1430
  msgstr ""
1431
 
1432
- #: includes/payment-methods/class-wc-stripe-payment-request.php:314
1433
- #: includes/payment-methods/class-wc-stripe-payment-request.php:969
1434
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1260
1435
  msgid "Tax"
1436
  msgstr ""
1437
 
1438
- #: includes/payment-methods/class-wc-stripe-payment-request.php:322
1439
- #: includes/payment-methods/class-wc-stripe-payment-request.php:977
1440
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1267
1441
  msgid "Shipping"
1442
  msgstr ""
1443
 
1444
- #: includes/payment-methods/class-wc-stripe-payment-request.php:329
1445
- #: includes/payment-methods/class-wc-stripe-payment-request.php:984
1446
  msgid "Pending"
1447
  msgstr ""
1448
 
1449
- #: includes/payment-methods/class-wc-stripe-payment-request.php:534
1450
  msgid "Sorry, we're not accepting prepaid cards at this time."
1451
  msgstr ""
1452
 
1453
- #: includes/payment-methods/class-wc-stripe-payment-request.php:536
1454
  #. translators: Do not translate the [option] placeholder
1455
  msgid "Unknown shipping option \"[option]\"."
1456
  msgstr ""
1457
 
1458
- #: includes/payment-methods/class-wc-stripe-payment-request.php:645
1459
  msgid "OR"
1460
  msgstr ""
1461
 
1462
- #: includes/payment-methods/class-wc-stripe-payment-request.php:819
1463
- #: includes/payment-methods/class-wc-stripe-payment-request.php:832
1464
  msgid "Unable to find shipping method for address."
1465
  msgstr ""
1466
 
1467
- #: includes/payment-methods/class-wc-stripe-payment-request.php:931
1468
  msgid "Product with the ID (%d) cannot be found."
1469
  msgstr ""
1470
 
1471
- #: includes/payment-methods/class-wc-stripe-payment-request.php:952
1472
  #. translators: 1: product name 2: quantity in stock
1473
  msgid ""
1474
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1475
  "enough stock (%2$s remaining)."
1476
  msgstr ""
1477
 
1478
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1103
1479
  msgid "Empty cart"
1480
  msgstr ""
1481
 
1482
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1274
1483
  msgid "Discount"
1484
  msgstr ""
1485
 
@@ -1515,23 +1515,29 @@ msgid ""
1515
  "WooCommerce %2$s is no longer supported."
1516
  msgstr ""
1517
 
1518
- #: woocommerce-gateway-stripe.php:216
 
 
 
 
 
 
1519
  msgid "Settings"
1520
  msgstr ""
1521
 
1522
- #: woocommerce-gateway-stripe.php:232
1523
  msgid "View Documentation"
1524
  msgstr ""
1525
 
1526
- #: woocommerce-gateway-stripe.php:232
1527
  msgid "Docs"
1528
  msgstr ""
1529
 
1530
- #: woocommerce-gateway-stripe.php:233
1531
  msgid "Open a support request at WooCommerce.com"
1532
  msgstr ""
1533
 
1534
- #: woocommerce-gateway-stripe.php:233
1535
  msgid "Support"
1536
  msgstr ""
1537
 
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.5.1\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
+ "POT-Creation-Date: 2020-08-12 19:35:17+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
55
  msgstr ""
56
 
57
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:436
58
+ #: includes/class-wc-stripe-order-handler.php:298
59
  #: includes/class-wc-stripe-webhook-handler.php:340
60
  #: includes/class-wc-stripe-webhook-handler.php:390
61
  #. translators: transaction id
920
  msgstr ""
921
 
922
  #: includes/class-wc-gateway-stripe.php:824
923
+ #: includes/class-wc-stripe-order-handler.php:158
924
  #: includes/class-wc-stripe-webhook-handler.php:233
925
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:278
926
  #: includes/compat/class-wc-stripe-subs-compat.php:317
1081
  msgstr ""
1082
 
1083
  #: includes/class-wc-stripe-helper.php:212
1084
+ #: includes/class-wc-stripe-order-handler.php:96
1085
  msgid "Unable to process this payment, please try again or use alternative method."
1086
  msgstr ""
1087
 
1106
  msgid "Payment verification error: %s"
1107
  msgstr ""
1108
 
1109
+ #: includes/class-wc-stripe-order-handler.php:140
1110
  #: includes/class-wc-stripe-webhook-handler.php:214
1111
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:349
1112
  msgid "This card is no longer available and has been removed."
1113
  msgstr ""
1114
 
1115
+ #: includes/class-wc-stripe-order-handler.php:190
1116
  #. translators: error message
1117
  msgid "Stripe payment failed: %s"
1118
  msgstr ""
1119
 
1120
+ #: includes/class-wc-stripe-order-handler.php:241
1121
+ #: includes/class-wc-stripe-order-handler.php:256
1122
+ #: includes/class-wc-stripe-order-handler.php:272
1123
+ #: includes/class-wc-stripe-order-handler.php:287
1124
  #. translators: error message
1125
  msgid "Unable to capture charge! %s"
1126
  msgstr ""
1315
  msgstr ""
1316
 
1317
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1318
+ #: woocommerce-gateway-stripe.php:364
1319
  msgid "Stripe Alipay"
1320
  msgstr ""
1321
 
1344
  msgstr ""
1345
 
1346
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1347
+ #: woocommerce-gateway-stripe.php:358
1348
  msgid "Stripe Bancontact"
1349
  msgstr ""
1350
 
1351
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1352
+ #: woocommerce-gateway-stripe.php:361
1353
  msgid "Stripe EPS"
1354
  msgstr ""
1355
 
1356
  #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1357
+ #: woocommerce-gateway-stripe.php:360
1358
  msgid "Stripe Giropay"
1359
  msgstr ""
1360
 
1361
  #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1362
+ #: woocommerce-gateway-stripe.php:362
1363
  msgid "Stripe iDeal"
1364
  msgstr ""
1365
 
1366
  #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1367
+ #: woocommerce-gateway-stripe.php:366
1368
  msgid "Stripe Multibanco"
1369
  msgstr ""
1370
 
1393
  msgstr ""
1394
 
1395
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1396
+ #: woocommerce-gateway-stripe.php:363
1397
  msgid "Stripe P24"
1398
  msgstr ""
1399
 
1400
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1401
+ #: woocommerce-gateway-stripe.php:365
1402
  msgid "Stripe SEPA Direct Debit"
1403
  msgstr ""
1404
 
1425
  msgstr ""
1426
 
1427
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1428
+ #: woocommerce-gateway-stripe.php:359
1429
  msgid "Stripe SOFORT"
1430
  msgstr ""
1431
 
1432
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:300
1433
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:955
1434
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1246
1435
  msgid "Tax"
1436
  msgstr ""
1437
 
1438
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:308
1439
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:963
1440
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1253
1441
  msgid "Shipping"
1442
  msgstr ""
1443
 
1444
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:315
1445
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:970
1446
  msgid "Pending"
1447
  msgstr ""
1448
 
1449
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:520
1450
  msgid "Sorry, we're not accepting prepaid cards at this time."
1451
  msgstr ""
1452
 
1453
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:522
1454
  #. translators: Do not translate the [option] placeholder
1455
  msgid "Unknown shipping option \"[option]\"."
1456
  msgstr ""
1457
 
1458
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:631
1459
  msgid "OR"
1460
  msgstr ""
1461
 
1462
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:805
1463
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:818
1464
  msgid "Unable to find shipping method for address."
1465
  msgstr ""
1466
 
1467
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:917
1468
  msgid "Product with the ID (%d) cannot be found."
1469
  msgstr ""
1470
 
1471
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:938
1472
  #. translators: 1: product name 2: quantity in stock
1473
  msgid ""
1474
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1475
  "enough stock (%2$s remaining)."
1476
  msgstr ""
1477
 
1478
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1089
1479
  msgid "Empty cart"
1480
  msgstr ""
1481
 
1482
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1260
1483
  msgid "Discount"
1484
  msgstr ""
1485
 
1515
  "WooCommerce %2$s is no longer supported."
1516
  msgstr ""
1517
 
1518
+ #: woocommerce-gateway-stripe.php:64
1519
+ msgid ""
1520
+ "Stripe is not available in your store's country and will not be available "
1521
+ "for buyers to choose during checkout."
1522
+ msgstr ""
1523
+
1524
+ #: woocommerce-gateway-stripe.php:288
1525
  msgid "Settings"
1526
  msgstr ""
1527
 
1528
+ #: woocommerce-gateway-stripe.php:304
1529
  msgid "View Documentation"
1530
  msgstr ""
1531
 
1532
+ #: woocommerce-gateway-stripe.php:304
1533
  msgid "Docs"
1534
  msgstr ""
1535
 
1536
+ #: woocommerce-gateway-stripe.php:305
1537
  msgid "Open a support request at WooCommerce.com"
1538
  msgstr ""
1539
 
1540
+ #: woocommerce-gateway-stripe.php:305
1541
  msgid "Support"
1542
  msgstr ""
1543
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: automattic, royho, akeda, mattyza, bor0, woothemes
3
  Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort, bancontact, alipay, giropay, ideal, p24, woocommerce, automattic
4
  Requires at least: 4.4
5
- Tested up to: 5.4
6
  Requires PHP: 5.6
7
- Stable tag: 4.5.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -24,21 +24,35 @@ Stripe is available for Store Owners and Merchants in:
24
  * Australia
25
  * Austria
26
  * Belgium
 
27
  * Canada
 
 
28
  * Denmark
 
29
  * Finland
30
  * France
31
  * Germany
 
32
  * Hong Kong
33
  * Ireland
34
  * Italy
35
  * Japan
 
 
36
  * Luxembourg
 
 
 
37
  * Netherlands
38
  * New Zealand
39
  * Norway
 
40
  * Portugal
 
41
  * Singapore
 
 
42
  * Spain
43
  * Sweden
44
  * Switzerland
@@ -112,58 +126,9 @@ If you get stuck, you can ask for help in the Plugin Forum.
112
 
113
  == Changelog ==
114
 
115
- = 4.5.0 2020-06-24 =
116
- * Tweak - Improve branded Google Pay button user agent detection.
117
- * Add - New filter to manage the display of payment request buttons in cart.
118
- * Fix - Display Apple Pay button with text if branded type is text and logo.
119
- * Fix - Prevent branded payment request button duplication when checkout is re-calculated.
120
- * Fix - Payment request buttons on a single product page now correctly show the product name instead of a subtotal.
121
- * Fix - Quotes in variadic product attributes no longer cause payment request buttons to show only the cheapest variation.
122
-
123
- = 4.4.0 2020-05-21 =
124
- * Tweak - Remove support for WooCommerce versions lower than 3.0.
125
- * Tweak - Update plugin assets.
126
- * Tweak - Improve performance on order pay screen.
127
- * Tweak - Compress payment methods SVGs.
128
- * Add - Support for custom payment request button.
129
- * Fix - Prevent users from entering secret key in the public key field and stop it from showing if they did.
130
- * Fix - Revert caching layer removal to speed up My Account subscriptions tab.
131
- * Fix - Bug where source ID was not set resulting in an uncaught exception.
132
- * Fix - Collecting level 3 data triggers a warning.
133
- * Fix - Custom button class typo.
134
- * Fix - Payment Request incorrect shipping option passed.
135
- * Fix - Payment Requests, like Apple Pay, not initially showing correct quantity if used on Product Page.
136
- * Fix - State abbreviation breaks Payment Request button.
137
- * Fix - Stripe Payment Request button using incorrect Google Pay brand asset by adding a special branded button.
138
- * Fix - Move docs and support links in the plugins list page.
139
-
140
- = 4.3.3 2020-04-08 =
141
- * Fix - Fix Payment Request issue when product attribute has quotes
142
- * Fix - Fix "no such customer" error on checkout after the keys have been changed
143
- * Add - Add alert for end of support WC < 3.0 in future releases
144
- * Fix - Fix crash when used with WooCommerce Subscriptions <2.6
145
- * Fix - Add missing customer ID to subscriptions before processing payment
146
- * Fix - Fix transactions failing with trailing slash
147
-
148
- = 4.3.2 2020-02-17 =
149
- * Fix - Add compatibility to payment request buttons with some of the WooCommerce Product Add-ons on the product page
150
- * Fix - Improved compatibility for free orders with other extensions
151
- * Add - Support for multisite when sites use different Stripe accounts
152
- * Fix - Display a localized error message when a customer tries to save a card during checkout, but there's an error
153
- * Add - Send level 3 credit card data for purchases when possible
154
-
155
- = 4.3.1 2019-11-12 =
156
- * Fix - Overwrite the previous Apple Pay verification file if it has changed.
157
- * Fix - Avoid re-mounting card elements if they are already mounted in the DOM.
158
- * Fix - Compatibility with WooCommerce Deposits by retrieving order statuses in a different way.
159
- * Fix - Duplicate payment notifications for subscriptions.
160
- * Fix - Use the same customer after a new credit card has been entered.
161
- * Fix - Google Pay buttons on subscriptions.
162
- * Add - A filter, which allows all subscriptions' payment methods to be overwritten when adding a new payment method.
163
 
164
  [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
165
 
166
- == Upgrade Notice ==
167
-
168
- = 4.2 =
169
- 4.2 is a minor release. Please do a full site backup and test on a staging site before deploying to a live/production server.
2
  Contributors: automattic, royho, akeda, mattyza, bor0, woothemes
3
  Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort, bancontact, alipay, giropay, ideal, p24, woocommerce, automattic
4
  Requires at least: 4.4
5
+ Tested up to: 5.5
6
  Requires PHP: 5.6
7
+ Stable tag: 4.5.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
24
  * Australia
25
  * Austria
26
  * Belgium
27
+ * Bulgaria
28
  * Canada
29
+ * Cyprus
30
+ * Czech Republic
31
  * Denmark
32
+ * Estonia
33
  * Finland
34
  * France
35
  * Germany
36
+ * Greece
37
  * Hong Kong
38
  * Ireland
39
  * Italy
40
  * Japan
41
+ * Latvia
42
+ * Lithuania
43
  * Luxembourg
44
+ * Malaysia
45
+ * Malta
46
+ * Mexico
47
  * Netherlands
48
  * New Zealand
49
  * Norway
50
+ * Poland
51
  * Portugal
52
+ * Puerto Rico
53
  * Singapore
54
+ * Slovakia
55
+ * Slovenia
56
  * Spain
57
  * Sweden
58
  * Switzerland
126
 
127
  == Changelog ==
128
 
129
+ = 4.5.1 - 2020-08-12 =
130
+ * Add - Support for Bulgaria, Czech Republic, Greece, Cyprus, Malta, Slovenia
131
+ * Add - Additional metadata for order status change events when tracking is permitted
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
  [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
134
 
 
 
 
 
woocommerce-gateway-stripe.php CHANGED
@@ -5,11 +5,11 @@
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
- * Version: 4.5.0
9
  * Requires at least: 4.4
10
- * Tested up to: 5.4
11
  * WC requires at least: 3.0
12
- * WC tested up to: 4.2
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  /**
23
  * Required minimums and constants
24
  */
25
- define( 'WC_STRIPE_VERSION', '4.5.0' );
26
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
27
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
28
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.0' );
@@ -54,6 +54,73 @@ function woocommerce_stripe_wc_not_supported() {
54
  echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce %1$s or greater to be installed and active. WooCommerce %2$s is no longer supported.', 'woocommerce-gateway-stripe' ), WC_STRIPE_MIN_WC_VER, WC_VERSION ) . '</strong></p></div>';
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  add_action( 'plugins_loaded', 'woocommerce_gateway_stripe_init' );
58
 
59
  function woocommerce_gateway_stripe_init() {
@@ -69,6 +136,11 @@ function woocommerce_gateway_stripe_init() {
69
  return;
70
  }
71
 
 
 
 
 
 
72
  if ( ! class_exists( 'WC_Stripe' ) ) :
73
 
74
  class WC_Stripe {
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.5.1
9
  * Requires at least: 4.4
10
+ * Tested up to: 5.5
11
  * WC requires at least: 3.0
12
+ * WC tested up to: 4.3
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
22
  /**
23
  * Required minimums and constants
24
  */
25
+ define( 'WC_STRIPE_VERSION', '4.5.1' );
26
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
27
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
28
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.0' );
54
  echo '<div class="error"><p><strong>' . sprintf( esc_html__( 'Stripe requires WooCommerce %1$s or greater to be installed and active. WooCommerce %2$s is no longer supported.', 'woocommerce-gateway-stripe' ), WC_STRIPE_MIN_WC_VER, WC_VERSION ) . '</strong></p></div>';
55
  }
56
 
57
+ /**
58
+ * WooCommerce country not supported notice.
59
+ *
60
+ * @since 4.5.1
61
+ * @return string
62
+ */
63
+ function woocommerce_stripe_wc_country_not_supported() {
64
+ echo '<div class="error"><p><strong>' . __( 'Stripe is not available in your store\'s country and will not be available for buyers to choose during checkout.', 'woocommerce-gateway-stripe' ) . '</strong></p></div>';
65
+ }
66
+
67
+ /**
68
+ * Check that the WooCommerce country is supported by Stripe.
69
+ * See https://stripe.com/global for list.
70
+ *
71
+ * @since 4.5.1
72
+ * @return bool
73
+ */
74
+ function woocommerce_stripe_wc_country_is_supported_country() {
75
+ $wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 );
76
+
77
+ $supported_countries = apply_filters(
78
+ 'wc_stripe_supported_countries',
79
+ array(
80
+ 'AT', // Austria
81
+ 'AU', // Australia
82
+ 'BE', // Belgium
83
+ 'BG', // Bulgaria
84
+ 'CA', // Canada
85
+ 'CY', // Cyprus
86
+ 'CZ', // Czech Republic
87
+ 'DK', // Denmark
88
+ 'EE', // Estonia
89
+ 'FI', // Finland
90
+ 'FR', // France
91
+ 'DE', // Germany
92
+ 'GR', // Greece
93
+ 'HK', // Hong Kong
94
+ 'IE', // Ireland
95
+ 'IT', // Italy
96
+ 'JP', // Japan
97
+ 'LV', // Latvia
98
+ 'LT', // Lithuania
99
+ 'LU', // Luxembourg
100
+ 'MY', // Malaysia
101
+ 'MT', // Malta
102
+ 'MX', // Mexico
103
+ 'NL', // Netherlands
104
+ 'NZ', // New Zealand
105
+ 'NO', // Norway
106
+ 'PL', // Poland
107
+ 'PR', // Puerto Rico #1203
108
+ 'PT', // Portugal
109
+ 'RO', // Romania
110
+ 'SG', // Singapore
111
+ 'SK', // Slovakia
112
+ 'SI', // Slovenia
113
+ 'ES', // Spain
114
+ 'SE', // Sweden
115
+ 'CH', // Switzerland
116
+ 'GB', // United Kingdom (UK)
117
+ 'US' // United States (US)
118
+ )
119
+ );
120
+
121
+ return in_array( $wc_default_country, $supported_countries );
122
+ }
123
+
124
  add_action( 'plugins_loaded', 'woocommerce_gateway_stripe_init' );
125
 
126
  function woocommerce_gateway_stripe_init() {
136
  return;
137
  }
138
 
139
+ if ( ! woocommerce_stripe_wc_country_is_supported_country() ) {
140
+ add_action( 'admin_notices', 'woocommerce_stripe_wc_country_not_supported' );
141
+ return;
142
+ }
143
+
144
  if ( ! class_exists( 'WC_Stripe' ) ) :
145
 
146
  class WC_Stripe {