WooCommerce Stripe Payment Gateway - Version 5.2.2

Version Description

  • 2021-06-10 =

  • Fix - The absence of a cart causing fatal errors when rendering the Cart or Checkout block.

Download this release

Release Info

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

Code changes from version 5.2.1 to 5.2.2

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  *** Changelog ***
2
 
 
 
 
3
  = 5.2.1 - 2021-06-10 =
4
  * Fix - Remove calls to `has_block()` since it breaks compatibility with older versions of WordPress.
5
  * Tweak - Use the same JavaScript configurations for the Block-based and Shortcode-based checkout flows.
1
  *** Changelog ***
2
 
3
+ = 5.2.2 - 2021-06-10 =
4
+ * Fix - The absence of a cart causing fatal errors when rendering the Cart or Checkout block.
5
+
6
  = 5.2.1 - 2021-06-10 =
7
  * Fix - Remove calls to `has_block()` since it breaks compatibility with older versions of WordPress.
8
  * Tweak - Use the same JavaScript configurations for the Block-based and Shortcode-based checkout flows.
includes/payment-methods/class-wc-stripe-payment-request.php CHANGED
@@ -583,6 +583,11 @@ class WC_Stripe_Payment_Request {
583
  * @return array The settings used for the payment request button in JavaScript.
584
  */
585
  public function javascript_params() {
 
 
 
 
 
586
  return [
587
  'ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ),
588
  'stripe' => [
@@ -608,7 +613,7 @@ class WC_Stripe_Payment_Request {
608
  'url' => wc_get_checkout_url(),
609
  'currency_code' => strtolower( get_woocommerce_currency() ),
610
  'country_code' => substr( get_option( 'woocommerce_default_country' ), 0, 2 ),
611
- 'needs_shipping' => WC()->cart->needs_shipping() ? 'yes' : 'no',
612
  // Defaults to 'required' to match how core initializes this option.
613
  'needs_payer_phone' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ),
614
  ],
583
  * @return array The settings used for the payment request button in JavaScript.
584
  */
585
  public function javascript_params() {
586
+ $needs_shipping = 'no';
587
+ if ( ! is_null( WC()->cart ) && WC()->cart->needs_shipping() ) {
588
+ $needs_shipping = 'yes';
589
+ }
590
+
591
  return [
592
  'ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ),
593
  'stripe' => [
613
  'url' => wc_get_checkout_url(),
614
  'currency_code' => strtolower( get_woocommerce_currency() ),
615
  'country_code' => substr( get_option( 'woocommerce_default_country' ), 0, 2 ),
616
+ 'needs_shipping' => $needs_shipping,
617
  // Defaults to 'required' to match how core initializes this option.
618
  'needs_payer_phone' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ),
619
  ],
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 5.2.1\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
- "POT-Creation-Date: 2021-06-10 19:04: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"
@@ -1741,53 +1741,53 @@ msgid "Stripe SOFORT"
1741
  msgstr ""
1742
 
1743
  #: includes/payment-methods/class-wc-stripe-payment-request.php:362
1744
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1092
1745
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1522
1746
  msgid "Tax"
1747
  msgstr ""
1748
 
1749
  #: includes/payment-methods/class-wc-stripe-payment-request.php:370
1750
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1100
1751
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1529
1752
  msgid "Shipping"
1753
  msgstr ""
1754
 
1755
  #: includes/payment-methods/class-wc-stripe-payment-request.php:377
1756
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1107
1757
  msgid "Pending"
1758
  msgstr ""
1759
 
1760
- #: includes/payment-methods/class-wc-stripe-payment-request.php:603
1761
  msgid "Sorry, we're not accepting prepaid cards at this time."
1762
  msgstr ""
1763
 
1764
- #: includes/payment-methods/class-wc-stripe-payment-request.php:605
1765
  #. translators: Do not translate the [option] placeholder
1766
  msgid "Unknown shipping option \"[option]\"."
1767
  msgstr ""
1768
 
1769
- #: includes/payment-methods/class-wc-stripe-payment-request.php:748
1770
  msgid "OR"
1771
  msgstr ""
1772
 
1773
- #: includes/payment-methods/class-wc-stripe-payment-request.php:941
1774
- #: includes/payment-methods/class-wc-stripe-payment-request.php:954
1775
  msgid "Unable to find shipping method for address."
1776
  msgstr ""
1777
 
1778
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1054
1779
  #. translators: %d is the product Id
1780
  msgid "Product with the ID (%d) cannot be found."
1781
  msgstr ""
1782
 
1783
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1075
1784
  #. translators: 1: product name 2: quantity in stock
1785
  msgid ""
1786
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1787
  "enough stock (%2$s remaining)."
1788
  msgstr ""
1789
 
1790
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1347
1791
  #. translators: %s: country.
1792
  msgid ""
1793
  "The Payment Request button is not supported in %s because some required "
@@ -1795,11 +1795,11 @@ msgid ""
1795
  "again."
1796
  msgstr ""
1797
 
1798
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1363
1799
  msgid "Empty cart"
1800
  msgstr ""
1801
 
1802
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1536
1803
  msgid "Discount"
1804
  msgstr ""
1805
 
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 5.2.2\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
+ "POT-Creation-Date: 2021-06-10 22:57:05+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
1741
  msgstr ""
1742
 
1743
  #: includes/payment-methods/class-wc-stripe-payment-request.php:362
1744
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1097
1745
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1527
1746
  msgid "Tax"
1747
  msgstr ""
1748
 
1749
  #: includes/payment-methods/class-wc-stripe-payment-request.php:370
1750
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1105
1751
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1534
1752
  msgid "Shipping"
1753
  msgstr ""
1754
 
1755
  #: includes/payment-methods/class-wc-stripe-payment-request.php:377
1756
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1112
1757
  msgid "Pending"
1758
  msgstr ""
1759
 
1760
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:608
1761
  msgid "Sorry, we're not accepting prepaid cards at this time."
1762
  msgstr ""
1763
 
1764
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:610
1765
  #. translators: Do not translate the [option] placeholder
1766
  msgid "Unknown shipping option \"[option]\"."
1767
  msgstr ""
1768
 
1769
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:753
1770
  msgid "OR"
1771
  msgstr ""
1772
 
1773
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:946
1774
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:959
1775
  msgid "Unable to find shipping method for address."
1776
  msgstr ""
1777
 
1778
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1059
1779
  #. translators: %d is the product Id
1780
  msgid "Product with the ID (%d) cannot be found."
1781
  msgstr ""
1782
 
1783
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1080
1784
  #. translators: 1: product name 2: quantity in stock
1785
  msgid ""
1786
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1787
  "enough stock (%2$s remaining)."
1788
  msgstr ""
1789
 
1790
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1352
1791
  #. translators: %s: country.
1792
  msgid ""
1793
  "The Payment Request button is not supported in %s because some required "
1795
  "again."
1796
  msgstr ""
1797
 
1798
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1368
1799
  msgid "Empty cart"
1800
  msgstr ""
1801
 
1802
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1541
1803
  msgid "Discount"
1804
  msgstr ""
1805
 
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: 5.6
6
  Requires PHP: 5.6
7
- Stable tag: 5.2.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -126,8 +126,7 @@ If you get stuck, you can ask for help in the Plugin Forum.
126
 
127
  == Changelog ==
128
 
129
- = 5.2.1 - 2021-06-10 =
130
 
131
- * Fix - Remove calls to `has_block()` since it breaks compatibility with older versions of WordPress.
132
- * Tweak - Use the same JavaScript configurations for the Block-based and Shortcode-based checkout flows.
133
 
4
  Requires at least: 4.4
5
  Tested up to: 5.6
6
  Requires PHP: 5.6
7
+ Stable tag: 5.2.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
126
 
127
  == Changelog ==
128
 
129
+ = 5.2.2 - 2021-06-10 =
130
 
131
+ * Fix - The absence of a cart causing fatal errors when rendering the Cart or Checkout block.
 
132
 
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: 5.2.1
9
  * Requires at least: 4.4
10
  * Tested up to: 5.6
11
  * WC requires at least: 3.0
@@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
21
  /**
22
  * Required minimums and constants
23
  */
24
- define( 'WC_STRIPE_VERSION', '5.2.1' ); // WRCS: DEFINED_VERSION.
25
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
26
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
27
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.3' );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 5.2.2
9
  * Requires at least: 4.4
10
  * Tested up to: 5.6
11
  * WC requires at least: 3.0
21
  /**
22
  * Required minimums and constants
23
  */
24
+ define( 'WC_STRIPE_VERSION', '5.2.2' ); // WRCS: DEFINED_VERSION.
25
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
26
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
27
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.3' );