WooCommerce Stripe Payment Gateway - Version 3.0.4

Version Description

  • Fix - Missing min files.
Download this release

Release Info

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

Code changes from version 3.0.3 to 3.0.4

assets/js/stripe.js CHANGED
@@ -2,8 +2,6 @@
2
  Stripe.setPublishableKey( wc_stripe_params.key );
3
 
4
  jQuery( function( $ ) {
5
- 'use strict';
6
-
7
  /* Open and close for legacy class */
8
  $( 'form.checkout, form#order_review' ).on( 'change', 'input[name="wc-stripe-payment-token"]', function() {
9
  if ( 'new' === $( '.stripe-legacy-payment-fields input[name="wc-stripe-payment-token"]:checked' ).val() ) {
2
  Stripe.setPublishableKey( wc_stripe_params.key );
3
 
4
  jQuery( function( $ ) {
 
 
5
  /* Open and close for legacy class */
6
  $( 'form.checkout, form#order_review' ).on( 'change', 'input[name="wc-stripe-payment-token"]', function() {
7
  if ( 'new' === $( '.stripe-legacy-payment-fields input[name="wc-stripe-payment-token"]:checked' ).val() ) {
assets/js/stripe.min.js CHANGED
@@ -1 +1 @@
1
- Stripe.setPublishableKey(wc_stripe_params.key),jQuery(function(a){"use strict";a("form.checkout, form#order_review").on("change",'input[name="wc-stripe-payment-token"]',function(){"new"===a('.stripe-legacy-payment-fields input[name="wc-stripe-payment-token"]:checked').val()?a(".stripe-legacy-payment-fields #stripe-payment-data").slideDown(200):a(".stripe-legacy-payment-fields #stripe-payment-data").slideUp(200)});var b={init:function(){a("form.woocommerce-checkout").length&&(this.form=a("form.woocommerce-checkout")),a("form.woocommerce-checkout").on("checkout_place_order_stripe",this.onSubmit),a("form#order_review").length&&(this.form=a("form#order_review")),a("form#order_review").on("submit",this.onSubmit),a("form#add_payment_method").length&&(this.form=a("form#add_payment_method")),a("form#add_payment_method").on("submit",this.onSubmit),a(document).on("change","#wc-stripe-cc-form :input",this.onCCFormChange).on("stripeError",this.onError)},isStripeChosen:function(){return a("#payment_method_stripe").is(":checked")&&(!a('input[name="wc-stripe-payment-token"]:checked').length||"new"===a('input[name="wc-stripe-payment-token"]:checked').val())},hasToken:function(){return 0<a("input.stripe_token").length},block:function(){b.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){b.form.unblock()},onError:function(c,d){var e=d.response.error.message;wc_stripe_params.hasOwnProperty(d.response.error.code)&&(e=wc_stripe_params[d.response.error.code]),a(".woocommerce-error, .stripe_token").remove(),a("#stripe-card-number").closest("p").before('<ul class="woocommerce_error woocommerce-error"><li>'+e+"</li></ul>"),b.unblock()},onSubmit:function(c){if(b.isStripeChosen()&&!b.hasToken()){c.preventDefault(),b.block();var d=a("#stripe-card-number").val(),e=a("#stripe-card-cvc").val(),f=a("#stripe-card-expiry").payment("cardExpiryVal"),g=a("#billing_first_name").length?a("#billing_first_name").val():wc_stripe_params.billing_first_name,h=a("#billing_last_name").length?a("#billing_last_name").val():wc_stripe_params.billing_last_name,i={number:d,cvc:e,exp_month:parseInt(f.month,10)||0,exp_year:parseInt(f.year,10)||0};return g&&h&&(i.name=g+" "+h),a("#billing_address_1").length>0?(i.address_line1=a("#billing_address_1").val(),i.address_line2=a("#billing_address_2").val(),i.address_state=a("#billing_state").val(),i.address_city=a("#billing_city").val(),i.address_zip=a("#billing_postcode").val(),i.address_country=a("#billing_country").val()):wc_stripe_params.billing_address_1&&(i.address_line1=wc_stripe_params.billing_address_1,i.address_line2=wc_stripe_params.billing_address_2,i.address_state=wc_stripe_params.billing_state,i.address_city=wc_stripe_params.billing_city,i.address_zip=wc_stripe_params.billing_postcode,i.address_country=wc_stripe_params.billing_country),Stripe.createToken(i,b.onStripeResponse),!1}},onCCFormChange:function(){a(".woocommerce-error, .stripe_token").remove()},onStripeResponse:function(c,d){if(d.error)a(document).trigger("stripeError",{response:d});else{if("no"===wc_stripe_params.allow_prepaid_card&&"prepaid"===d.card.funding)return d.error={message:wc_stripe_params.no_prepaid_card_msg},a(document).trigger("stripeError",{response:d}),!1;var e=d.id;b.form.append("<input type='hidden' class='stripe_token' name='stripe_token' value='"+e+"'/>"),b.form.submit()}}};b.init()});
1
+ Stripe.setPublishableKey(wc_stripe_params.key),jQuery(function(a){a("form.checkout, form#order_review").on("change",'input[name="wc-stripe-payment-token"]',function(){"new"===a('.stripe-legacy-payment-fields input[name="wc-stripe-payment-token"]:checked').val()?a(".stripe-legacy-payment-fields #stripe-payment-data").slideDown(200):a(".stripe-legacy-payment-fields #stripe-payment-data").slideUp(200)});var b={init:function(){a("form.woocommerce-checkout").length&&(this.form=a("form.woocommerce-checkout")),a("form.woocommerce-checkout").on("checkout_place_order_stripe",this.onSubmit),a("form#order_review").length&&(this.form=a("form#order_review")),a("form#order_review").on("submit",this.onSubmit),a("form#add_payment_method").length&&(this.form=a("form#add_payment_method")),a("form#add_payment_method").on("submit",this.onSubmit),a(document).on("change","#wc-stripe-cc-form :input",this.onCCFormChange).on("stripeError",this.onError)},isStripeChosen:function(){return a("#payment_method_stripe").is(":checked")&&(!a('input[name="wc-stripe-payment-token"]:checked').length||"new"===a('input[name="wc-stripe-payment-token"]:checked').val())},hasToken:function(){return 0<a("input.stripe_token").length},block:function(){b.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){b.form.unblock()},onError:function(c,d){var e=d.response.error.message;wc_stripe_params.hasOwnProperty(d.response.error.code)&&(e=wc_stripe_params[d.response.error.code]),a(".woocommerce-error, .stripe_token").remove(),a("#stripe-card-number").closest("p").before('<ul class="woocommerce_error woocommerce-error"><li>'+e+"</li></ul>"),b.unblock()},onSubmit:function(c){if(b.isStripeChosen()&&!b.hasToken()){c.preventDefault(),b.block();var d=a("#stripe-card-number").val(),e=a("#stripe-card-cvc").val(),f=a("#stripe-card-expiry").payment("cardExpiryVal"),g=a("#billing_first_name").length?a("#billing_first_name").val():wc_stripe_params.billing_first_name,h=a("#billing_last_name").length?a("#billing_last_name").val():wc_stripe_params.billing_last_name,i={number:d,cvc:e,exp_month:parseInt(f.month,10)||0,exp_year:parseInt(f.year,10)||0};return g&&h&&(i.name=g+" "+h),a("#billing_address_1").length>0?(i.address_line1=a("#billing_address_1").val(),i.address_line2=a("#billing_address_2").val(),i.address_state=a("#billing_state").val(),i.address_city=a("#billing_city").val(),i.address_zip=a("#billing_postcode").val(),i.address_country=a("#billing_country").val()):wc_stripe_params.billing_address_1&&(i.address_line1=wc_stripe_params.billing_address_1,i.address_line2=wc_stripe_params.billing_address_2,i.address_state=wc_stripe_params.billing_state,i.address_city=wc_stripe_params.billing_city,i.address_zip=wc_stripe_params.billing_postcode,i.address_country=wc_stripe_params.billing_country),Stripe.createToken(i,b.onStripeResponse),!1}},onCCFormChange:function(){a(".woocommerce-error, .stripe_token").remove()},onStripeResponse:function(c,d){if(d.error)a(document).trigger("stripeError",{response:d});else{if("no"===wc_stripe_params.allow_prepaid_card&&"prepaid"===d.card.funding)return d.error={message:wc_stripe_params.no_prepaid_card_msg},a(document).trigger("stripeError",{response:d}),!1;var e=d.id;b.form.append("<input type='hidden' class='stripe_token' name='stripe_token' value='"+e+"'/>"),b.form.submit()}}};b.init()});
assets/js/stripe_checkout.js CHANGED
@@ -1,6 +1,4 @@
1
  jQuery( function( $ ) {
2
- 'use strict';
3
-
4
  /**
5
  * Object to handle Stripe payment forms.
6
  */
@@ -27,7 +25,8 @@ jQuery( function( $ ) {
27
  },
28
 
29
  isStripeModalNeeded: function( e ) {
30
- var token = wc_stripe_form.form.find( 'input.stripe_token' );
 
31
 
32
  // If this is a stripe submission (after modal) and token exists, allow submit.
33
  if ( wc_stripe_form.stripe_submit && token ) {
1
  jQuery( function( $ ) {
 
 
2
  /**
3
  * Object to handle Stripe payment forms.
4
  */
25
  },
26
 
27
  isStripeModalNeeded: function( e ) {
28
+ var token = wc_stripe_form.form.find( 'input.stripe_token' ),
29
+ $required_inputs;
30
 
31
  // If this is a stripe submission (after modal) and token exists, allow submit.
32
  if ( wc_stripe_form.stripe_submit && token ) {
assets/js/stripe_checkout.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){"use strict";var b={init:function(b){this.form=b,this.stripe_submit=!1,a(this.form).on("click","#place_order",this.onSubmit).on("submit checkout_place_order_stripe")},isStripeChosen:function(){return a("#payment_method_stripe").is(":checked")&&(!a('input[name="wc-stripe-payment-token"]:checked').length||"new"===a('input[name="wc-stripe-payment-token"]:checked').val())},isStripeModalNeeded:function(c){var d=b.form.find("input.stripe_token");if(b.stripe_submit&&d)return!1;if(!b.isStripeChosen())return!1;if(1===a("input#terms").length&&0===a("input#terms:checked").length)return!1;if(a("#createaccount").is(":checked")&&a("#account_password").length&&""===a("#account_password").val())return!1;if(a("#ship-to-different-address-checkbox").is(":checked")?$required_inputs=a(".woocommerce-billing-fields .validate-required, .woocommerce-shipping-fields .validate-required"):$required_inputs=a(".woocommerce-billing-fields .validate-required"),$required_inputs.length){var e=!1;if($required_inputs.each(function(){""===a(this).find("input.input-text, select").not(a("#account_password, #account_username")).val()&&(e=!0)}),e)return!1}return!0},block:function(){b.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){b.form.unblock()},onClose:function(){b.unblock()},onSubmit:function(c){if(b.isStripeModalNeeded()){c.preventDefault();var d=b.form,e=a("#stripe-payment-data"),f=d.find("input.stripe_token");f.val("");var g=function(a){d.find("input.stripe_token").remove(),d.append('<input type="hidden" class="stripe_token" name="stripe_token" value="'+a.id+'"/>'),b.stripe_submit=!0,d.submit()};return StripeCheckout.open({key:wc_stripe_params.key,billingAddress:"yes"===wc_stripe_params.stripe_checkout_require_billing_address?!0:!1,amount:e.data("amount"),name:e.data("name"),description:e.data("description"),currency:e.data("currency"),image:e.data("image"),bitcoin:e.data("bitcoin"),locale:e.data("locale"),email:a("#billing_email").val()||e.data("email"),panelLabel:e.data("panel-label"),token:g,closed:b.onClose()}),!1}return!0}};b.init(a("form.checkout, form#order_review, form#add_payment_method"))});
1
+ jQuery(function(a){var b={init:function(b){this.form=b,this.stripe_submit=!1,a(this.form).on("click","#place_order",this.onSubmit).on("submit checkout_place_order_stripe")},isStripeChosen:function(){return a("#payment_method_stripe").is(":checked")&&(!a('input[name="wc-stripe-payment-token"]:checked').length||"new"===a('input[name="wc-stripe-payment-token"]:checked').val())},isStripeModalNeeded:function(c){var d,e=b.form.find("input.stripe_token");if(b.stripe_submit&&e)return!1;if(!b.isStripeChosen())return!1;if(1===a("input#terms").length&&0===a("input#terms:checked").length)return!1;if(a("#createaccount").is(":checked")&&a("#account_password").length&&""===a("#account_password").val())return!1;if(d=a(a("#ship-to-different-address-checkbox").is(":checked")?".woocommerce-billing-fields .validate-required, .woocommerce-shipping-fields .validate-required":".woocommerce-billing-fields .validate-required"),d.length){var f=!1;if(d.each(function(){""===a(this).find("input.input-text, select").not(a("#account_password, #account_username")).val()&&(f=!0)}),f)return!1}return!0},block:function(){b.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){b.form.unblock()},onClose:function(){b.unblock()},onSubmit:function(c){if(b.isStripeModalNeeded()){c.preventDefault();var d=b.form,e=a("#stripe-payment-data"),f=d.find("input.stripe_token");f.val("");var g=function(a){d.find("input.stripe_token").remove(),d.append('<input type="hidden" class="stripe_token" name="stripe_token" value="'+a.id+'"/>'),b.stripe_submit=!0,d.submit()};return StripeCheckout.open({key:wc_stripe_params.key,billingAddress:"yes"===wc_stripe_params.stripe_checkout_require_billing_address?!0:!1,amount:e.data("amount"),name:e.data("name"),description:e.data("description"),currency:e.data("currency"),image:e.data("image"),bitcoin:e.data("bitcoin"),locale:e.data("locale"),email:a("#billing_email").val()||e.data("email"),panelLabel:e.data("panel-label"),token:g,closed:b.onClose()}),!1}return!0}};b.init(a("form.checkout, form#order_review, form#add_payment_method"))});
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WooCommerce Stripe Payment Gateway ===
2
- Contributors: automattic, woothemes, mikejolley, akeda, royho
3
  Tags: credit card, stripe, woocommerce
4
  Requires at least: 4.4
5
  Tested up to: 4.5
6
- Stable tag: 3.0.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -87,6 +87,9 @@ If you get stuck, you can ask for help in the Plugin Forum.
87
 
88
  == Changelog ==
89
 
 
 
 
90
  = 3.0.3 =
91
  * Fix - Remove bitcoin icon when not using Stripe Checkout mode as it is not supported.
92
  * Fix - Failed payment order was not sending email to admin.
@@ -113,11 +116,5 @@ If you get stuck, you can ask for help in the Plugin Forum.
113
 
114
  == Upgrade Notice ==
115
 
116
- = 3.0.3 =
117
- * Fix - Remove bitcoin icon when not using Stripe Checkout mode as it is not supported.
118
- * Fix - Failed payment order was not sending email to admin.
119
- * Fix - Saved card option was not being honored.
120
- * New - Filter for WC_Payment_Gateway_CC::wc_stripe_generate_payment_request return value.
121
- * New - Filter to disallow prepaid cards. "wc_stripe_allow_prepaid_card".
122
- * New - Filter to require billing address on Stripe Modal Checkout. "wc_stripe_checkout_require_billing_address".
123
- * New - Localized Stripe error messages.
1
  === WooCommerce Stripe Payment Gateway ===
2
+ Contributors: automattic, woothemes, mikejolley, akeda, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, mikaey
3
  Tags: credit card, stripe, woocommerce
4
  Requires at least: 4.4
5
  Tested up to: 4.5
6
+ Stable tag: 3.0.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
87
 
88
  == Changelog ==
89
 
90
+ = 3.0.4 =
91
+ * Fix - Missing min files.
92
+
93
  = 3.0.3 =
94
  * Fix - Remove bitcoin icon when not using Stripe Checkout mode as it is not supported.
95
  * Fix - Failed payment order was not sending email to admin.
116
 
117
  == Upgrade Notice ==
118
 
119
+ = 3.0.4 =
120
+ * Fix - Missing min files.
 
 
 
 
 
 
woocommerce-gateway-stripe.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: Automattic
7
  * Author URI: https://woocommerce.com/
8
- * Version: 3.0.3
9
  * Text Domain: woocommerce-gateway-stripe
10
  * Domain Path: /languages
11
  *
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
32
  /**
33
  * Required minimums and constants
34
  */
35
- define( 'WC_STRIPE_VERSION', '3.0.3' );
36
  define( 'WC_STRIPE_MIN_PHP_VER', '5.3.0' );
37
  define( 'WC_STRIPE_MIN_WC_VER', '2.5.0' );
38
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: Automattic
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 3.0.4
9
  * Text Domain: woocommerce-gateway-stripe
10
  * Domain Path: /languages
11
  *
32
  /**
33
  * Required minimums and constants
34
  */
35
+ define( 'WC_STRIPE_VERSION', '3.0.4' );
36
  define( 'WC_STRIPE_MIN_PHP_VER', '5.3.0' );
37
  define( 'WC_STRIPE_MIN_WC_VER', '2.5.0' );
38
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );