WooCommerce Stripe Payment Gateway - Version 4.2.2

Version Description

  • 2019-06-26 =
  • Fix - Changing an order status to "Cancelled" or "Refunded" will no longer refund the payment, will only void the payment if it was just authorized.

See changelog for all versions.

=

Download this release

Release Info

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

Code changes from version 4.2.1 to 4.2.2

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  *** Changelog ***
2
 
 
 
 
3
  = 4.2.1 - 2019-06-17 =
4
  * Update - Add UGX (Ugandan Shilling) to zero decimal currency list.
5
  * Fix - CSRF verification error upon creating account on checkout.
1
  *** Changelog ***
2
 
3
+ = 4.2.2 - 2019-06-26 =
4
+ * Fix - Changing an order status to "Cancelled" or "Refunded" will no longer refund the payment, will only void the payment if it was just authorized.
5
+
6
  = 4.2.1 - 2019-06-17 =
7
  * Update - Add UGX (Ugandan Shilling) to zero decimal currency list.
8
  * Fix - CSRF verification error upon creating account on checkout.
includes/class-wc-stripe-order-handler.php CHANGED
@@ -316,14 +316,19 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
316
  * Cancel pre-auth on refund/cancellation.
317
  *
318
  * @since 3.1.0
319
- * @version 4.0.0
320
  * @param int $order_id
321
  */
322
  public function cancel_payment( $order_id ) {
323
  $order = wc_get_order( $order_id );
324
 
325
  if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
326
- $this->process_refund( $order_id );
 
 
 
 
 
327
 
328
  // This hook fires when admin manually changes order status to cancel.
329
  do_action( 'woocommerce_stripe_process_manual_cancel', $order );
316
  * Cancel pre-auth on refund/cancellation.
317
  *
318
  * @since 3.1.0
319
+ * @version 4.2.2
320
  * @param int $order_id
321
  */
322
  public function cancel_payment( $order_id ) {
323
  $order = wc_get_order( $order_id );
324
 
325
  if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
326
+ $captured = WC_Stripe_Helper::is_wc_lt( '3.0' )
327
+ ? get_post_meta( $order_id, '_stripe_charge_captured', true )
328
+ : $order->get_meta( '_stripe_charge_captured', true );
329
+ if ( 'no' === $captured ) {
330
+ $this->process_refund( $order_id );
331
+ }
332
 
333
  // This hook fires when admin manually changes order status to cancel.
334
  do_action( 'woocommerce_stripe_process_manual_cancel', $order );
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.2.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
- "POT-Creation-Date: 2019-06-03 15:42:48+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:444
66
- #: includes/class-wc-gateway-stripe.php:522
67
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:173
68
  #: includes/compat/class-wc-stripe-subs-compat.php:136
69
  msgid "Payment processing failed. Please retry."
@@ -99,7 +99,7 @@ msgid ""
99
  "WooCommerce Stripe - We see that you had the \"Require 3D secure when "
100
  "applicable\" setting turned on. This setting is not available here anymore, "
101
  "because it is now replaced by Stripe Radar. You can learn more about it <a "
102
- "href=\"%s\">here</a>."
103
  msgstr ""
104
 
105
  #: includes/admin/class-wc-stripe-admin-notices.php:129
@@ -747,22 +747,22 @@ msgid ""
747
  "your Stripe account keys</a>."
748
  msgstr ""
749
 
750
- #: includes/class-wc-gateway-stripe.php:189
751
  #. translators: 1) Opening anchor tag 2) closing anchor tag
752
  msgid ""
753
  "If your billing address has been changed for saved payment methods, be sure "
754
  "to remove any %1$ssaved payment methods%2$s on file and re-add them."
755
  msgstr ""
756
 
757
- #: includes/class-wc-gateway-stripe.php:250
758
  msgid "Add Card"
759
  msgstr ""
760
 
761
- #: includes/class-wc-gateway-stripe.php:256
762
  msgid "Change Payment Method"
763
  msgstr ""
764
 
765
- #: includes/class-wc-gateway-stripe.php:277
766
  #. translators: link to Stripe testing page
767
  msgid ""
768
  "TEST MODE ENABLED. In test mode, you can use the card number "
@@ -771,73 +771,73 @@ msgid ""
771
  "card numbers."
772
  msgstr ""
773
 
774
- #: includes/class-wc-gateway-stripe.php:316
775
  msgid "Credit or debit card"
776
  msgstr ""
777
 
778
- #: includes/class-wc-gateway-stripe.php:324
779
  msgid "Card Number"
780
  msgstr ""
781
 
782
- #: includes/class-wc-gateway-stripe.php:335
783
  msgid "Expiry Date"
784
  msgstr ""
785
 
786
- #: includes/class-wc-gateway-stripe.php:343
787
  msgid "Card Code (CVC)"
788
  msgstr ""
789
 
790
- #: includes/class-wc-gateway-stripe.php:418
791
  msgid "Please accept the terms and conditions first"
792
  msgstr ""
793
 
794
- #: includes/class-wc-gateway-stripe.php:419
795
  msgid "Please fill in required checkout fields first"
796
  msgstr ""
797
 
798
- #: includes/class-wc-gateway-stripe.php:448
799
- #: includes/class-wc-gateway-stripe.php:509
800
  msgid ""
801
  "Sorry, we're not accepting prepaid cards at this time. Your credit card has "
802
  "not been charged. Please try with alternative payment method."
803
  msgstr ""
804
 
805
- #: includes/class-wc-gateway-stripe.php:449
806
  msgid "Please enter your IBAN account name."
807
  msgstr ""
808
 
809
- #: includes/class-wc-gateway-stripe.php:450
810
  msgid "Please enter your IBAN account number."
811
  msgstr ""
812
 
813
- #: includes/class-wc-gateway-stripe.php:451
814
  msgid "We couldn't initiate the payment. Please try again."
815
  msgstr ""
816
 
817
- #: includes/class-wc-gateway-stripe.php:462
818
  msgid "Billing First Name and Last Name are required."
819
  msgstr ""
820
 
821
- #: includes/class-wc-gateway-stripe.php:713
822
  #. translators: error message
823
  msgid "This represents the fee Stripe collects for the transaction."
824
  msgstr ""
825
 
826
- #: includes/class-wc-gateway-stripe.php:714
827
  msgid "Stripe Fee:"
828
  msgstr ""
829
 
830
- #: includes/class-wc-gateway-stripe.php:750
831
  msgid ""
832
  "This represents the net total that will be credited to your Stripe bank "
833
  "account. This may be in the currency that is set in your Stripe account."
834
  msgstr ""
835
 
836
- #: includes/class-wc-gateway-stripe.php:751
837
  msgid "Stripe Payout:"
838
  msgstr ""
839
 
840
- #: includes/class-wc-gateway-stripe.php:798
841
  #: includes/class-wc-stripe-order-handler.php:162
842
  #: includes/class-wc-stripe-webhook-handler.php:206
843
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:263
@@ -848,7 +848,7 @@ msgid ""
848
  "later."
849
  msgstr ""
850
 
851
- #: includes/class-wc-gateway-stripe.php:844
852
  msgid ""
853
  "Almost there!\n"
854
  "\n"
@@ -856,13 +856,13 @@ msgid ""
856
  "done is for you to authorize the payment with your bank."
857
  msgstr ""
858
 
859
- #: includes/class-wc-gateway-stripe.php:992
860
  #: includes/class-wc-stripe-webhook-handler.php:635
861
  #. translators: 1) The error message that was received from Stripe.
862
  msgid "Stripe SCA authentication failed. Reason: %s"
863
  msgstr ""
864
 
865
- #: includes/class-wc-gateway-stripe.php:993
866
  msgid "Stripe SCA authentication failed."
867
  msgstr ""
868
 
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.2.2\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
+ "POT-Creation-Date: 2019-06-26 20:05: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"
63
  msgstr ""
64
 
65
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:444
66
+ #: includes/class-wc-gateway-stripe.php:523
67
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:173
68
  #: includes/compat/class-wc-stripe-subs-compat.php:136
69
  msgid "Payment processing failed. Please retry."
99
  "WooCommerce Stripe - We see that you had the \"Require 3D secure when "
100
  "applicable\" setting turned on. This setting is not available here anymore, "
101
  "because it is now replaced by Stripe Radar. You can learn more about it <a "
102
+ "href=\"%s\" target=\"_blank\">here</a>."
103
  msgstr ""
104
 
105
  #: includes/admin/class-wc-stripe-admin-notices.php:129
747
  "your Stripe account keys</a>."
748
  msgstr ""
749
 
750
+ #: includes/class-wc-gateway-stripe.php:190
751
  #. translators: 1) Opening anchor tag 2) closing anchor tag
752
  msgid ""
753
  "If your billing address has been changed for saved payment methods, be sure "
754
  "to remove any %1$ssaved payment methods%2$s on file and re-add them."
755
  msgstr ""
756
 
757
+ #: includes/class-wc-gateway-stripe.php:251
758
  msgid "Add Card"
759
  msgstr ""
760
 
761
+ #: includes/class-wc-gateway-stripe.php:257
762
  msgid "Change Payment Method"
763
  msgstr ""
764
 
765
+ #: includes/class-wc-gateway-stripe.php:278
766
  #. translators: link to Stripe testing page
767
  msgid ""
768
  "TEST MODE ENABLED. In test mode, you can use the card number "
771
  "card numbers."
772
  msgstr ""
773
 
774
+ #: includes/class-wc-gateway-stripe.php:317
775
  msgid "Credit or debit card"
776
  msgstr ""
777
 
778
+ #: includes/class-wc-gateway-stripe.php:325
779
  msgid "Card Number"
780
  msgstr ""
781
 
782
+ #: includes/class-wc-gateway-stripe.php:336
783
  msgid "Expiry Date"
784
  msgstr ""
785
 
786
+ #: includes/class-wc-gateway-stripe.php:344
787
  msgid "Card Code (CVC)"
788
  msgstr ""
789
 
790
+ #: includes/class-wc-gateway-stripe.php:419
791
  msgid "Please accept the terms and conditions first"
792
  msgstr ""
793
 
794
+ #: includes/class-wc-gateway-stripe.php:420
795
  msgid "Please fill in required checkout fields first"
796
  msgstr ""
797
 
798
+ #: includes/class-wc-gateway-stripe.php:449
799
+ #: includes/class-wc-gateway-stripe.php:510
800
  msgid ""
801
  "Sorry, we're not accepting prepaid cards at this time. Your credit card has "
802
  "not been charged. Please try with alternative payment method."
803
  msgstr ""
804
 
805
+ #: includes/class-wc-gateway-stripe.php:450
806
  msgid "Please enter your IBAN account name."
807
  msgstr ""
808
 
809
+ #: includes/class-wc-gateway-stripe.php:451
810
  msgid "Please enter your IBAN account number."
811
  msgstr ""
812
 
813
+ #: includes/class-wc-gateway-stripe.php:452
814
  msgid "We couldn't initiate the payment. Please try again."
815
  msgstr ""
816
 
817
+ #: includes/class-wc-gateway-stripe.php:463
818
  msgid "Billing First Name and Last Name are required."
819
  msgstr ""
820
 
821
+ #: includes/class-wc-gateway-stripe.php:725
822
  #. translators: error message
823
  msgid "This represents the fee Stripe collects for the transaction."
824
  msgstr ""
825
 
826
+ #: includes/class-wc-gateway-stripe.php:726
827
  msgid "Stripe Fee:"
828
  msgstr ""
829
 
830
+ #: includes/class-wc-gateway-stripe.php:762
831
  msgid ""
832
  "This represents the net total that will be credited to your Stripe bank "
833
  "account. This may be in the currency that is set in your Stripe account."
834
  msgstr ""
835
 
836
+ #: includes/class-wc-gateway-stripe.php:763
837
  msgid "Stripe Payout:"
838
  msgstr ""
839
 
840
+ #: includes/class-wc-gateway-stripe.php:810
841
  #: includes/class-wc-stripe-order-handler.php:162
842
  #: includes/class-wc-stripe-webhook-handler.php:206
843
  #: includes/compat/class-wc-stripe-sepa-subs-compat.php:263
848
  "later."
849
  msgstr ""
850
 
851
+ #: includes/class-wc-gateway-stripe.php:856
852
  msgid ""
853
  "Almost there!\n"
854
  "\n"
856
  "done is for you to authorize the payment with your bank."
857
  msgstr ""
858
 
859
+ #: includes/class-wc-gateway-stripe.php:1015
860
  #: includes/class-wc-stripe-webhook-handler.php:635
861
  #. translators: 1) The error message that was received from Stripe.
862
  msgid "Stripe SCA authentication failed. Reason: %s"
863
  msgstr ""
864
 
865
+ #: includes/class-wc-gateway-stripe.php:1016
866
  msgid "Stripe SCA authentication failed."
867
  msgstr ""
868
 
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.2.1
6
  Requires PHP: 5.6
7
- Stable tag: 4.2.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -113,14 +113,12 @@ If you get stuck, you can ask for help in the Plugin Forum.
113
 
114
  == Changelog ==
115
 
116
- = 4.2.1 - 2019-06-17 =
117
- * Update - Add UGX (Ugandan Shilling) to zero decimal currency list.
118
- * Fix - CSRF verification error upon creating account on checkout.
119
- * Fix - Duplicate emails and order notes after successful transactions.
120
 
121
  [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
122
 
123
  == Upgrade Notice ==
124
 
125
- = 4.1 =
126
- 4.1 is a minor release. Please do a full site backup and test on a staging site before deploying to a live/production server.
4
  Requires at least: 4.4
5
  Tested up to: 5.2.1
6
  Requires PHP: 5.6
7
+ Stable tag: 4.2.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
113
 
114
  == Changelog ==
115
 
116
+ = 4.2.2 - 2019-06-26 =
117
+ * Fix - Changing an order status to "Cancelled" or "Refunded" will no longer refund the payment, will only void the payment if it was just authorized.
 
 
118
 
119
  [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
120
 
121
  == Upgrade Notice ==
122
 
123
+ = 4.2 =
124
+ 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.
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.2.1
9
  * Requires at least: 4.4
10
  * Tested up to: 5.2.1
11
  * WC requires at least: 2.6
@@ -46,7 +46,7 @@ function woocommerce_gateway_stripe_init() {
46
  /**
47
  * Required minimums and constants
48
  */
49
- define( 'WC_STRIPE_VERSION', '4.2.1' );
50
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
51
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
52
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.2.2
9
  * Requires at least: 4.4
10
  * Tested up to: 5.2.1
11
  * WC requires at least: 2.6
46
  /**
47
  * Required minimums and constants
48
  */
49
+ define( 'WC_STRIPE_VERSION', '4.2.2' );
50
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
51
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
52
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );