WooCommerce Square - Version 2.6.0

Version Description

  • 2021.09.29 =
  • New - Add support for Square stores located in France. PR#650
  • Fix - PHP warning when trying to load the Square digital wallet (Apple/Google Pay buttons) on a product page that isn't available for purchase. PR#640
Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Square
Version 2.6.0
Comparing to
See all releases

Code changes from version 2.5.3 to 2.6.0

i18n/languages/woocommerce-square.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the GNU General Public License v3.0.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Square 2.5.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-square\n"
8
- "POT-Creation-Date: 2021-07-23 04:28:29+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -434,7 +434,7 @@ msgid "The sync job has failed. Check sync records, or %s."
434
  msgstr ""
435
 
436
  #: includes/Gateway/API/Requests/Orders.php:84
437
- #: includes/Gateway/Digital_Wallet.php:416
438
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:555
439
  msgid "Discount"
440
  msgstr ""
@@ -502,40 +502,45 @@ msgid ""
502
  "enough stock (%2$s remaining)."
503
  msgstr ""
504
 
505
- #: includes/Gateway/Digital_Wallet.php:312
506
- #: includes/Gateway/Digital_Wallet.php:408
 
 
 
 
 
507
  msgid "Tax"
508
  msgstr ""
509
 
510
- #: includes/Gateway/Digital_Wallet.php:347
511
  msgid "This payment method cannot be used for multiple shipments."
512
  msgstr ""
513
 
514
- #: includes/Gateway/Digital_Wallet.php:358
515
  #: vendor/prospress/action-scheduler/classes/ActionScheduler_Store.php:182
516
  msgid "Pending"
517
  msgstr ""
518
 
519
- #: includes/Gateway/Digital_Wallet.php:400
520
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:565
521
  msgid "Shipping"
522
  msgstr ""
523
 
524
- #: includes/Gateway/Digital_Wallet.php:424
525
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:575
526
  msgid "Fees"
527
  msgstr ""
528
 
529
- #: includes/Gateway/Digital_Wallet.php:459
530
  #. translators: Context (product, cart, checkout or page)
531
  msgid "Empty payment request data for %s."
532
  msgstr ""
533
 
534
- #: includes/Gateway/Digital_Wallet.php:653
535
  msgid "Empty cart"
536
  msgstr ""
537
 
538
- #: includes/Gateway/Digital_Wallet.php:787
539
  msgid "Unable to verify domain with Apple Pay - missing access token."
540
  msgstr ""
541
 
@@ -932,7 +937,7 @@ msgid ""
932
  "%5$supdated documentation%6$s."
933
  msgstr ""
934
 
935
- #: includes/Plugin.php:456
936
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
937
  #. 2-character country code, %4$s - comma separated list of 2-character country
938
  #. codes
@@ -941,7 +946,7 @@ msgid ""
941
  "accept transactions from merchants outside of %4$s."
942
  msgstr ""
943
 
944
- #: includes/Plugin.php:483
945
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
946
  #. <a> tag, %4$s - </a> tag
947
  msgid ""
@@ -950,7 +955,7 @@ msgid ""
950
  "successfully with Square. %3$sRead more here%4$s on how to resolve this."
951
  msgstr ""
952
 
953
- #: includes/Plugin.php:526
954
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
955
  #. <a> tag, %4$s - </a> tag
956
  msgid ""
@@ -958,14 +963,14 @@ msgid ""
958
  "Square is inactive. Please disconnect and reconnect to resolve."
959
  msgstr ""
960
 
961
- #: includes/Plugin.php:558
962
  msgid ""
963
  "%1$sWooCommerce Square:%2$s Product prices are entered inclusive of tax, "
964
  "but Square does not support syncing tax-inclusive prices. Please make sure "
965
  "your Square tax rates match your WooCommerce tax rates."
966
  msgstr ""
967
 
968
- #: includes/Plugin.php:589
969
  msgid ""
970
  "Heads up! Your store currency is %1$s but your configured Square business "
971
  "location currency is %2$s, so payments cannot be processed. Please "
2
  # This file is distributed under the GNU General Public License v3.0.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Square 2.6.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-square\n"
8
+ "POT-Creation-Date: 2021-09-29 03:45:38+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
434
  msgstr ""
435
 
436
  #: includes/Gateway/API/Requests/Orders.php:84
437
+ #: includes/Gateway/Digital_Wallet.php:421
438
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:555
439
  msgid "Discount"
440
  msgstr ""
502
  "enough stock (%2$s remaining)."
503
  msgstr ""
504
 
505
+ #: includes/Gateway/Digital_Wallet.php:295
506
+ #. translators: 1: product name
507
+ msgid "You cannot purchase \"%1$s\" because it is currently not available."
508
+ msgstr ""
509
+
510
+ #: includes/Gateway/Digital_Wallet.php:317
511
+ #: includes/Gateway/Digital_Wallet.php:413
512
  msgid "Tax"
513
  msgstr ""
514
 
515
+ #: includes/Gateway/Digital_Wallet.php:352
516
  msgid "This payment method cannot be used for multiple shipments."
517
  msgstr ""
518
 
519
+ #: includes/Gateway/Digital_Wallet.php:363
520
  #: vendor/prospress/action-scheduler/classes/ActionScheduler_Store.php:182
521
  msgid "Pending"
522
  msgstr ""
523
 
524
+ #: includes/Gateway/Digital_Wallet.php:405
525
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:565
526
  msgid "Shipping"
527
  msgstr ""
528
 
529
+ #: includes/Gateway/Digital_Wallet.php:429
530
  #: vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/apple-pay/class-sv-wc-payment-gateway-apple-pay.php:575
531
  msgid "Fees"
532
  msgstr ""
533
 
534
+ #: includes/Gateway/Digital_Wallet.php:464
535
  #. translators: Context (product, cart, checkout or page)
536
  msgid "Empty payment request data for %s."
537
  msgstr ""
538
 
539
+ #: includes/Gateway/Digital_Wallet.php:658
540
  msgid "Empty cart"
541
  msgstr ""
542
 
543
+ #: includes/Gateway/Digital_Wallet.php:792
544
  msgid "Unable to verify domain with Apple Pay - missing access token."
545
  msgstr ""
546
 
937
  "%5$supdated documentation%6$s."
938
  msgstr ""
939
 
940
+ #: includes/Plugin.php:457
941
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
942
  #. 2-character country code, %4$s - comma separated list of 2-character country
943
  #. codes
946
  "accept transactions from merchants outside of %4$s."
947
  msgstr ""
948
 
949
+ #: includes/Plugin.php:484
950
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
951
  #. <a> tag, %4$s - </a> tag
952
  msgid ""
955
  "successfully with Square. %3$sRead more here%4$s on how to resolve this."
956
  msgstr ""
957
 
958
+ #: includes/Plugin.php:527
959
  #. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
960
  #. <a> tag, %4$s - </a> tag
961
  msgid ""
963
  "Square is inactive. Please disconnect and reconnect to resolve."
964
  msgstr ""
965
 
966
+ #: includes/Plugin.php:559
967
  msgid ""
968
  "%1$sWooCommerce Square:%2$s Product prices are entered inclusive of tax, "
969
  "but Square does not support syncing tax-inclusive prices. Please make sure "
970
  "your Square tax rates match your WooCommerce tax rates."
971
  msgstr ""
972
 
973
+ #: includes/Plugin.php:590
974
  msgid ""
975
  "Heads up! Your store currency is %1$s but your configured Square business "
976
  "location currency is %2$s, so payments cannot be processed. Please "
includes/Gateway.php CHANGED
@@ -889,7 +889,7 @@ class Gateway extends Framework\SV_WC_Payment_Gateway_Direct {
889
  $is_available = false;
890
  $base_location = wc_get_base_location();
891
 
892
- if ( wc_site_is_https() && in_array( get_woocommerce_currency(), array( 'USD', 'GBP', 'CAD', 'EUR' ), true ) && ( ! empty( $base_location['country'] ) && in_array( $base_location['country'], array( 'US', 'GB', 'CA', 'IE' ), true ) ) ) {
893
  $is_available = true;
894
  }
895
 
889
  $is_available = false;
890
  $base_location = wc_get_base_location();
891
 
892
+ if ( wc_site_is_https() && in_array( get_woocommerce_currency(), array( 'USD', 'GBP', 'CAD', 'EUR' ), true ) && ( ! empty( $base_location['country'] ) && in_array( $base_location['country'], array( 'US', 'GB', 'CA', 'IE', 'FR' ), true ) ) ) {
893
  $is_available = true;
894
  }
895
 
includes/Gateway/Digital_Wallet.php CHANGED
@@ -290,6 +290,11 @@ class Digital_Wallet {
290
  throw new \Exception( sprintf( __( 'You cannot add that amount of "%1$s"; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce-square' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
291
  }
292
 
 
 
 
 
 
293
  if ( $add_to_cart ) {
294
  WC()->cart->empty_cart();
295
  WC()->cart->add_to_cart( $product->get_id(), $quantity, $variation_id, $attributes );
290
  throw new \Exception( sprintf( __( 'You cannot add that amount of "%1$s"; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce-square' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
291
  }
292
 
293
+ if ( ! $product->is_purchasable() ) {
294
+ /* translators: 1: product name */
295
+ throw new \Exception( sprintf( __( 'You cannot purchase "%1$s" because it is currently not available.', 'woocommerce-square' ), $product->get_name() ) );
296
+ }
297
+
298
  if ( $add_to_cart ) {
299
  WC()->cart->empty_cart();
300
  WC()->cart->add_to_cart( $product->get_id(), $quantity, $variation_id, $attributes );
includes/Plugin.php CHANGED
@@ -42,7 +42,7 @@ class Plugin extends Framework\SV_WC_Payment_Gateway_Plugin {
42
 
43
 
44
  /** plugin version number */
45
- const VERSION = '2.5.3';
46
 
47
  /** plugin ID */
48
  const PLUGIN_ID = 'square';
@@ -444,6 +444,7 @@ class Plugin extends Framework\SV_WC_Payment_Gateway_Plugin {
444
  'AU',
445
  'JP',
446
  'IE',
 
447
  );
448
 
449
  $base_location = wc_get_base_location();
42
 
43
 
44
  /** plugin version number */
45
+ const VERSION = '2.6.0';
46
 
47
  /** plugin ID */
48
  const PLUGIN_ID = 'square';
444
  'AU',
445
  'JP',
446
  'IE',
447
+ 'FR',
448
  );
449
 
450
  $base_location = wc_get_base_location();
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: woocommerce, automattic, royho, woothemes, bor0, mattdallan, menakas, chickenn00dle, jorgeatorres, jamesgallan, achyuthajoy
3
  Tags: credit card, square, woocommerce, inventory sync
4
  Requires at least: 4.6
5
- Tested up to: 5.7
6
  Requires PHP: 5.6
7
- Stable tag: 2.5.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -71,6 +71,10 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
71
  2. The payment gateway settings.
72
 
73
  == Changelog ==
 
 
 
 
74
  = 2.5.3 - 2021.07.23 =
75
  * Fix - Failed orders with error "Square Payment Failed (Status code VALUE_TOO_LOW)" caused by incorrect line item calculations on orders with discounts/coupons (introduced in 2.5.2). PR#635
76
 
2
  Contributors: woocommerce, automattic, royho, woothemes, bor0, mattdallan, menakas, chickenn00dle, jorgeatorres, jamesgallan, achyuthajoy
3
  Tags: credit card, square, woocommerce, inventory sync
4
  Requires at least: 4.6
5
+ Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 2.6.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
71
  2. The payment gateway settings.
72
 
73
  == Changelog ==
74
+ = 2.6.0 - 2021.09.29 =
75
+ * New - Add support for Square stores located in France. PR#650
76
+ * Fix - PHP warning when trying to load the Square digital wallet (Apple/Google Pay buttons) on a product page that isn't available for purchase. PR#640
77
+
78
  = 2.5.3 - 2021.07.23 =
79
  * Fix - Failed orders with error "Square Payment Failed (Status code VALUE_TOO_LOW)" caused by incorrect line item calculations on orders with discounts/coupons (introduced in 2.5.2). PR#635
80
 
woocommerce-square.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Square
4
- * Version: 2.5.3
5
  * Plugin URI: https://woocommerce.com/products/square/
6
  * Description: Adds ability to sync inventory between WooCommerce and Square POS. In addition, you can also make purchases through the Square payment gateway.
7
  * Author: WooCommerce
@@ -19,7 +19,7 @@
19
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
20
  *
21
  * WC requires at least: 3.0
22
- * WC tested up to: 5.5
23
  */
24
 
25
  defined( 'ABSPATH' ) || exit;
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Square
4
+ * Version: 2.6.0
5
  * Plugin URI: https://woocommerce.com/products/square/
6
  * Description: Adds ability to sync inventory between WooCommerce and Square POS. In addition, you can also make purchases through the Square payment gateway.
7
  * Author: WooCommerce
19
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
20
  *
21
  * WC requires at least: 3.0
22
+ * WC tested up to: 5.7
23
  */
24
 
25
  defined( 'ABSPATH' ) || exit;