WooCommerce Stripe Payment Gateway - Version 4.1.7

Version Description

  • 2018-06-06 =
  • Fix - Asynchronous payment methods such as SEPA, did not show order Stripe fees/net after payment succeed.
  • Fix - Missing semicolon on a CSS style value which causes display issues in some browsers.

See changelog for all versions.

=

Download this release

Release Info

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

Code changes from version 4.1.6 to 4.1.7

assets/css/stripe-styles.css CHANGED
@@ -152,7 +152,7 @@ form#order_review #wc-stripe_sepa-form { padding: 10px; }
152
  #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; }
153
 
154
  .woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand,
155
- #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 50%; margin-top: -10px right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; }
156
 
157
  .woocommerce-checkout #payment ul.payment_methods .stripe-card-group,
158
  #add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; }
152
  #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; }
153
 
154
  .woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand,
155
+ #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; }
156
 
157
  .woocommerce-checkout #payment ul.payment_methods .stripe-card-group,
158
  #add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; }
changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  *** Changelog ***
2
 
 
 
 
 
3
  = 4.1.6 - 2018-05-31 =
4
  * Fix - Radio buttons on checkout on some themes are not aligned properly.
5
  * Fix - False negative on SSL warning notice in admin.
1
  *** Changelog ***
2
 
3
+ = 4.1.7 - 2018-06-06 =
4
+ * Fix - Asynchronous payment methods such as SEPA, did not show order Stripe fees/net after payment succeed.
5
+ * Fix - Missing semicolon on a CSS style value which causes display issues in some browsers.
6
+
7
  = 4.1.6 - 2018-05-31 =
8
  * Fix - Radio buttons on checkout on some themes are not aligned properly.
9
  * Fix - False negative on SSL warning notice in admin.
includes/abstracts/abstract-wc-stripe-payment-gateway.php CHANGED
@@ -879,6 +879,30 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
879
  }
880
  }
881
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
882
  /**
883
  * Refund a charge.
884
  *
879
  }
880
  }
881
 
882
+ /**
883
+ * Updates Stripe currency in order meta.
884
+ *
885
+ * @since 4.1.7
886
+ * @param object $order The order object
887
+ * @param int $balance_transaction_id
888
+ */
889
+ public function update_currency( $order, $balance_transaction_id ) {
890
+ $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
891
+
892
+ $balance_transaction = WC_Stripe_API::retrieve( 'balance/history/' . $balance_transaction_id );
893
+
894
+ if ( empty( $balance_transaction->error ) ) {
895
+ $currency = ! empty( $balance_transaction->currency ) ? strtoupper( $balance_transaction->currency ) : null;
896
+ WC_Stripe_Helper::update_stripe_currency( $order, $currency );
897
+
898
+ if ( is_callable( array( $order, 'save' ) ) ) {
899
+ $order->save();
900
+ }
901
+ } else {
902
+ WC_Stripe_Logger::log( "Unable to update currency meta for order: {$order_id}" );
903
+ }
904
+ }
905
+
906
  /**
907
  * Refund a charge.
908
  *
includes/class-wc-stripe-logger.php CHANGED
@@ -27,7 +27,11 @@ class WC_Stripe_Logger {
27
 
28
  if ( apply_filters( 'wc_stripe_logging', true, $message ) ) {
29
  if ( empty( self::$logger ) ) {
30
- self::$logger = new WC_Logger();
 
 
 
 
31
  }
32
 
33
  $settings = get_option( 'woocommerce_stripe_settings' );
@@ -53,7 +57,11 @@ class WC_Stripe_Logger {
53
 
54
  }
55
 
56
- self::$logger->add( self::WC_LOG_FILENAME, $log_entry );
 
 
 
 
57
  }
58
  }
59
  }
27
 
28
  if ( apply_filters( 'wc_stripe_logging', true, $message ) ) {
29
  if ( empty( self::$logger ) ) {
30
+ if ( version_compare( WC_VERSION, '3.0.0', '>=' ) ) {
31
+ self::$logger = wc_get_logger();
32
+ } else {
33
+ self::$logger = new WC_Logger();
34
+ }
35
  }
36
 
37
  $settings = get_option( 'woocommerce_stripe_settings' );
57
 
58
  }
59
 
60
+ if ( version_compare( WC_VERSION, '3.0.0', '>=' ) ) {
61
+ self::$logger->debug( $log_entry, array( 'source' => self::WC_LOG_FILENAME ) );
62
+ } else {
63
+ self::$logger->add( self::WC_LOG_FILENAME, $log_entry );
64
+ }
65
  }
66
  }
67
  }
includes/class-wc-stripe-webhook-handler.php CHANGED
@@ -353,6 +353,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
353
 
354
  if ( isset( $notification->data->object->balance_transaction ) ) {
355
  $this->update_fees( $order, $notification->data->object->balance_transaction );
 
356
  }
357
 
358
  $order->payment_complete( $notification->data->object->id );
353
 
354
  if ( isset( $notification->data->object->balance_transaction ) ) {
355
  $this->update_fees( $order, $notification->data->object->balance_transaction );
356
+ $this->update_currency( $order, $notification->data->object->balance_transaction );
357
  }
358
 
359
  $order->payment_complete( $notification->data->object->id );
includes/payment-methods/class-wc-stripe-payment-request.php CHANGED
@@ -458,6 +458,7 @@ class WC_Stripe_Payment_Request {
458
  // If no SSL bail.
459
  if ( ! $this->testmode && ! is_ssl() ) {
460
  WC_Stripe_Logger::log( 'Stripe Payment Request live mode requires SSL.' );
 
461
  }
462
 
463
  if ( ! is_product() && ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_order'] ) ) {
458
  // If no SSL bail.
459
  if ( ! $this->testmode && ! is_ssl() ) {
460
  WC_Stripe_Logger::log( 'Stripe Payment Request live mode requires SSL.' );
461
+ return;
462
  }
463
 
464
  if ( ! is_product() && ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_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.1.6\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
- "POT-Creation-Date: 2018-05-31 19:36:20+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -57,7 +57,7 @@ msgstr ""
57
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:459
58
  #: includes/class-wc-stripe-order-handler.php:245
59
  #: includes/class-wc-stripe-webhook-handler.php:314
60
- #: includes/class-wc-stripe-webhook-handler.php:361
61
  #. translators: transaction id
62
  msgid "Stripe charge complete (Charge ID: %s)"
63
  msgstr ""
@@ -80,16 +80,16 @@ msgstr ""
80
  msgid "Invalid payment method. Please input a new card number."
81
  msgstr ""
82
 
83
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:950
84
  #. translators: 1) dollar amount 2) transaction id 3) refund message
85
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
86
  msgstr ""
87
 
88
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:950
89
  msgid "Pre-Authorization Released"
90
  msgstr ""
91
 
92
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:968
93
  msgid "There was a problem adding the card."
94
  msgstr ""
95
 
@@ -1028,29 +1028,29 @@ msgstr ""
1028
  msgid "This charge was partially captured via Stripe Dashboard in the amount of: %s"
1029
  msgstr ""
1030
 
1031
- #: includes/class-wc-stripe-webhook-handler.php:390
1032
  msgid "This payment failed to clear."
1033
  msgstr ""
1034
 
1035
- #: includes/class-wc-stripe-webhook-handler.php:417
1036
  msgid "This payment has cancelled."
1037
  msgstr ""
1038
 
1039
- #: includes/class-wc-stripe-webhook-handler.php:451
1040
  msgid "Refunded via Stripe Dashboard"
1041
  msgstr ""
1042
 
1043
- #: includes/class-wc-stripe-webhook-handler.php:451
1044
- #: includes/class-wc-stripe-webhook-handler.php:477
1045
  msgid "Pre-Authorization Released via Stripe Dashboard"
1046
  msgstr ""
1047
 
1048
- #: includes/class-wc-stripe-webhook-handler.php:477
1049
  #. translators: 1) dollar amount 2) transaction id 3) refund message
1050
  msgid "Refunded %1$s - Refund ID: %2$s - %3$s"
1051
  msgstr ""
1052
 
1053
- #: includes/class-wc-stripe-webhook-handler.php:499
1054
  #. translators: 1) The URL to the order. 2) The reason type.
1055
  msgid ""
1056
  "A review has been opened for this order. Action is needed. Please go to "
@@ -1058,7 +1058,7 @@ msgid ""
1058
  "Dashboard</a> to review the issue. Reason: (%2$s)"
1059
  msgstr ""
1060
 
1061
- #: includes/class-wc-stripe-webhook-handler.php:523
1062
  #. translators: 1) The reason type.
1063
  msgid "The opened review for this order is now closed. Reason: (%s)"
1064
  msgstr ""
@@ -1228,45 +1228,45 @@ msgid "Stripe SOFORT"
1228
  msgstr ""
1229
 
1230
  #: includes/payment-methods/class-wc-stripe-payment-request.php:269
1231
- #: includes/payment-methods/class-wc-stripe-payment-request.php:832
1232
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1132
1233
  msgid "Tax"
1234
  msgstr ""
1235
 
1236
  #: includes/payment-methods/class-wc-stripe-payment-request.php:277
1237
- #: includes/payment-methods/class-wc-stripe-payment-request.php:840
1238
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1139
1239
  msgid "Shipping"
1240
  msgstr ""
1241
 
1242
  #: includes/payment-methods/class-wc-stripe-payment-request.php:284
1243
- #: includes/payment-methods/class-wc-stripe-payment-request.php:847
1244
  msgid "Pending"
1245
  msgstr ""
1246
 
1247
- #: includes/payment-methods/class-wc-stripe-payment-request.php:506
1248
  msgid "Sorry, we're not accepting prepaid cards at this time."
1249
  msgstr ""
1250
 
1251
- #: includes/payment-methods/class-wc-stripe-payment-request.php:508
1252
  #. translators: Do not translate the [option] placeholder
1253
  msgid "Unknown shipping option \"[option]\"."
1254
  msgstr ""
1255
 
1256
- #: includes/payment-methods/class-wc-stripe-payment-request.php:630
1257
  msgid "OR"
1258
  msgstr ""
1259
 
1260
- #: includes/payment-methods/class-wc-stripe-payment-request.php:721
1261
- #: includes/payment-methods/class-wc-stripe-payment-request.php:734
1262
  msgid "Unable to find shipping method for address."
1263
  msgstr ""
1264
 
1265
- #: includes/payment-methods/class-wc-stripe-payment-request.php:967
1266
  msgid "Empty cart"
1267
  msgstr ""
1268
 
1269
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1146
1270
  msgid "Discount"
1271
  msgstr ""
1272
 
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.7\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
+ "POT-Creation-Date: 2018-06-06 15:36:21+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
57
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:459
58
  #: includes/class-wc-stripe-order-handler.php:245
59
  #: includes/class-wc-stripe-webhook-handler.php:314
60
+ #: includes/class-wc-stripe-webhook-handler.php:362
61
  #. translators: transaction id
62
  msgid "Stripe charge complete (Charge ID: %s)"
63
  msgstr ""
80
  msgid "Invalid payment method. Please input a new card number."
81
  msgstr ""
82
 
83
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:974
84
  #. translators: 1) dollar amount 2) transaction id 3) refund message
85
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
86
  msgstr ""
87
 
88
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:974
89
  msgid "Pre-Authorization Released"
90
  msgstr ""
91
 
92
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:992
93
  msgid "There was a problem adding the card."
94
  msgstr ""
95
 
1028
  msgid "This charge was partially captured via Stripe Dashboard in the amount of: %s"
1029
  msgstr ""
1030
 
1031
+ #: includes/class-wc-stripe-webhook-handler.php:391
1032
  msgid "This payment failed to clear."
1033
  msgstr ""
1034
 
1035
+ #: includes/class-wc-stripe-webhook-handler.php:418
1036
  msgid "This payment has cancelled."
1037
  msgstr ""
1038
 
1039
+ #: includes/class-wc-stripe-webhook-handler.php:452
1040
  msgid "Refunded via Stripe Dashboard"
1041
  msgstr ""
1042
 
1043
+ #: includes/class-wc-stripe-webhook-handler.php:452
1044
+ #: includes/class-wc-stripe-webhook-handler.php:478
1045
  msgid "Pre-Authorization Released via Stripe Dashboard"
1046
  msgstr ""
1047
 
1048
+ #: includes/class-wc-stripe-webhook-handler.php:478
1049
  #. translators: 1) dollar amount 2) transaction id 3) refund message
1050
  msgid "Refunded %1$s - Refund ID: %2$s - %3$s"
1051
  msgstr ""
1052
 
1053
+ #: includes/class-wc-stripe-webhook-handler.php:500
1054
  #. translators: 1) The URL to the order. 2) The reason type.
1055
  msgid ""
1056
  "A review has been opened for this order. Action is needed. Please go to "
1058
  "Dashboard</a> to review the issue. Reason: (%2$s)"
1059
  msgstr ""
1060
 
1061
+ #: includes/class-wc-stripe-webhook-handler.php:524
1062
  #. translators: 1) The reason type.
1063
  msgid "The opened review for this order is now closed. Reason: (%s)"
1064
  msgstr ""
1228
  msgstr ""
1229
 
1230
  #: includes/payment-methods/class-wc-stripe-payment-request.php:269
1231
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:833
1232
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1133
1233
  msgid "Tax"
1234
  msgstr ""
1235
 
1236
  #: includes/payment-methods/class-wc-stripe-payment-request.php:277
1237
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:841
1238
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1140
1239
  msgid "Shipping"
1240
  msgstr ""
1241
 
1242
  #: includes/payment-methods/class-wc-stripe-payment-request.php:284
1243
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:848
1244
  msgid "Pending"
1245
  msgstr ""
1246
 
1247
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:507
1248
  msgid "Sorry, we're not accepting prepaid cards at this time."
1249
  msgstr ""
1250
 
1251
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:509
1252
  #. translators: Do not translate the [option] placeholder
1253
  msgid "Unknown shipping option \"[option]\"."
1254
  msgstr ""
1255
 
1256
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:631
1257
  msgid "OR"
1258
  msgstr ""
1259
 
1260
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:722
1261
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:735
1262
  msgid "Unable to find shipping method for address."
1263
  msgstr ""
1264
 
1265
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:968
1266
  msgid "Empty cart"
1267
  msgstr ""
1268
 
1269
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1147
1270
  msgid "Discount"
1271
  msgstr ""
1272
 
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.6
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -101,9 +101,9 @@ If you get stuck, you can ask for help in the Plugin Forum.
101
 
102
  == Changelog ==
103
 
104
- = 4.1.6 - 2018-05-31 =
105
- * Fix - Radio buttons on checkout on some themes are not aligned properly.
106
- * Fix - False negative on SSL warning notice in admin.
107
 
108
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
109
 
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.6
7
+ Stable tag: 4.1.7
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.7 - 2018-06-06 =
105
+ * Fix - Asynchronous payment methods such as SEPA, did not show order Stripe fees/net after payment succeed.
106
+ * Fix - Missing semicolon on a CSS style value which causes display issues in some browsers.
107
 
108
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
109
 
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.6
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
@@ -44,7 +44,7 @@ function woocommerce_gateway_stripe_init() {
44
  /**
45
  * Required minimums and constants
46
  */
47
- define( 'WC_STRIPE_VERSION', '4.1.6' );
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__ );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.1.7
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
44
  /**
45
  * Required minimums and constants
46
  */
47
+ define( 'WC_STRIPE_VERSION', '4.1.7' );
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__ );