WooCommerce Stripe Payment Gateway - Version 4.5.0

Version Description

2020-06-24 = * Tweak - Improve branded Google Pay button user agent detection. * Add - New filter to manage the display of payment request buttons in cart. * Fix - Display Apple Pay button with text if branded type is text and logo. * Fix - Prevent branded payment request button duplication when checkout is re-calculated. * Fix - Payment request buttons on a single product page now correctly show the product name instead of a subtotal. * Fix - Quotes in variadic product attributes no longer cause payment request buttons to show only the cheapest variation.

Download this release

Release Info

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

Code changes from version 4.4.0 to 4.5.0

assets/js/stripe-payment-request.js CHANGED
@@ -220,7 +220,8 @@ jQuery( function( $ ) {
220
  city: address.city,
221
  address: typeof address.addressLine[0] === 'undefined' ? '' : address.addressLine[0],
222
  address_2: typeof address.addressLine[1] === 'undefined' ? '' : address.addressLine[1],
223
- payment_request_type: paymentRequestType
 
224
  };
225
 
226
  return $.ajax( {
@@ -240,7 +241,8 @@ jQuery( function( $ ) {
240
  var data = {
241
  security: wc_stripe_payment_request_params.nonce.update_shipping,
242
  shipping_method: [ shippingOption.id ],
243
- payment_request_type: paymentRequestType
 
244
  };
245
 
246
  return $.ajax( {
@@ -481,8 +483,8 @@ jQuery( function( $ ) {
481
  } else {
482
  // Not implemented branded buttons default to Stripe's button
483
  // Apple Pay buttons can also fall back to Stripe's button, as it's already branded
484
- // Set button type to default to avoid issues with Stripe
485
- wc_stripe_payment_request_params.button.type = 'default';
486
  }
487
  }
488
 
@@ -514,7 +516,11 @@ jQuery( function( $ ) {
514
  },
515
 
516
  shouldUseGooglePayBrand: function () {
517
- return window.navigator.userAgent.match(/Chrome\/([0-9]+)\./i) && 'Google Inc.' == window.navigator.vendor;
 
 
 
 
518
  },
519
 
520
  createGooglePayButton: function () {
@@ -640,7 +646,7 @@ jQuery( function( $ ) {
640
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
641
  } else if ( wc_stripe_payment_request.isBrandedPaymentRequestButton( prButton ) ) {
642
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
643
- $( '#wc-stripe-payment-request-button' ).append( prButton );
644
  } else if ( $( '#wc-stripe-payment-request-button' ).length ) {
645
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
646
  prButton.mount( '#wc-stripe-payment-request-button' );
220
  city: address.city,
221
  address: typeof address.addressLine[0] === 'undefined' ? '' : address.addressLine[0],
222
  address_2: typeof address.addressLine[1] === 'undefined' ? '' : address.addressLine[1],
223
+ payment_request_type: paymentRequestType,
224
+ is_product_page: wc_stripe_payment_request_params.is_product_page,
225
  };
226
 
227
  return $.ajax( {
241
  var data = {
242
  security: wc_stripe_payment_request_params.nonce.update_shipping,
243
  shipping_method: [ shippingOption.id ],
244
+ payment_request_type: paymentRequestType,
245
+ is_product_page: wc_stripe_payment_request_params.is_product_page,
246
  };
247
 
248
  return $.ajax( {
483
  } else {
484
  // Not implemented branded buttons default to Stripe's button
485
  // Apple Pay buttons can also fall back to Stripe's button, as it's already branded
486
+ // Set button type to default or buy, depending on branded type, to avoid issues with Stripe
487
+ wc_stripe_payment_request_params.button.type = 'long' === wc_stripe_payment_request_params.button.branded_type ? 'buy' : 'default';
488
  }
489
  }
490
 
516
  },
517
 
518
  shouldUseGooglePayBrand: function () {
519
+ var ua = window.navigator.userAgent.toLowerCase();
520
+ var isChrome = /chrome/.test( ua ) && ! /edge|edg|opr|brave\//.test( ua ) && 'Google Inc.' === window.navigator.vendor;
521
+ // newer versions of Brave do not have the userAgent string
522
+ var isBrave = isChrome && window.navigator.brave;
523
+ return isChrome && ! isBrave;
524
  },
525
 
526
  createGooglePayButton: function () {
646
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
647
  } else if ( wc_stripe_payment_request.isBrandedPaymentRequestButton( prButton ) ) {
648
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
649
+ $( '#wc-stripe-payment-request-button' ).html( prButton );
650
  } else if ( $( '#wc-stripe-payment-request-button' ).length ) {
651
  $( '#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator' ).show();
652
  prButton.mount( '#wc-stripe-payment-request-button' );
assets/js/stripe-payment-request.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(i){"use strict";var o,u=Stripe(wc_stripe_payment_request_params.stripe.key),p={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(){var t={security:wc_stripe_payment_request_params.nonce.payment};i.ajax({type:"POST",data:t,url:p.getAjaxURL("get_cart_details"),success:function(t){p.startPaymentRequest(t)}})},getAttributes:function(){var t=i(".variations_form").find(".variations select"),a={},n=0,s=0;return t.each(function(){var t=i(this).data("attribute_name")||i(this).attr("name"),e=i(this).val()||"";0<e.length&&s++,n++,a[t]=e}),{count:n,chosenCount:s,data:a}},processSource:function(t,e){var a=p.getOrderData(t,e);return i.ajax({type:"POST",data:a,dataType:"json",url:p.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,s=a.owner.phone,r=a.owner.address,i=a.owner.name,o=t.shippingAddress,u={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==i?i.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==i?i.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==s?s:t.payerPhone.replace("/[() -]/g",""),billing_country:null!==r?r.country:"",billing_address_1:null!==r?r.line1:"",billing_address_2:null!==r?r.line2:"",billing_city:null!==r?r.city:"",billing_state:null!==r?r.state:"",billing_postcode:null!==r?r.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return o&&(u.shipping_first_name=o.recipient.split(" ").slice(0,1).join(" "),u.shipping_last_name=o.recipient.split(" ").slice(1).join(" "),u.shipping_company=o.organization,u.shipping_country=o.country,u.shipping_address_1=void 0===o.addressLine[0]?"":o.addressLine[0],u.shipping_address_2=void 0===o.addressLine[1]?"":o.addressLine[1],u.shipping_city=o.city,u.shipping_state=o.region,u.shipping_postcode=o.postalCode),u},getErrorMessageHTML:function(t){return i('<div class="woocommerce-error" />').text(t)},abortPayment:function(t,e){if(t.complete("fail"),i(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var a=i(".product");a.before(e),i("html, body").animate({scrollTop:a.prev(".woocommerce-error").offset().top},600)}else{var n=i(".shop_table.cart").closest("form");n.before(e),i("html, body").animate({scrollTop:n.prev(".woocommerce-error").offset().top},600)}},completePayment:function(t,e){p.block(),t.complete("success"),window.location=e},block:function(){i.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.shipping,country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1],payment_request_type:o};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[e.id],payment_request_type:o};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("update_shipping_method")})},addToCart:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var n={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[]},e=i("form.cart").serializeArray();return i.each(e,function(t,e){if(/^addon-/.test(e.name))if(/\[\]$/.test(e.name)){var a=e.name.substring(0,e.name.length-2);n[a]?n[a].push(e.value):n[a]=[e.value]}else n[e.name]=e.value}),i.ajax({type:"POST",data:n,url:p.getAjaxURL("add_to_cart")})},clearCart:function(){var t={security:wc_stripe_payment_request_params.nonce.clear_cart};return i.ajax({type:"POST",data:t,url:p.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(t){var a,e;a=wc_stripe_payment_request_params.is_product_page?e=p.getRequestOptionsFromLocal():(e={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems},t.order_data);var n=u.paymentRequest(e),s=u.elements({locale:wc_stripe_payment_request_params.button.locale}),r=p.createPaymentRequestButton(s,n);n.canMakePayment().then(function(t){t&&(o=t.applePay?"apple_pay":"payment_request_api",p.attachPaymentRequestButtonEventListeners(r,n),p.showPaymentRequestButton(r))}),n.on("shippingaddresschange",function(e){i.when(p.updateShippingOptions(a,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),n.on("shippingoptionchange",function(e){i.when(p.updateShippingDetails(a,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),n.on("source",function(e){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===e.source.card.funding?p.abortPayment(e,p.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):i.when(p.processSource(e,o)).then(function(t){"success"===t.result?p.completePayment(e,t.redirect):p.abortPayment(e,t.messages)})})},getSelectedProductData:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var e=(i("#product-addons-total").data("price_data")||[]).reduce(function(t,e){return t+e.cost},0),a={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[],addon_value:e};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_selected_product_data")})},debounce:function(n,s,r){var i;return function(){var t=this,e=arguments,a=r&&!i;clearTimeout(i),i=setTimeout(function(){i=null,r||s.apply(t,e)},n),a&&s.apply(t,e)}},createPaymentRequestButton:function(t,e){var a;if(wc_stripe_payment_request_params.button.is_custom&&(a=i(wc_stripe_payment_request_params.button.css_selector)).length)return a.data("isCustom",!0),a;if(wc_stripe_payment_request_params.button.is_branded){if(p.shouldUseGooglePayBrand())return(a=p.createGooglePayButton()).data("isBranded",!0),a;wc_stripe_payment_request_params.button.type="default"}return t.create("paymentRequestButton",{paymentRequest:e,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}})},isCustomPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isCustom")},isBrandedPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isBranded")},shouldUseGooglePayBrand:function(){return window.navigator.userAgent.match(/Chrome\/([0-9]+)\./i)&&"Google Inc."==window.navigator.vendor},createGooglePayButton:function(){var t=wc_stripe_payment_request_params.button.theme,e=wc_stripe_payment_request_params.button.branded_type,a=wc_stripe_payment_request_params.button.locale,n=wc_stripe_payment_request_params.button.height;t=["dark","light"].includes(t)?t:"light",e=["short","long"].includes(e)?e:"long";var s=i('<button type="button" id="wc-stripe-branded-button" aria-label="Google Pay" class="gpay-button"></button>');s.css("height",n+"px"),s.addClass(t+" "+e),"long"===e&&function(t,e,a){t.css("background-image","url("+e+")");var n=document.createElement("img");n.onerror=function(){t.css("background-image","url("+a+")")},n.src=e}(s,"https://www.gstatic.com/instantbuy/svg/"+t+"/"+a+".svg","https://www.gstatic.com/instantbuy/svg/"+t+"/en.svg");return s},attachPaymentRequestButtonEventListeners:function(t,e){wc_stripe_payment_request_params.is_product_page?p.attachProductPageEventListeners(t,e):p.attachCartPageEventListeners(t,e)},attachProductPageEventListeners:function(e,a){var n=[],s=i(".single_add_to_cart_button");e.on("click",function(t){return s.is(".disabled")?(t.preventDefault(),void(s.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):s.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))):0<n.length?(t.preventDefault(),void window.alert(n)):(p.addToCart(),void((p.isCustomPaymentRequestButton(e)||p.isBrandedPaymentRequestButton(e))&&(t.preventDefault(),a.show())))}),i(document.body).on("woocommerce_variation_has_changed",function(){p.blockPaymentRequestButton(e),i.when(p.getSelectedProductData()).then(function(t){i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}),i(".quantity").on("input",".qty",function(){p.blockPaymentRequestButton(e)}),i(".quantity").on("input",".qty",p.debounce(250,function(){p.blockPaymentRequestButton(e),n=[],i.when(p.getSelectedProductData()).then(function(t){t.error?(n=[t.error],p.unblockPaymentRequestButton(e)):i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}))},attachCartPageEventListeners:function(t,e){(wc_stripe_payment_request_params.button.is_custom&&p.isCustomPaymentRequestButton(t)||wc_stripe_payment_request_params.button.is_branded&&p.isBrandedPaymentRequestButton(t))&&t.on("click",function(t){t.preventDefault(),e.show()})},showPaymentRequestButton:function(t){p.isCustomPaymentRequestButton(t)?(t.addClass("is-active"),i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show()):p.isBrandedPaymentRequestButton(t)?(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),i("#wc-stripe-payment-request-button").append(t)):i("#wc-stripe-payment-request-button").length&&(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),t.mount("#wc-stripe-payment-request-button"))},blockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").data("blockUI.isBlocked")||(i("#wc-stripe-payment-request-button").block({message:null}),p.isCustomPaymentRequestButton(t)&&t.addClass("is-blocked"))},unblockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").unblock(),p.isCustomPaymentRequestButton(t)&&t.removeClass("is-blocked")},init:function(){wc_stripe_payment_request_params.is_product_page?p.startPaymentRequest(""):p.getCartDetails()}};p.init(),i(document.body).on("updated_cart_totals",function(){p.init()}),i(document.body).on("updated_checkout",function(){p.init()})});
1
+ jQuery(function(i){"use strict";var o,u=Stripe(wc_stripe_payment_request_params.stripe.key),p={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(){var t={security:wc_stripe_payment_request_params.nonce.payment};i.ajax({type:"POST",data:t,url:p.getAjaxURL("get_cart_details"),success:function(t){p.startPaymentRequest(t)}})},getAttributes:function(){var t=i(".variations_form").find(".variations select"),a={},n=0,s=0;return t.each(function(){var t=i(this).data("attribute_name")||i(this).attr("name"),e=i(this).val()||"";0<e.length&&s++,n++,a[t]=e}),{count:n,chosenCount:s,data:a}},processSource:function(t,e){var a=p.getOrderData(t,e);return i.ajax({type:"POST",data:a,dataType:"json",url:p.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,s=a.owner.phone,r=a.owner.address,i=a.owner.name,o=t.shippingAddress,u={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==i?i.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==i?i.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==s?s:t.payerPhone.replace("/[() -]/g",""),billing_country:null!==r?r.country:"",billing_address_1:null!==r?r.line1:"",billing_address_2:null!==r?r.line2:"",billing_city:null!==r?r.city:"",billing_state:null!==r?r.state:"",billing_postcode:null!==r?r.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return o&&(u.shipping_first_name=o.recipient.split(" ").slice(0,1).join(" "),u.shipping_last_name=o.recipient.split(" ").slice(1).join(" "),u.shipping_company=o.organization,u.shipping_country=o.country,u.shipping_address_1=void 0===o.addressLine[0]?"":o.addressLine[0],u.shipping_address_2=void 0===o.addressLine[1]?"":o.addressLine[1],u.shipping_city=o.city,u.shipping_state=o.region,u.shipping_postcode=o.postalCode),u},getErrorMessageHTML:function(t){return i('<div class="woocommerce-error" />').text(t)},abortPayment:function(t,e){if(t.complete("fail"),i(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var a=i(".product");a.before(e),i("html, body").animate({scrollTop:a.prev(".woocommerce-error").offset().top},600)}else{var n=i(".shop_table.cart").closest("form");n.before(e),i("html, body").animate({scrollTop:n.prev(".woocommerce-error").offset().top},600)}},completePayment:function(t,e){p.block(),t.complete("success"),window.location=e},block:function(){i.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.shipping,country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[e.id],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("update_shipping_method")})},addToCart:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var n={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[]},e=i("form.cart").serializeArray();return i.each(e,function(t,e){if(/^addon-/.test(e.name))if(/\[\]$/.test(e.name)){var a=e.name.substring(0,e.name.length-2);n[a]?n[a].push(e.value):n[a]=[e.value]}else n[e.name]=e.value}),i.ajax({type:"POST",data:n,url:p.getAjaxURL("add_to_cart")})},clearCart:function(){var t={security:wc_stripe_payment_request_params.nonce.clear_cart};return i.ajax({type:"POST",data:t,url:p.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(t){var a,e;a=wc_stripe_payment_request_params.is_product_page?e=p.getRequestOptionsFromLocal():(e={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems},t.order_data);var n=u.paymentRequest(e),s=u.elements({locale:wc_stripe_payment_request_params.button.locale}),r=p.createPaymentRequestButton(s,n);n.canMakePayment().then(function(t){t&&(o=t.applePay?"apple_pay":"payment_request_api",p.attachPaymentRequestButtonEventListeners(r,n),p.showPaymentRequestButton(r))}),n.on("shippingaddresschange",function(e){i.when(p.updateShippingOptions(a,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),n.on("shippingoptionchange",function(e){i.when(p.updateShippingDetails(a,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),n.on("source",function(e){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===e.source.card.funding?p.abortPayment(e,p.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):i.when(p.processSource(e,o)).then(function(t){"success"===t.result?p.completePayment(e,t.redirect):p.abortPayment(e,t.messages)})})},getSelectedProductData:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var e=(i("#product-addons-total").data("price_data")||[]).reduce(function(t,e){return t+e.cost},0),a={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[],addon_value:e};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_selected_product_data")})},debounce:function(n,s,r){var i;return function(){var t=this,e=arguments,a=r&&!i;clearTimeout(i),i=setTimeout(function(){i=null,r||s.apply(t,e)},n),a&&s.apply(t,e)}},createPaymentRequestButton:function(t,e){var a;if(wc_stripe_payment_request_params.button.is_custom&&(a=i(wc_stripe_payment_request_params.button.css_selector)).length)return a.data("isCustom",!0),a;if(wc_stripe_payment_request_params.button.is_branded){if(p.shouldUseGooglePayBrand())return(a=p.createGooglePayButton()).data("isBranded",!0),a;wc_stripe_payment_request_params.button.type="long"===wc_stripe_payment_request_params.button.branded_type?"buy":"default"}return t.create("paymentRequestButton",{paymentRequest:e,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}})},isCustomPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isCustom")},isBrandedPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isBranded")},shouldUseGooglePayBrand:function(){var t=window.navigator.userAgent.toLowerCase(),e=/chrome/.test(t)&&!/edge|edg|opr|brave\//.test(t)&&"Google Inc."===window.navigator.vendor,a=e&&window.navigator.brave;return e&&!a},createGooglePayButton:function(){var t=wc_stripe_payment_request_params.button.theme,e=wc_stripe_payment_request_params.button.branded_type,a=wc_stripe_payment_request_params.button.locale,n=wc_stripe_payment_request_params.button.height;t=["dark","light"].includes(t)?t:"light",e=["short","long"].includes(e)?e:"long";var s=i('<button type="button" id="wc-stripe-branded-button" aria-label="Google Pay" class="gpay-button"></button>');s.css("height",n+"px"),s.addClass(t+" "+e),"long"===e&&function(t,e,a){t.css("background-image","url("+e+")");var n=document.createElement("img");n.onerror=function(){t.css("background-image","url("+a+")")},n.src=e}(s,"https://www.gstatic.com/instantbuy/svg/"+t+"/"+a+".svg","https://www.gstatic.com/instantbuy/svg/"+t+"/en.svg");return s},attachPaymentRequestButtonEventListeners:function(t,e){wc_stripe_payment_request_params.is_product_page?p.attachProductPageEventListeners(t,e):p.attachCartPageEventListeners(t,e)},attachProductPageEventListeners:function(e,a){var n=[],s=i(".single_add_to_cart_button");e.on("click",function(t){return s.is(".disabled")?(t.preventDefault(),void(s.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):s.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))):0<n.length?(t.preventDefault(),void window.alert(n)):(p.addToCart(),void((p.isCustomPaymentRequestButton(e)||p.isBrandedPaymentRequestButton(e))&&(t.preventDefault(),a.show())))}),i(document.body).on("woocommerce_variation_has_changed",function(){p.blockPaymentRequestButton(e),i.when(p.getSelectedProductData()).then(function(t){i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}),i(".quantity").on("input",".qty",function(){p.blockPaymentRequestButton(e)}),i(".quantity").on("input",".qty",p.debounce(250,function(){p.blockPaymentRequestButton(e),n=[],i.when(p.getSelectedProductData()).then(function(t){t.error?(n=[t.error],p.unblockPaymentRequestButton(e)):i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}))},attachCartPageEventListeners:function(t,e){(wc_stripe_payment_request_params.button.is_custom&&p.isCustomPaymentRequestButton(t)||wc_stripe_payment_request_params.button.is_branded&&p.isBrandedPaymentRequestButton(t))&&t.on("click",function(t){t.preventDefault(),e.show()})},showPaymentRequestButton:function(t){p.isCustomPaymentRequestButton(t)?(t.addClass("is-active"),i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show()):p.isBrandedPaymentRequestButton(t)?(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),i("#wc-stripe-payment-request-button").html(t)):i("#wc-stripe-payment-request-button").length&&(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),t.mount("#wc-stripe-payment-request-button"))},blockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").data("blockUI.isBlocked")||(i("#wc-stripe-payment-request-button").block({message:null}),p.isCustomPaymentRequestButton(t)&&t.addClass("is-blocked"))},unblockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").unblock(),p.isCustomPaymentRequestButton(t)&&t.removeClass("is-blocked")},init:function(){wc_stripe_payment_request_params.is_product_page?p.startPaymentRequest(""):p.getCartDetails()}};p.init(),i(document.body).on("updated_cart_totals",function(){p.init()}),i(document.body).on("updated_checkout",function(){p.init()})});
includes/payment-methods/class-wc-stripe-payment-request.php CHANGED
@@ -593,11 +593,8 @@ class WC_Stripe_Payment_Request {
593
 
594
  if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {
595
  return;
596
- } else {
597
- if ( ! $this->allowed_items_in_cart() ) {
598
- WC_Stripe_Logger::log( 'Items in the cart has unsupported product type ( Payment Request button disabled )' );
599
- return;
600
- }
601
  }
602
  ?>
603
  <div id="wc-stripe-payment-request-wrapper" style="clear:both;padding-top:1.5em;display:none;">
@@ -641,24 +638,37 @@ class WC_Stripe_Payment_Request {
641
 
642
  if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {
643
  return;
644
- } else {
645
- if ( ! $this->allowed_items_in_cart() ) {
646
- WC_Stripe_Logger::log( 'Items in the cart has unsupported product type ( Payment Request button disabled )' );
647
- return;
648
- }
649
  }
650
  ?>
651
  <p id="wc-stripe-payment-request-button-separator" style="margin-top:1.5em;text-align:center;display:none;">&mdash; <?php esc_html_e( 'OR', 'woocommerce-gateway-stripe' ); ?> &mdash;</p>
652
  <?php
653
  }
654
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  /**
656
  * Whether payment button html should be rendered
657
  *
658
  * @since 4.3.2
659
  *
660
- * @param object $post
661
- *
662
  * @return bool
663
  */
664
  private function should_show_payment_button_on_product_page() {
@@ -776,8 +786,10 @@ class WC_Stripe_Payment_Request {
776
  'address_2' => FILTER_SANITIZE_STRING,
777
  )
778
  );
 
 
779
 
780
- $data = $this->get_shipping_options( $shipping_address );
781
  wp_send_json( $data );
782
  }
783
 
@@ -785,11 +797,12 @@ class WC_Stripe_Payment_Request {
785
  * Gets shipping options available for specified shipping address
786
  *
787
  * @param array $shipping_address Shipping address.
 
788
  *
789
  * @return array Shipping options data.
790
  * phpcs:ignore Squiz.Commenting.FunctionCommentThrowTag
791
  */
792
- public function get_shipping_options( $shipping_address ) {
793
  try {
794
  // Set the shipping options.
795
  $data = array();
@@ -845,10 +858,10 @@ class WC_Stripe_Payment_Request {
845
 
846
  WC()->cart->calculate_totals();
847
 
848
- $data += $this->build_display_items();
849
  $data['result'] = 'success';
850
  } catch ( Exception $e ) {
851
- $data += $this->build_display_items();
852
  $data['result'] = 'invalid_shipping_address';
853
  }
854
 
@@ -870,8 +883,11 @@ class WC_Stripe_Payment_Request {
870
 
871
  WC()->cart->calculate_totals();
872
 
 
 
 
873
  $data = array();
874
- $data += $this->build_display_items();
875
  $data['result'] = 'success';
876
 
877
  wp_send_json( $data );
@@ -1196,7 +1212,7 @@ class WC_Stripe_Payment_Request {
1196
  * @since 3.1.0
1197
  * @version 4.0.0
1198
  */
1199
- protected function build_display_items() {
1200
  if ( ! defined( 'WOOCOMMERCE_CART' ) ) {
1201
  define( 'WOOCOMMERCE_CART', true );
1202
  }
@@ -1206,7 +1222,7 @@ class WC_Stripe_Payment_Request {
1206
  $discounts = 0;
1207
 
1208
  // Default show only subtotal instead of itemization.
1209
- if ( ! apply_filters( 'wc_stripe_payment_request_hide_itemization', true ) ) {
1210
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
1211
  $amount = $cart_item['line_subtotal'];
1212
  $subtotal += $cart_item['line_subtotal'];
593
 
594
  if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {
595
  return;
596
+ } else if ( ! $this->should_show_payment_button_on_cart() ) {
597
+ return;
 
 
 
598
  }
599
  ?>
600
  <div id="wc-stripe-payment-request-wrapper" style="clear:both;padding-top:1.5em;display:none;">
638
 
639
  if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {
640
  return;
641
+ } else if ( ! $this->should_show_payment_button_on_cart() ) {
642
+ return;
 
 
 
643
  }
644
  ?>
645
  <p id="wc-stripe-payment-request-button-separator" style="margin-top:1.5em;text-align:center;display:none;">&mdash; <?php esc_html_e( 'OR', 'woocommerce-gateway-stripe' ); ?> &mdash;</p>
646
  <?php
647
  }
648
 
649
+ /**
650
+ * Whether payment button html should be rendered on the Cart
651
+ *
652
+ * @since 4.4.1
653
+ *
654
+ * @return bool
655
+ */
656
+ private function should_show_payment_button_on_cart() {
657
+ if ( ! apply_filters( 'wc_stripe_show_payment_request_on_cart', true ) ) {
658
+ return false;
659
+ }
660
+ if ( ! $this->allowed_items_in_cart() ) {
661
+ WC_Stripe_Logger::log( 'Items in the cart has unsupported product type ( Payment Request button disabled )' );
662
+ return false;
663
+ }
664
+ return true;
665
+ }
666
+
667
  /**
668
  * Whether payment button html should be rendered
669
  *
670
  * @since 4.3.2
671
  *
 
 
672
  * @return bool
673
  */
674
  private function should_show_payment_button_on_product_page() {
786
  'address_2' => FILTER_SANITIZE_STRING,
787
  )
788
  );
789
+ $product_view_options = filter_input_array( INPUT_POST, [ 'is_product_page' => FILTER_SANITIZE_STRING ] );
790
+ $should_show_itemized_view = ! isset( $product_view_options['is_product_page'] ) ?: filter_var( $product_view_options['is_product_page'], FILTER_VALIDATE_BOOLEAN );
791
 
792
+ $data = $this->get_shipping_options( $shipping_address, $should_show_itemized_view );
793
  wp_send_json( $data );
794
  }
795
 
797
  * Gets shipping options available for specified shipping address
798
  *
799
  * @param array $shipping_address Shipping address.
800
+ * @param bool $itemized_display_items Indicates whether to show subtotals or itemized views.
801
  *
802
  * @return array Shipping options data.
803
  * phpcs:ignore Squiz.Commenting.FunctionCommentThrowTag
804
  */
805
+ public function get_shipping_options( $shipping_address, $itemized_display_items = false ) {
806
  try {
807
  // Set the shipping options.
808
  $data = array();
858
 
859
  WC()->cart->calculate_totals();
860
 
861
+ $data += $this->build_display_items( $itemized_display_items );
862
  $data['result'] = 'success';
863
  } catch ( Exception $e ) {
864
+ $data += $this->build_display_items( $itemized_display_items );
865
  $data['result'] = 'invalid_shipping_address';
866
  }
867
 
883
 
884
  WC()->cart->calculate_totals();
885
 
886
+ $product_view_options = filter_input_array( INPUT_POST, [ 'is_product_page' => FILTER_SANITIZE_STRING ] );
887
+ $should_show_itemized_view = ! isset( $product_view_options['is_product_page'] ) ?: filter_var( $product_view_options['is_product_page'], FILTER_VALIDATE_BOOLEAN );
888
+
889
  $data = array();
890
+ $data += $this->build_display_items( $should_show_itemized_view );
891
  $data['result'] = 'success';
892
 
893
  wp_send_json( $data );
1212
  * @since 3.1.0
1213
  * @version 4.0.0
1214
  */
1215
+ protected function build_display_items( $itemized_display_items = false ) {
1216
  if ( ! defined( 'WOOCOMMERCE_CART' ) ) {
1217
  define( 'WOOCOMMERCE_CART', true );
1218
  }
1222
  $discounts = 0;
1223
 
1224
  // Default show only subtotal instead of itemization.
1225
+ if ( ! apply_filters( 'wc_stripe_payment_request_hide_itemization', true ) || $itemized_display_items ) {
1226
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
1227
  $amount = $cart_item['line_subtotal'];
1228
  $subtotal += $cart_item['line_subtotal'];
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.4.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
- "POT-Creation-Date: 2020-05-21 10:30:15+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -1430,19 +1430,19 @@ msgid "Stripe SOFORT"
1430
  msgstr ""
1431
 
1432
  #: includes/payment-methods/class-wc-stripe-payment-request.php:314
1433
- #: includes/payment-methods/class-wc-stripe-payment-request.php:953
1434
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1244
1435
  msgid "Tax"
1436
  msgstr ""
1437
 
1438
  #: includes/payment-methods/class-wc-stripe-payment-request.php:322
1439
- #: includes/payment-methods/class-wc-stripe-payment-request.php:961
1440
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1251
1441
  msgid "Shipping"
1442
  msgstr ""
1443
 
1444
  #: includes/payment-methods/class-wc-stripe-payment-request.php:329
1445
- #: includes/payment-methods/class-wc-stripe-payment-request.php:968
1446
  msgid "Pending"
1447
  msgstr ""
1448
 
@@ -1455,31 +1455,31 @@ msgstr ""
1455
  msgid "Unknown shipping option \"[option]\"."
1456
  msgstr ""
1457
 
1458
- #: includes/payment-methods/class-wc-stripe-payment-request.php:651
1459
  msgid "OR"
1460
  msgstr ""
1461
 
1462
- #: includes/payment-methods/class-wc-stripe-payment-request.php:806
1463
  #: includes/payment-methods/class-wc-stripe-payment-request.php:819
 
1464
  msgid "Unable to find shipping method for address."
1465
  msgstr ""
1466
 
1467
- #: includes/payment-methods/class-wc-stripe-payment-request.php:915
1468
  msgid "Product with the ID (%d) cannot be found."
1469
  msgstr ""
1470
 
1471
- #: includes/payment-methods/class-wc-stripe-payment-request.php:936
1472
  #. translators: 1: product name 2: quantity in stock
1473
  msgid ""
1474
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1475
  "enough stock (%2$s remaining)."
1476
  msgstr ""
1477
 
1478
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1087
1479
  msgid "Empty cart"
1480
  msgstr ""
1481
 
1482
- #: includes/payment-methods/class-wc-stripe-payment-request.php:1258
1483
  msgid "Discount"
1484
  msgstr ""
1485
 
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.5.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
+ "POT-Creation-Date: 2020-06-24 03:55:47+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
1430
  msgstr ""
1431
 
1432
  #: includes/payment-methods/class-wc-stripe-payment-request.php:314
1433
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:969
1434
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1260
1435
  msgid "Tax"
1436
  msgstr ""
1437
 
1438
  #: includes/payment-methods/class-wc-stripe-payment-request.php:322
1439
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:977
1440
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1267
1441
  msgid "Shipping"
1442
  msgstr ""
1443
 
1444
  #: includes/payment-methods/class-wc-stripe-payment-request.php:329
1445
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:984
1446
  msgid "Pending"
1447
  msgstr ""
1448
 
1455
  msgid "Unknown shipping option \"[option]\"."
1456
  msgstr ""
1457
 
1458
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:645
1459
  msgid "OR"
1460
  msgstr ""
1461
 
 
1462
  #: includes/payment-methods/class-wc-stripe-payment-request.php:819
1463
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:832
1464
  msgid "Unable to find shipping method for address."
1465
  msgstr ""
1466
 
1467
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:931
1468
  msgid "Product with the ID (%d) cannot be found."
1469
  msgstr ""
1470
 
1471
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:952
1472
  #. translators: 1: product name 2: quantity in stock
1473
  msgid ""
1474
  "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1475
  "enough stock (%2$s remaining)."
1476
  msgstr ""
1477
 
1478
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1103
1479
  msgid "Empty cart"
1480
  msgstr ""
1481
 
1482
+ #: includes/payment-methods/class-wc-stripe-payment-request.php:1274
1483
  msgid "Discount"
1484
  msgstr ""
1485
 
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.4
6
  Requires PHP: 5.6
7
- Stable tag: 4.4.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -112,6 +112,14 @@ If you get stuck, you can ask for help in the Plugin Forum.
112
 
113
  == Changelog ==
114
 
 
 
 
 
 
 
 
 
115
  = 4.4.0 2020-05-21 =
116
  * Tweak - Remove support for WooCommerce versions lower than 3.0.
117
  * Tweak - Update plugin assets.
4
  Requires at least: 4.4
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
+ Stable tag: 4.5.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
112
 
113
  == Changelog ==
114
 
115
+ = 4.5.0 2020-06-24 =
116
+ * Tweak - Improve branded Google Pay button user agent detection.
117
+ * Add - New filter to manage the display of payment request buttons in cart.
118
+ * Fix - Display Apple Pay button with text if branded type is text and logo.
119
+ * Fix - Prevent branded payment request button duplication when checkout is re-calculated.
120
+ * Fix - Payment request buttons on a single product page now correctly show the product name instead of a subtotal.
121
+ * Fix - Quotes in variadic product attributes no longer cause payment request buttons to show only the cheapest variation.
122
+
123
  = 4.4.0 2020-05-21 =
124
  * Tweak - Remove support for WooCommerce versions lower than 3.0.
125
  * Tweak - Update plugin assets.
woocommerce-gateway-stripe.php CHANGED
@@ -5,11 +5,11 @@
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
- * Version: 4.4.0
9
  * Requires at least: 4.4
10
  * Tested up to: 5.4
11
  * WC requires at least: 3.0
12
- * WC tested up to: 4.0
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  /**
23
  * Required minimums and constants
24
  */
25
- define( 'WC_STRIPE_VERSION', '4.4.0' );
26
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
27
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
28
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.0' );
@@ -221,7 +221,7 @@ function woocommerce_gateway_stripe_init() {
221
  /**
222
  * Add plugin action links.
223
  *
224
- * @since 4.3.4
225
  * @param array $links Original list of plugin links.
226
  * @param string $file Name of current file.
227
  * @return array $links Update list of plugin links.
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.5.0
9
  * Requires at least: 4.4
10
  * Tested up to: 5.4
11
  * WC requires at least: 3.0
12
+ * WC tested up to: 4.2
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
22
  /**
23
  * Required minimums and constants
24
  */
25
+ define( 'WC_STRIPE_VERSION', '4.5.0' );
26
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
27
  define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
28
  define( 'WC_STRIPE_FUTURE_MIN_WC_VER', '3.0' );
221
  /**
222
  * Add plugin action links.
223
  *
224
+ * @since 4.3.4
225
  * @param array $links Original list of plugin links.
226
  * @param string $file Name of current file.
227
  * @return array $links Update list of plugin links.