Payment Plugins for Stripe WooCommerce - Version 3.3.25

Version Description

  • 8/3/22 =
  • Added - Advanced Settings option so merchants can control if the processing or completed status triggers the capture for an authorized order
  • Fixed - Customer pay for order page error caused by Stripe payment form (beta)
  • Added - Improved Subscription retry logic
Download this release

Release Info

Developer mr.clayton
Plugin Icon wp plugin Payment Plugins for Stripe WooCommerce
Version 3.3.25
Comparing to
See all releases

Code changes from version 3.3.24 to 3.3.25

assets/js/frontend/credit-card.js CHANGED
@@ -252,25 +252,25 @@
252
  e.preventDefault();
253
  if (this.checkout_fields_valid()) {
254
  if (this.is_payment_element_enabled()) {
255
- if (this.is_current_page('order_pay')) {
256
- this.process_order_pay();
257
- } else {
258
- this.stripe.updatePaymentIntent({
259
- elements: this.elements,
260
- params: {
261
- payment_method_data: {
262
- billing_details: this.get_billing_details()
263
- }
264
  }
265
- }).then(function (result) {
266
- if (result.error) {
267
- return this.submit_card_error(result.error);
268
- }
269
- this.on_token_received(result.paymentIntent.payment_method);
270
- }.bind(this)).catch(function (error) {
271
- return this.submit_card_error(error);
272
- }.bind(this));
273
- }
 
 
 
 
274
  } else {
275
  this.stripe.createPaymentMethod({
276
  type: 'card',
252
  e.preventDefault();
253
  if (this.checkout_fields_valid()) {
254
  if (this.is_payment_element_enabled()) {
255
+ this.stripe.updatePaymentIntent({
256
+ elements: this.elements,
257
+ params: {
258
+ payment_method_data: {
259
+ billing_details: this.get_billing_details()
 
 
 
 
260
  }
261
+ }
262
+ }).then(function (result) {
263
+ if (result.error) {
264
+ return this.submit_card_error(result.error);
265
+ }
266
+ if (this.is_current_page('order_pay')) {
267
+ this.set_nonce(result.paymentIntent.payment_method);
268
+ return this.process_order_pay();
269
+ }
270
+ this.on_token_received(result.paymentIntent.payment_method);
271
+ }.bind(this)).catch(function (error) {
272
+ return this.submit_card_error(error);
273
+ }.bind(this));
274
  } else {
275
  this.stripe.createPaymentMethod({
276
  type: 'card',
assets/js/frontend/credit-card.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,i){function t(){this.elementStatus={},i.BaseGateway.call(this,wc_stripe_credit_card_params),i.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(i.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var s={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&!this.is_payment_element_enabled()&&this.create_setup_intent(),this.is_payment_element_enabled()&&(this.handleActionMethod="confirmCardPayment"),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:s},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.is_payment_element_enabled()?(this.card=this.elements.create("payment",{fields:{billingDetails:this.is_current_page("checkout")?{address:"never"}:"auto"},wallets:{applePay:"never",googlePay:"never"}}),this.elementStatus.payment={}):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={}),this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.is_payment_element_enabled()||this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.fields.syncCheckoutFieldsWithDOM(),this.is_gateway_selected())if(this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent);this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:function(){var t={return_url:""};return this.is_current_page("checkout")&&(t.payment_method_data={billing_details:this.get_billing_details()}),t}.bind(this)(),redirect:"if_required"}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent)}.bind(this)):this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&(this.is_payment_element_enabled()?this.is_current_page("order_pay")?this.process_order_pay():this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.on_token_received(t.paymentIntent.payment_method)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this))))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){void 0!==e&&e.fragments&&e.fragments.hasOwnProperty(".wc-stripe-intent-secret")&&this.params.elementOptions.clientSecret!==e.fragments[".wc-stripe-intent-secret"]&&(this.params.elementOptions.clientSecret=e.fragments[".wc-stripe-intent-secret"],this.params.cardFormType="payment",this.elements=this.create_stripe_elements(),this.setup_card()),this.create_card_element(),this.handle_create_account_change(),!this.can_create_setup_intent()||this.client_secret||this.is_payment_element_enabled()||this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),i.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=i.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},t.prototype.hide_save_card=function(){a(".wc-stripe-save-source").hide()},t.prototype.show_save_card=function(){a(".wc-stripe-save-source").show()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),i.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){i.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentIntent.payment_method)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)))["catch"](this.hide_installment_loader.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.is_payment_element_enabled=function(){return"payment"===this.params.cardFormType},t.prototype.handle_payment_method_setup=function(e){this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:{payment_method_data:{billing_details:this.get_billing_details()}},redirect:"if_required"}).then(function(t){t.error?(this.unblock(),this.payment_token_received=!1,this.submit_error(t.error)):this.is_current_page("order_pay")?this.get_form().trigger("submit"):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(e.order_id,e.order_key))}.bind(this)):i.BaseGateway.prototype.handle_payment_method_setup.apply(this,arguments)},new t}(jQuery,window.wc_stripe);
1
+ !function(a,i){function t(){this.elementStatus={},i.BaseGateway.call(this,wc_stripe_credit_card_params),i.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(i.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var s={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&!this.is_payment_element_enabled()&&this.create_setup_intent(),this.is_payment_element_enabled()&&(this.handleActionMethod="confirmCardPayment"),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:s},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.is_payment_element_enabled()?(this.card=this.elements.create("payment",{fields:{billingDetails:this.is_current_page("checkout")?{address:"never"}:"auto"},wallets:{applePay:"never",googlePay:"never"}}),this.elementStatus.payment={}):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={}),this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.is_payment_element_enabled()||this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.fields.syncCheckoutFieldsWithDOM(),this.is_gateway_selected())if(this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent);this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:function(){var t={return_url:""};return this.is_current_page("checkout")&&(t.payment_method_data={billing_details:this.get_billing_details()}),t}.bind(this)(),redirect:"if_required"}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent)}.bind(this)):this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){return t.error?this.submit_card_error(t.error):this.is_current_page("order_pay")?(this.set_nonce(t.paymentIntent.payment_method),this.process_order_pay()):void this.on_token_received(t.paymentIntent.payment_method)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this))))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){void 0!==e&&e.fragments&&e.fragments.hasOwnProperty(".wc-stripe-intent-secret")&&this.params.elementOptions.clientSecret!==e.fragments[".wc-stripe-intent-secret"]&&(this.params.elementOptions.clientSecret=e.fragments[".wc-stripe-intent-secret"],this.params.cardFormType="payment",this.elements=this.create_stripe_elements(),this.setup_card()),this.create_card_element(),this.handle_create_account_change(),!this.can_create_setup_intent()||this.client_secret||this.is_payment_element_enabled()||this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),i.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=i.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},t.prototype.hide_save_card=function(){a(".wc-stripe-save-source").hide()},t.prototype.show_save_card=function(){a(".wc-stripe-save-source").show()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),i.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){i.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentIntent.payment_method)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)))["catch"](this.hide_installment_loader.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.is_payment_element_enabled=function(){return"payment"===this.params.cardFormType},t.prototype.handle_payment_method_setup=function(e){this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:{payment_method_data:{billing_details:this.get_billing_details()}},redirect:"if_required"}).then(function(t){t.error?(this.unblock(),this.payment_token_received=!1,this.submit_error(t.error)):this.is_current_page("order_pay")?this.get_form().trigger("submit"):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(e.order_id,e.order_key))}.bind(this)):i.BaseGateway.prototype.handle_payment_method_setup.apply(this,arguments)},new t}(jQuery,window.wc_stripe);
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.24\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-07-05T21:10:27+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
@@ -143,7 +143,7 @@ msgid "Error saving payment method. Reason: %s"
143
  msgstr ""
144
 
145
  #: includes/abstract/abstract-wc-payment-gateway-stripe.php:563
146
- #: includes/wc-stripe-webhook-functions.php:232
147
  msgid "Order refunded in Stripe. Amount: %s"
148
  msgstr ""
149
 
@@ -369,17 +369,17 @@ msgid "Local Gateways"
369
  msgstr ""
370
 
371
  #: includes/admin/class-wc-stripe-admin-settings.php:95
372
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:183
373
  msgid "Stripe Email Options"
374
  msgstr ""
375
 
376
  #: includes/admin/class-wc-stripe-admin-settings.php:99
377
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:187
378
  msgid "Email Receipt"
379
  msgstr ""
380
 
381
  #: includes/admin/class-wc-stripe-admin-settings.php:102
382
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:189
383
  msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
384
  msgstr ""
385
 
@@ -404,8 +404,8 @@ msgid "If the capture amount is less than the order total, make sure you edit yo
404
  msgstr ""
405
 
406
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:9
407
- #: includes/admin/views/html-user-profile.php:36
408
- #: includes/admin/views/html-user-profile.php:69
409
  msgid "Actions"
410
  msgstr ""
411
 
@@ -464,8 +464,8 @@ msgid "Customer"
464
  msgstr ""
465
 
466
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:45
467
- #: includes/admin/views/html-user-profile.php:34
468
- #: includes/admin/views/html-user-profile.php:67
469
  msgid "Payment Method"
470
  msgstr ""
471
 
@@ -664,92 +664,108 @@ msgid "If enabled, the Stripe fee and payout will be displayed in the currency o
664
  msgstr ""
665
 
666
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:90
667
- msgid "Refund On Cancel"
 
 
 
 
668
  msgstr ""
669
 
670
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:95
 
 
 
 
 
 
 
 
 
 
 
 
671
  msgid "If enabled, the plugin will process a payment cancellation or refund within Stripe when the order's status is set to cancelled."
672
  msgstr ""
673
 
674
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:99
675
  msgid "Link Settings"
676
  msgstr ""
677
 
678
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:102
679
  msgid "Faster Checkout With Link"
680
  msgstr ""
681
 
682
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:106
683
  msgid ""
684
  "Only available to US merchants: With Link enabled, Stripe will use your customer's email address to determine if they have used Stripe in the past. If yes, their payment info, billing and shipping information can be used to \r\n"
685
  "\t\t\t\tauto-populate the checkout page resulting in higher conversion rates and less customer friction. If enabled, the Stripe payment form will be used because it's the only card form compatible with Link."
686
  msgstr ""
687
 
688
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:110
689
  msgid "Move email field to top of page"
690
  msgstr ""
691
 
692
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:114
693
  msgid "If enabled, the email field will be placed at the top of the checkout page. Link uses the email address so it's best to prioritize it."
694
  msgstr ""
695
 
696
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:122
697
  msgid "Launch link on page load"
698
  msgstr ""
699
 
700
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:126
701
  msgid "If enabled and the email address is already populated, the plugin will attempt to launch Link on the checkout page."
702
  msgstr ""
703
 
704
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:134
705
  msgid "Dispute Settings"
706
  msgstr ""
707
 
708
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:138
709
  msgid "Dispute Created"
710
  msgstr ""
711
 
712
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:141
713
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order's status to on-hold by default."
714
  msgstr ""
715
 
716
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:145
717
  msgid "Disputed Created Order Status"
718
  msgstr ""
719
 
720
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:149
721
  msgid "The status assigned to an order when a dispute is created."
722
  msgstr ""
723
 
724
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:157
725
  msgid "Dispute Closed"
726
  msgstr ""
727
 
728
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:160
729
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order's status back to the status before the dispute was opened."
730
  msgstr ""
731
 
732
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:164
733
  msgid "Review Settings"
734
  msgstr ""
735
 
736
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:168
737
  msgid "Review Created"
738
  msgstr ""
739
 
740
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:171
741
  msgid "If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order's status to on-hold by default."
742
  msgstr ""
743
 
744
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:175
745
  msgid "Review Closed"
746
  msgstr ""
747
 
748
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:178
749
  msgid "If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order's status back to the status before the review was opened."
750
  msgstr ""
751
 
752
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:249
753
  msgid "Supported Stripe account countries: %1$s. Supported currencies: %2$s"
754
  msgstr ""
755
 
@@ -938,56 +954,56 @@ msgstr ""
938
  msgid "Create Ticket"
939
  msgstr ""
940
 
941
- #: includes/admin/views/html-user-profile.php:7
942
  msgid "Stripe Customer ID's"
943
  msgstr ""
944
 
945
- #: includes/admin/views/html-user-profile.php:13
946
  msgid "Live ID"
947
  msgstr ""
948
 
949
- #: includes/admin/views/html-user-profile.php:20
950
  msgid "Test ID"
951
  msgstr ""
952
 
953
- #: includes/admin/views/html-user-profile.php:28
954
  msgid "Stripe Live Payment Methods"
955
  msgstr ""
956
 
957
- #: includes/admin/views/html-user-profile.php:33
958
- #: includes/admin/views/html-user-profile.php:66
959
  msgid "Payment Gateway"
960
  msgstr ""
961
 
962
- #: includes/admin/views/html-user-profile.php:35
963
- #: includes/admin/views/html-user-profile.php:68
964
  msgid "Token"
965
  msgstr ""
966
 
967
- #: includes/admin/views/html-user-profile.php:52
968
- #: includes/admin/views/html-user-profile.php:85
969
  msgid "No Action"
970
  msgstr ""
971
 
972
- #: includes/admin/views/html-user-profile.php:53
973
- #: includes/admin/views/html-user-profile.php:86
974
  msgid "Delete"
975
  msgstr ""
976
 
977
- #: includes/admin/views/html-user-profile.php:59
978
  msgid "No live payment methods saved"
979
  msgstr ""
980
 
981
- #: includes/admin/views/html-user-profile.php:61
982
  msgid "Stripe Test Payment Methods"
983
  msgstr ""
984
 
985
- #: includes/admin/views/html-user-profile.php:92
986
  msgid "No test payment methods saved"
987
  msgstr ""
988
 
989
- #: includes/admin/views/html-user-profile.php:94
990
- msgid "%1$snote:%2$s payment methods will be deleted in Stripe if you use the delete action."
991
  msgstr ""
992
 
993
  #: includes/admin/views/html-welcome-page.php:14
@@ -1075,15 +1091,15 @@ msgstr ""
1075
  msgid "Invalid order key."
1076
  msgstr ""
1077
 
1078
- #: includes/controllers/class-wc-stripe-controller-checkout.php:173
1079
  #: includes/controllers/class-wc-stripe-controller-payment-intent.php:115
1080
  #: includes/controllers/class-wc-stripe-controller-payment-intent.php:152
1081
  #: packages/cartflows/src/Routes/PaymentIntentRoute.php:47
1082
  msgid "You are not authorized to update this order."
1083
  msgstr ""
1084
 
1085
- #: includes/controllers/class-wc-stripe-controller-checkout.php:298
1086
- #: includes/controllers/class-wc-stripe-controller-checkout.php:344
1087
  msgid "Please review your order details then click Place Order."
1088
  msgstr ""
1089
 
@@ -1511,7 +1527,7 @@ msgid "If enabled, the voucher link will be included in the order on-hold email
1511
  msgstr ""
1512
 
1513
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1514
- #: includes/wc-stripe-functions.php:1137
1515
  msgid "Please enter a valid CPF / CNPJ"
1516
  msgstr ""
1517
 
@@ -2351,246 +2367,246 @@ msgstr ""
2351
  msgid "Kind Regards,"
2352
  msgstr ""
2353
 
2354
- #: includes/wc-stripe-functions.php:738
2355
  msgid "Bootstrap form"
2356
  msgstr ""
2357
 
2358
- #: includes/wc-stripe-functions.php:764
2359
  msgid "Simple form"
2360
  msgstr ""
2361
 
2362
- #: includes/wc-stripe-functions.php:787
2363
  msgid "Minimalist form"
2364
  msgstr ""
2365
 
2366
- #: includes/wc-stripe-functions.php:813
2367
  msgid "Inline Form"
2368
  msgstr ""
2369
 
2370
- #: includes/wc-stripe-functions.php:835
2371
  msgid "Rounded Form"
2372
  msgstr ""
2373
 
2374
- #: includes/wc-stripe-functions.php:1066
2375
  msgid "There was an error processing your credit card."
2376
  msgstr ""
2377
 
2378
- #: includes/wc-stripe-functions.php:1067
2379
  msgid "Your card number is incomplete."
2380
  msgstr ""
2381
 
2382
- #: includes/wc-stripe-functions.php:1068
2383
  msgid "Your card's expiration date is incomplete."
2384
  msgstr ""
2385
 
2386
- #: includes/wc-stripe-functions.php:1069
2387
  msgid "Your card's security code is incomplete."
2388
  msgstr ""
2389
 
2390
- #: includes/wc-stripe-functions.php:1070
2391
  msgid "Your card's zip code is incomplete."
2392
  msgstr ""
2393
 
2394
- #: includes/wc-stripe-functions.php:1071
2395
  msgid "The card number is incorrect. Check the card's number or use a different card."
2396
  msgstr ""
2397
 
2398
- #: includes/wc-stripe-functions.php:1072
2399
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2400
  msgstr ""
2401
 
2402
- #: includes/wc-stripe-functions.php:1073
2403
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2404
  msgstr ""
2405
 
2406
- #: includes/wc-stripe-functions.php:1074
2407
- #: includes/wc-stripe-functions.php:1079
2408
  msgid "The card number is invalid. Check the card details or use a different card."
2409
  msgstr ""
2410
 
2411
- #: includes/wc-stripe-functions.php:1075
2412
  msgid "This value provided to the field contains characters that are unsupported by the field."
2413
  msgstr ""
2414
 
2415
- #: includes/wc-stripe-functions.php:1076
2416
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2417
  msgstr ""
2418
 
2419
- #: includes/wc-stripe-functions.php:1077
2420
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2421
  msgstr ""
2422
 
2423
- #: includes/wc-stripe-functions.php:1078
2424
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2425
  msgstr ""
2426
 
2427
- #: includes/wc-stripe-functions.php:1080
2428
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2429
  msgstr ""
2430
 
2431
- #: includes/wc-stripe-functions.php:1081
2432
  msgid "The card has expired. Check the expiration date or use a different card."
2433
  msgstr ""
2434
 
2435
- #: includes/wc-stripe-functions.php:1082
2436
  msgid "The card has been declined."
2437
  msgstr ""
2438
 
2439
- #: includes/wc-stripe-functions.php:1083
2440
  msgid "Your card's expiration year is in the past."
2441
  msgstr ""
2442
 
2443
- #: includes/wc-stripe-functions.php:1084
2444
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2445
  msgstr ""
2446
 
2447
- #: includes/wc-stripe-functions.php:1086
2448
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2449
  msgstr ""
2450
 
2451
- #: includes/wc-stripe-functions.php:1087
2452
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2453
  msgstr ""
2454
 
2455
- #: includes/wc-stripe-functions.php:1088
2456
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2457
  msgstr ""
2458
 
2459
- #: includes/wc-stripe-functions.php:1090
2460
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2461
  msgstr ""
2462
 
2463
- #: includes/wc-stripe-functions.php:1092
2464
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2465
  msgstr ""
2466
 
2467
- #: includes/wc-stripe-functions.php:1093
2468
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2469
  msgstr ""
2470
 
2471
- #: includes/wc-stripe-functions.php:1095
2472
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2473
  msgstr ""
2474
 
2475
- #: includes/wc-stripe-functions.php:1096
2476
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2477
  msgstr ""
2478
 
2479
- #: includes/wc-stripe-functions.php:1097
2480
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2481
  msgstr ""
2482
 
2483
- #: includes/wc-stripe-functions.php:1099
2484
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2485
  msgstr ""
2486
 
2487
- #: includes/wc-stripe-functions.php:1101
2488
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2489
  msgstr ""
2490
 
2491
- #: includes/wc-stripe-functions.php:1102
2492
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2493
  msgstr ""
2494
 
2495
- #: includes/wc-stripe-functions.php:1104
2496
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2497
  msgstr ""
2498
 
2499
- #: includes/wc-stripe-functions.php:1106
2500
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2501
  msgstr ""
2502
 
2503
- #: includes/wc-stripe-functions.php:1108
2504
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2505
  msgstr ""
2506
 
2507
- #: includes/wc-stripe-functions.php:1110
2508
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2509
  msgstr ""
2510
 
2511
- #: includes/wc-stripe-functions.php:1112
2512
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2513
  msgstr ""
2514
 
2515
- #: includes/wc-stripe-functions.php:1114
2516
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2517
  msgstr ""
2518
 
2519
- #: includes/wc-stripe-functions.php:1116
2520
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2521
  msgstr ""
2522
 
2523
- #: includes/wc-stripe-functions.php:1118
2524
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2525
  msgstr ""
2526
 
2527
- #: includes/wc-stripe-functions.php:1120
2528
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2529
  msgstr ""
2530
 
2531
- #: includes/wc-stripe-functions.php:1122
2532
  msgid "The ZIP code provided was incorrect."
2533
  msgstr ""
2534
 
2535
- #: includes/wc-stripe-functions.php:1123
2536
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2537
  msgstr ""
2538
 
2539
- #: includes/wc-stripe-functions.php:1124
2540
  msgid "The card does not support this type of purchase."
2541
  msgstr ""
2542
 
2543
- #: includes/wc-stripe-functions.php:1125
2544
- #: includes/wc-stripe-functions.php:1128
2545
  #: includes/wc-stripe-functions.php:1130
 
2546
  msgid "The card has been declined for an unknown reason."
2547
  msgstr ""
2548
 
2549
- #: includes/wc-stripe-functions.php:1126
2550
  msgid "The customer has exceeded the balance or credit limit available on their card."
2551
  msgstr ""
2552
 
2553
- #: includes/wc-stripe-functions.php:1127
2554
  msgid "The card does not support the specified currency."
2555
  msgstr ""
2556
 
2557
- #: includes/wc-stripe-functions.php:1129
2558
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2559
  msgstr ""
2560
 
2561
- #: includes/wc-stripe-functions.php:1131
2562
  msgid "The PIN entered is incorrect. "
2563
  msgstr ""
2564
 
2565
- #: includes/wc-stripe-functions.php:1132
2566
  msgid "The card has insufficient funds to complete the purchase."
2567
  msgstr ""
2568
 
2569
- #: includes/wc-stripe-functions.php:1133
2570
  msgid "Please select a payment method before proceeding."
2571
  msgstr ""
2572
 
2573
- #: includes/wc-stripe-functions.php:1134
2574
  msgid "Please enter your IBAN before proceeding."
2575
  msgstr ""
2576
 
2577
- #: includes/wc-stripe-functions.php:1135
2578
  msgid "Please select a bank before proceeding"
2579
  msgstr ""
2580
 
2581
- #: includes/wc-stripe-functions.php:1136
2582
  msgid "The IBAN you entered is incomplete."
2583
  msgstr ""
2584
 
2585
- #: includes/wc-stripe-functions.php:1138
2586
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2587
  msgstr ""
2588
 
2589
- #: includes/wc-stripe-functions.php:1140
2590
  msgid "You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the \"server_side_confirmation_beta\" to be added to your account."
2591
  msgstr ""
2592
 
2593
- #: includes/wc-stripe-functions.php:1141
2594
  msgid "Please provide a billing phone number."
2595
  msgstr ""
2596
 
@@ -2598,27 +2614,27 @@ msgstr ""
2598
  msgid "Charge.succeeded webhook received. Payment has been completed."
2599
  msgstr ""
2600
 
2601
- #: includes/wc-stripe-webhook-functions.php:146
2602
  msgid "payment_intent.succeeded webhook received. Payment has been completed."
2603
  msgstr ""
2604
 
2605
- #: includes/wc-stripe-webhook-functions.php:279
2606
  msgid "A dispute has been created for charge %1$s. Dispute status: %2$s."
2607
  msgstr ""
2608
 
2609
- #: includes/wc-stripe-webhook-functions.php:308
2610
  msgid "Dispute %1$s has been closed. Result: %2$s."
2611
  msgstr ""
2612
 
2613
- #: includes/wc-stripe-webhook-functions.php:334
2614
  msgid "A review has been opened for charge %1$s. Reason: %2$s."
2615
  msgstr ""
2616
 
2617
- #: includes/wc-stripe-webhook-functions.php:352
2618
  msgid "A review has been closed for charge %1$s. Reason: %2$s."
2619
  msgstr ""
2620
 
2621
- #: includes/wc-stripe-webhook-functions.php:392
2622
  msgid "Order status updated via charge.pending webhook."
2623
  msgstr ""
2624
 
@@ -2677,7 +2693,7 @@ msgstr ""
2677
  msgid "This payment method does not exist in the merchant's Stripe account. Please contact us and we'll update your account."
2678
  msgstr ""
2679
 
2680
- #: stripe-payments.php:18
2681
  msgid "Your PHP version is %s but Stripe requires version 5.6+."
2682
  msgstr ""
2683
 
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.25\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-08-03T18:54:29+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
143
  msgstr ""
144
 
145
  #: includes/abstract/abstract-wc-payment-gateway-stripe.php:563
146
+ #: includes/wc-stripe-webhook-functions.php:233
147
  msgid "Order refunded in Stripe. Amount: %s"
148
  msgstr ""
149
 
369
  msgstr ""
370
 
371
  #: includes/admin/class-wc-stripe-admin-settings.php:95
372
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:194
373
  msgid "Stripe Email Options"
374
  msgstr ""
375
 
376
  #: includes/admin/class-wc-stripe-admin-settings.php:99
377
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:198
378
  msgid "Email Receipt"
379
  msgstr ""
380
 
381
  #: includes/admin/class-wc-stripe-admin-settings.php:102
382
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:200
383
  msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
384
  msgstr ""
385
 
404
  msgstr ""
405
 
406
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:9
407
+ #: includes/admin/views/html-user-profile.php:37
408
+ #: includes/admin/views/html-user-profile.php:70
409
  msgid "Actions"
410
  msgstr ""
411
 
464
  msgstr ""
465
 
466
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:45
467
+ #: includes/admin/views/html-user-profile.php:35
468
+ #: includes/admin/views/html-user-profile.php:68
469
  msgid "Payment Method"
470
  msgstr ""
471
 
664
  msgstr ""
665
 
666
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:90
667
+ msgid "Capture Status"
668
+ msgstr ""
669
+
670
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:94
671
+ msgid "Completed"
672
  msgstr ""
673
 
674
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:95
675
+ msgid "Processing"
676
+ msgstr ""
677
+
678
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:98
679
+ msgid "For orders that are authorized, when the order is set to this status, it will trigger a capture."
680
+ msgstr ""
681
+
682
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:101
683
+ msgid "Refund On Cancel"
684
+ msgstr ""
685
+
686
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:106
687
  msgid "If enabled, the plugin will process a payment cancellation or refund within Stripe when the order's status is set to cancelled."
688
  msgstr ""
689
 
690
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:110
691
  msgid "Link Settings"
692
  msgstr ""
693
 
694
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:113
695
  msgid "Faster Checkout With Link"
696
  msgstr ""
697
 
698
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:117
699
  msgid ""
700
  "Only available to US merchants: With Link enabled, Stripe will use your customer's email address to determine if they have used Stripe in the past. If yes, their payment info, billing and shipping information can be used to \r\n"
701
  "\t\t\t\tauto-populate the checkout page resulting in higher conversion rates and less customer friction. If enabled, the Stripe payment form will be used because it's the only card form compatible with Link."
702
  msgstr ""
703
 
704
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:121
705
  msgid "Move email field to top of page"
706
  msgstr ""
707
 
708
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:125
709
  msgid "If enabled, the email field will be placed at the top of the checkout page. Link uses the email address so it's best to prioritize it."
710
  msgstr ""
711
 
712
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:133
713
  msgid "Launch link on page load"
714
  msgstr ""
715
 
716
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:137
717
  msgid "If enabled and the email address is already populated, the plugin will attempt to launch Link on the checkout page."
718
  msgstr ""
719
 
720
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:145
721
  msgid "Dispute Settings"
722
  msgstr ""
723
 
724
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:149
725
  msgid "Dispute Created"
726
  msgstr ""
727
 
728
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:152
729
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order's status to on-hold by default."
730
  msgstr ""
731
 
732
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:156
733
  msgid "Disputed Created Order Status"
734
  msgstr ""
735
 
736
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:160
737
  msgid "The status assigned to an order when a dispute is created."
738
  msgstr ""
739
 
740
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:168
741
  msgid "Dispute Closed"
742
  msgstr ""
743
 
744
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:171
745
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order's status back to the status before the dispute was opened."
746
  msgstr ""
747
 
748
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:175
749
  msgid "Review Settings"
750
  msgstr ""
751
 
752
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:179
753
  msgid "Review Created"
754
  msgstr ""
755
 
756
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:182
757
  msgid "If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order's status to on-hold by default."
758
  msgstr ""
759
 
760
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:186
761
  msgid "Review Closed"
762
  msgstr ""
763
 
764
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:189
765
  msgid "If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order's status back to the status before the review was opened."
766
  msgstr ""
767
 
768
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:260
769
  msgid "Supported Stripe account countries: %1$s. Supported currencies: %2$s"
770
  msgstr ""
771
 
954
  msgid "Create Ticket"
955
  msgstr ""
956
 
957
+ #: includes/admin/views/html-user-profile.php:8
958
  msgid "Stripe Customer ID's"
959
  msgstr ""
960
 
961
+ #: includes/admin/views/html-user-profile.php:14
962
  msgid "Live ID"
963
  msgstr ""
964
 
965
+ #: includes/admin/views/html-user-profile.php:21
966
  msgid "Test ID"
967
  msgstr ""
968
 
969
+ #: includes/admin/views/html-user-profile.php:29
970
  msgid "Stripe Live Payment Methods"
971
  msgstr ""
972
 
973
+ #: includes/admin/views/html-user-profile.php:34
974
+ #: includes/admin/views/html-user-profile.php:67
975
  msgid "Payment Gateway"
976
  msgstr ""
977
 
978
+ #: includes/admin/views/html-user-profile.php:36
979
+ #: includes/admin/views/html-user-profile.php:69
980
  msgid "Token"
981
  msgstr ""
982
 
983
+ #: includes/admin/views/html-user-profile.php:53
984
+ #: includes/admin/views/html-user-profile.php:86
985
  msgid "No Action"
986
  msgstr ""
987
 
988
+ #: includes/admin/views/html-user-profile.php:54
989
+ #: includes/admin/views/html-user-profile.php:87
990
  msgid "Delete"
991
  msgstr ""
992
 
993
+ #: includes/admin/views/html-user-profile.php:60
994
  msgid "No live payment methods saved"
995
  msgstr ""
996
 
997
+ #: includes/admin/views/html-user-profile.php:62
998
  msgid "Stripe Test Payment Methods"
999
  msgstr ""
1000
 
1001
+ #: includes/admin/views/html-user-profile.php:93
1002
  msgid "No test payment methods saved"
1003
  msgstr ""
1004
 
1005
+ #: includes/admin/views/html-user-profile.php:95
1006
+ msgid "%1$sNote:%2$s Payment methods will be deleted from your WordPress site and within Stripe."
1007
  msgstr ""
1008
 
1009
  #: includes/admin/views/html-welcome-page.php:14
1091
  msgid "Invalid order key."
1092
  msgstr ""
1093
 
1094
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:179
1095
  #: includes/controllers/class-wc-stripe-controller-payment-intent.php:115
1096
  #: includes/controllers/class-wc-stripe-controller-payment-intent.php:152
1097
  #: packages/cartflows/src/Routes/PaymentIntentRoute.php:47
1098
  msgid "You are not authorized to update this order."
1099
  msgstr ""
1100
 
1101
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:304
1102
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:350
1103
  msgid "Please review your order details then click Place Order."
1104
  msgstr ""
1105
 
1527
  msgstr ""
1528
 
1529
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1530
+ #: includes/wc-stripe-functions.php:1139
1531
  msgid "Please enter a valid CPF / CNPJ"
1532
  msgstr ""
1533
 
2367
  msgid "Kind Regards,"
2368
  msgstr ""
2369
 
2370
+ #: includes/wc-stripe-functions.php:740
2371
  msgid "Bootstrap form"
2372
  msgstr ""
2373
 
2374
+ #: includes/wc-stripe-functions.php:766
2375
  msgid "Simple form"
2376
  msgstr ""
2377
 
2378
+ #: includes/wc-stripe-functions.php:789
2379
  msgid "Minimalist form"
2380
  msgstr ""
2381
 
2382
+ #: includes/wc-stripe-functions.php:815
2383
  msgid "Inline Form"
2384
  msgstr ""
2385
 
2386
+ #: includes/wc-stripe-functions.php:837
2387
  msgid "Rounded Form"
2388
  msgstr ""
2389
 
2390
+ #: includes/wc-stripe-functions.php:1068
2391
  msgid "There was an error processing your credit card."
2392
  msgstr ""
2393
 
2394
+ #: includes/wc-stripe-functions.php:1069
2395
  msgid "Your card number is incomplete."
2396
  msgstr ""
2397
 
2398
+ #: includes/wc-stripe-functions.php:1070
2399
  msgid "Your card's expiration date is incomplete."
2400
  msgstr ""
2401
 
2402
+ #: includes/wc-stripe-functions.php:1071
2403
  msgid "Your card's security code is incomplete."
2404
  msgstr ""
2405
 
2406
+ #: includes/wc-stripe-functions.php:1072
2407
  msgid "Your card's zip code is incomplete."
2408
  msgstr ""
2409
 
2410
+ #: includes/wc-stripe-functions.php:1073
2411
  msgid "The card number is incorrect. Check the card's number or use a different card."
2412
  msgstr ""
2413
 
2414
+ #: includes/wc-stripe-functions.php:1074
2415
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2416
  msgstr ""
2417
 
2418
+ #: includes/wc-stripe-functions.php:1075
2419
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2420
  msgstr ""
2421
 
2422
+ #: includes/wc-stripe-functions.php:1076
2423
+ #: includes/wc-stripe-functions.php:1081
2424
  msgid "The card number is invalid. Check the card details or use a different card."
2425
  msgstr ""
2426
 
2427
+ #: includes/wc-stripe-functions.php:1077
2428
  msgid "This value provided to the field contains characters that are unsupported by the field."
2429
  msgstr ""
2430
 
2431
+ #: includes/wc-stripe-functions.php:1078
2432
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2433
  msgstr ""
2434
 
2435
+ #: includes/wc-stripe-functions.php:1079
2436
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2437
  msgstr ""
2438
 
2439
+ #: includes/wc-stripe-functions.php:1080
2440
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2441
  msgstr ""
2442
 
2443
+ #: includes/wc-stripe-functions.php:1082
2444
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2445
  msgstr ""
2446
 
2447
+ #: includes/wc-stripe-functions.php:1083
2448
  msgid "The card has expired. Check the expiration date or use a different card."
2449
  msgstr ""
2450
 
2451
+ #: includes/wc-stripe-functions.php:1084
2452
  msgid "The card has been declined."
2453
  msgstr ""
2454
 
2455
+ #: includes/wc-stripe-functions.php:1085
2456
  msgid "Your card's expiration year is in the past."
2457
  msgstr ""
2458
 
2459
+ #: includes/wc-stripe-functions.php:1086
2460
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2461
  msgstr ""
2462
 
2463
+ #: includes/wc-stripe-functions.php:1088
2464
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2465
  msgstr ""
2466
 
2467
+ #: includes/wc-stripe-functions.php:1089
2468
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2469
  msgstr ""
2470
 
2471
+ #: includes/wc-stripe-functions.php:1090
2472
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2473
  msgstr ""
2474
 
2475
+ #: includes/wc-stripe-functions.php:1092
2476
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2477
  msgstr ""
2478
 
2479
+ #: includes/wc-stripe-functions.php:1094
2480
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2481
  msgstr ""
2482
 
2483
+ #: includes/wc-stripe-functions.php:1095
2484
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2485
  msgstr ""
2486
 
2487
+ #: includes/wc-stripe-functions.php:1097
2488
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2489
  msgstr ""
2490
 
2491
+ #: includes/wc-stripe-functions.php:1098
2492
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2493
  msgstr ""
2494
 
2495
+ #: includes/wc-stripe-functions.php:1099
2496
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2497
  msgstr ""
2498
 
2499
+ #: includes/wc-stripe-functions.php:1101
2500
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2501
  msgstr ""
2502
 
2503
+ #: includes/wc-stripe-functions.php:1103
2504
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2505
  msgstr ""
2506
 
2507
+ #: includes/wc-stripe-functions.php:1104
2508
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2509
  msgstr ""
2510
 
2511
+ #: includes/wc-stripe-functions.php:1106
2512
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2513
  msgstr ""
2514
 
2515
+ #: includes/wc-stripe-functions.php:1108
2516
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2517
  msgstr ""
2518
 
2519
+ #: includes/wc-stripe-functions.php:1110
2520
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2521
  msgstr ""
2522
 
2523
+ #: includes/wc-stripe-functions.php:1112
2524
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2525
  msgstr ""
2526
 
2527
+ #: includes/wc-stripe-functions.php:1114
2528
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2529
  msgstr ""
2530
 
2531
+ #: includes/wc-stripe-functions.php:1116
2532
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2533
  msgstr ""
2534
 
2535
+ #: includes/wc-stripe-functions.php:1118
2536
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2537
  msgstr ""
2538
 
2539
+ #: includes/wc-stripe-functions.php:1120
2540
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2541
  msgstr ""
2542
 
2543
+ #: includes/wc-stripe-functions.php:1122
2544
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2545
  msgstr ""
2546
 
2547
+ #: includes/wc-stripe-functions.php:1124
2548
  msgid "The ZIP code provided was incorrect."
2549
  msgstr ""
2550
 
2551
+ #: includes/wc-stripe-functions.php:1125
2552
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2553
  msgstr ""
2554
 
2555
+ #: includes/wc-stripe-functions.php:1126
2556
  msgid "The card does not support this type of purchase."
2557
  msgstr ""
2558
 
2559
+ #: includes/wc-stripe-functions.php:1127
 
2560
  #: includes/wc-stripe-functions.php:1130
2561
+ #: includes/wc-stripe-functions.php:1132
2562
  msgid "The card has been declined for an unknown reason."
2563
  msgstr ""
2564
 
2565
+ #: includes/wc-stripe-functions.php:1128
2566
  msgid "The customer has exceeded the balance or credit limit available on their card."
2567
  msgstr ""
2568
 
2569
+ #: includes/wc-stripe-functions.php:1129
2570
  msgid "The card does not support the specified currency."
2571
  msgstr ""
2572
 
2573
+ #: includes/wc-stripe-functions.php:1131
2574
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2575
  msgstr ""
2576
 
2577
+ #: includes/wc-stripe-functions.php:1133
2578
  msgid "The PIN entered is incorrect. "
2579
  msgstr ""
2580
 
2581
+ #: includes/wc-stripe-functions.php:1134
2582
  msgid "The card has insufficient funds to complete the purchase."
2583
  msgstr ""
2584
 
2585
+ #: includes/wc-stripe-functions.php:1135
2586
  msgid "Please select a payment method before proceeding."
2587
  msgstr ""
2588
 
2589
+ #: includes/wc-stripe-functions.php:1136
2590
  msgid "Please enter your IBAN before proceeding."
2591
  msgstr ""
2592
 
2593
+ #: includes/wc-stripe-functions.php:1137
2594
  msgid "Please select a bank before proceeding"
2595
  msgstr ""
2596
 
2597
+ #: includes/wc-stripe-functions.php:1138
2598
  msgid "The IBAN you entered is incomplete."
2599
  msgstr ""
2600
 
2601
+ #: includes/wc-stripe-functions.php:1140
2602
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2603
  msgstr ""
2604
 
2605
+ #: includes/wc-stripe-functions.php:1142
2606
  msgid "You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the \"server_side_confirmation_beta\" to be added to your account."
2607
  msgstr ""
2608
 
2609
+ #: includes/wc-stripe-functions.php:1143
2610
  msgid "Please provide a billing phone number."
2611
  msgstr ""
2612
 
2614
  msgid "Charge.succeeded webhook received. Payment has been completed."
2615
  msgstr ""
2616
 
2617
+ #: includes/wc-stripe-webhook-functions.php:147
2618
  msgid "payment_intent.succeeded webhook received. Payment has been completed."
2619
  msgstr ""
2620
 
2621
+ #: includes/wc-stripe-webhook-functions.php:280
2622
  msgid "A dispute has been created for charge %1$s. Dispute status: %2$s."
2623
  msgstr ""
2624
 
2625
+ #: includes/wc-stripe-webhook-functions.php:309
2626
  msgid "Dispute %1$s has been closed. Result: %2$s."
2627
  msgstr ""
2628
 
2629
+ #: includes/wc-stripe-webhook-functions.php:335
2630
  msgid "A review has been opened for charge %1$s. Reason: %2$s."
2631
  msgstr ""
2632
 
2633
+ #: includes/wc-stripe-webhook-functions.php:353
2634
  msgid "A review has been closed for charge %1$s. Reason: %2$s."
2635
  msgstr ""
2636
 
2637
+ #: includes/wc-stripe-webhook-functions.php:393
2638
  msgid "Order status updated via charge.pending webhook."
2639
  msgstr ""
2640
 
2693
  msgid "This payment method does not exist in the merchant's Stripe account. Please contact us and we'll update your account."
2694
  msgstr ""
2695
 
2696
+ #: src/PluginValidation.php:19
2697
  msgid "Your PHP version is %s but Stripe requires version 5.6+."
2698
  msgstr ""
2699
 
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -1836,6 +1836,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
1836
  public function update_failing_payment_method( $subscription, $order ) {
1837
  if ( ( $token = $this->get_token( $order->get_meta( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN ), $order->get_customer_id() ) ) ) {
1838
  $subscription->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $token->get_token() );
 
1839
  $subscription->set_payment_method_title( $token->get_payment_method_title( $this->get_option( 'method_format' ) ) );
1840
  $subscription->save();
1841
  }
1836
  public function update_failing_payment_method( $subscription, $order ) {
1837
  if ( ( $token = $this->get_token( $order->get_meta( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN ), $order->get_customer_id() ) ) ) {
1838
  $subscription->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $token->get_token() );
1839
+ $subscription->update_meta_data( WC_Stripe_Constants::CUSTOMER_ID, $token->get_customer_id() );
1840
  $subscription->set_payment_method_title( $token->get_payment_method_title( $this->get_option( 'method_format' ) ) );
1841
  $subscription->save();
1842
  }
includes/admin/class-wc-stripe-admin-user-edit.php CHANGED
@@ -1,11 +1,12 @@
1
  <?php
 
2
  defined( 'ABSPATH' ) || exit();
3
 
4
  /**
5
  *
6
- * @since 3.0.0
7
  * @package Stripe/Admin
8
- * @author PaymentPlugins
9
  *
10
  */
11
  class WC_Stripe_Admin_User_Edit {
@@ -69,6 +70,8 @@ class WC_Stripe_Admin_User_Edit {
69
  wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_test_id'] ), $user_id, 'test' );
70
  }
71
 
 
 
72
  // check if admin want's to delete any payment methods
73
  foreach ( $modes as $mode ) {
74
  if ( isset( $_POST[ $mode . '_payment_method_actions' ] ) ) {
@@ -76,8 +79,11 @@ class WC_Stripe_Admin_User_Edit {
76
  case 'delete':
77
  if ( isset( $_POST['payment_methods'], $_POST['payment_methods'][ $mode ] ) ) {
78
  $tokens = wc_clean( $_POST['payment_methods'][ $mode ] );
79
- foreach ( $tokens as $token_id ) {
80
- WC_Payment_Tokens::delete( absint( $token_id ) );
 
 
 
81
  }
82
  }
83
  break;
@@ -116,6 +122,7 @@ class WC_Stripe_Admin_User_Edit {
116
  }
117
  }
118
  }
 
119
  }
120
 
121
  WC_Stripe_Admin_User_Edit::init();
1
  <?php
2
+
3
  defined( 'ABSPATH' ) || exit();
4
 
5
  /**
6
  *
7
+ * @since 3.0.0
8
  * @package Stripe/Admin
9
+ * @author PaymentPlugins
10
  *
11
  */
12
  class WC_Stripe_Admin_User_Edit {
70
  wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_test_id'] ), $user_id, 'test' );
71
  }
72
 
73
+ $client = WC_Stripe_Gateway::load();
74
+
75
  // check if admin want's to delete any payment methods
76
  foreach ( $modes as $mode ) {
77
  if ( isset( $_POST[ $mode . '_payment_method_actions' ] ) ) {
79
  case 'delete':
80
  if ( isset( $_POST['payment_methods'], $_POST['payment_methods'][ $mode ] ) ) {
81
  $tokens = wc_clean( $_POST['payment_methods'][ $mode ] );
82
+ foreach ( $tokens as $identifer ) {
83
+ list( $id, $pm ) = explode( ':', $identifer );
84
+ WC_Payment_Tokens::delete( absint( $id ) );
85
+ $client->mode( $mode )->paymentMethods->detach( $pm );
86
+ wc_stripe_log_info( sprintf( 'Payment method %s detached within Stripe via WordPress Edit Profile page. Initiated by User ID: %s', $pm, get_current_user_id() ) );
87
  }
88
  }
89
  break;
122
  }
123
  }
124
  }
125
+
126
  }
127
 
128
  WC_Stripe_Admin_User_Edit::init();
includes/admin/settings/class-wc-stripe-advanced-settings.php CHANGED
@@ -86,6 +86,17 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
86
  )
87
  )
88
  ),
 
 
 
 
 
 
 
 
 
 
 
89
  'refund_cancel' => array(
90
  'title' => __( 'Refund On Cancel', 'woo-stripe-payment' ),
91
  'type' => 'checkbox',
86
  )
87
  )
88
  ),
89
+ 'capture_status' => array(
90
+ 'title' => __( 'Capture Status', 'woo-stripe-payment' ),
91
+ 'type' => 'select',
92
+ 'default' => 'completed',
93
+ 'options' => array(
94
+ 'completed' => __( 'Completed', 'woo-stripe-payment' ),
95
+ 'processing' => __( 'Processing', 'woo-stripe-payment' ),
96
+ ),
97
+ 'desc_tip' => true,
98
+ 'description' => __( 'For orders that are authorized, when the order is set to this status, it will trigger a capture.', 'woo-stripe-payment' ),
99
+ ),
100
  'refund_cancel' => array(
101
  'title' => __( 'Refund On Cancel', 'woo-stripe-payment' ),
102
  'type' => 'checkbox',
includes/admin/views/html-user-profile.php CHANGED
@@ -2,94 +2,95 @@
2
  /**
3
  * @var WP_User $user
4
  */
 
5
  ?>
6
  <div class="wc-stripe-user-info">
7
- <h2><?php esc_html_e( 'Stripe Customer ID\'s', 'woo-stripe-payment' ); ?></h2>
8
- <p><?php esc_html_e( 'If you change a customer ID, the customer\'s payment methods will be imported from your Stripe account.' ); ?></p>
9
- <p><?php esc_html_e( 'If you remove a customer ID, the customer\'s payment methods will be removed from the WC payment methods table.' ); ?></p>
10
- <table class="form-table">
11
- <tbody>
12
- <tr>
13
- <th><?php esc_html_e( 'Live ID', 'woo-stripe-payment' ); ?></th>
14
- <td><input type="text" id="wc_stripe_live_id"
15
- name="wc_stripe_live_id"
16
- value="<?php echo wc_stripe_get_customer_id( $user->ID, 'live' ); ?>" />
17
- </td>
18
- </tr>
19
- <tr>
20
- <th><?php esc_html_e( 'Test ID', 'woo-stripe-payment' ); ?></th>
21
- <td><input type="text" id="wc_stripe_test_id"
22
- name="wc_stripe_test_id"
23
- value="<?php echo wc_stripe_get_customer_id( $user->ID, 'test' ); ?>" />
24
- </td>
25
- </tr>
26
- </tbody>
27
- </table>
28
- <h2><?php esc_html_e( 'Stripe Live Payment Methods', 'woo-stripe-payment' ); ?></h2>
29
  <?php if ( $payment_methods['live'] ) : ?>
30
- <table class="wc-stripe-payment-methods">
31
- <thead>
32
- <tr>
33
- <th><?php esc_html_e( 'Payment Gateway', 'woo-stripe-payment' ); ?></th>
34
- <th><?php esc_html_e( 'Payment Method', 'woo-stripe-payment' ); ?></th>
35
- <th><?php esc_html_e( 'Token', 'woo-stripe-payment' ); ?></th>
36
- <th><?php esc_html_e( 'Actions', 'woo-stripe-payment' ); ?></th>
37
- </tr>
38
- </thead>
39
- <tbody>
40
  <?php foreach ( $payment_methods['live'] as $token ) : ?>
41
- <tr>
42
- <td><?php echo $token->get_gateway_id(); ?></td>
43
- <td><?php echo $token->get_payment_method_title(); ?></td>
44
- <td><?php echo $token->get_token(); ?></td>
45
- <td><input type="checkbox" name="payment_methods[live][]"
46
- value="<?php echo $token->get_id(); ?>" /></td>
47
- </tr>
48
  <?php endforeach; ?>
49
- <tr>
50
- <th><?php esc_html_e( 'Action', 'delete' ); ?></th>
51
- <td><select name="live_payment_method_actions">
52
- <option value="none" selected><?php esc_html_e( 'No Action', 'woo-stripe-payment' ); ?></option>
53
- <option value="delete"><?php esc_html_e( 'Delete', 'woo-stripe-payment' ); ?></option>
54
- </select></td>
55
- </tr>
56
- </tbody>
57
- </table>
58
  <?php else : ?>
59
  <?php esc_html_e( 'No live payment methods saved', 'woo-stripe-payment' ); ?>
60
  <?php endif; ?>
61
- <h2><?php esc_html_e( 'Stripe Test Payment Methods', 'woo-stripe-payment' ); ?></h2>
62
  <?php if ( $payment_methods['test'] ) : ?>
63
- <table class="wc-stripe-payment-methods">
64
- <thead>
65
- <tr>
66
- <th><?php esc_html_e( 'Payment Gateway', 'woo-stripe-payment' ); ?></th>
67
- <th><?php esc_html_e( 'Payment Method', 'woo-stripe-payment' ); ?></th>
68
- <th><?php esc_html_e( 'Token', 'woo-stripe-payment' ); ?></th>
69
- <th><?php esc_html_e( 'Actions', 'woo-stripe-payment' ); ?></th>
70
- </tr>
71
- </thead>
72
- <tbody>
73
  <?php foreach ( $payment_methods['test'] as $token ) : ?>
74
- <tr>
75
- <td><?php echo $token->get_gateway_id(); ?></td>
76
- <td><?php echo $token->get_payment_method_title(); ?></td>
77
- <td><?php echo $token->get_token(); ?></td>
78
- <td><input type="checkbox" name="payment_methods[test][]"
79
- value="<?php echo $token->get_id(); ?>" /></td>
80
- </tr>
81
  <?php endforeach; ?>
82
- <tr>
83
- <th><?php esc_html_e( 'Action', 'delete' ); ?></th>
84
- <td><select name="test_payment_method_actions">
85
- <option value="none" selected><?php esc_html_e( 'No Action', 'woo-stripe-payment' ); ?></option>
86
- <option value="delete"><?php esc_html_e( 'Delete', 'woo-stripe-payment' ); ?></option>
87
- </select></td>
88
- </tr>
89
- </tbody>
90
- </table>
91
  <?php else : ?>
92
  <?php esc_html_e( 'No test payment methods saved', 'woo-stripe-payment' ); ?>
93
  <?php endif; ?>
94
- <?php printf( __( '%1$snote:%2$s payment methods will be deleted in Stripe if you use the delete action.', 'woo-stripe-payment' ), '<strong>', '</strong>' ); ?>
95
  </div>
2
  /**
3
  * @var WP_User $user
4
  */
5
+
6
  ?>
7
  <div class="wc-stripe-user-info">
8
+ <h2><?php esc_html_e( 'Stripe Customer ID\'s', 'woo-stripe-payment' ); ?></h2>
9
+ <p><?php esc_html_e( 'If you change a customer ID, the customer\'s payment methods will be imported from your Stripe account.' ); ?></p>
10
+ <p><?php esc_html_e( 'If you remove a customer ID, the customer\'s payment methods will be removed from the WC payment methods table.' ); ?></p>
11
+ <table class="form-table">
12
+ <tbody>
13
+ <tr>
14
+ <th><?php esc_html_e( 'Live ID', 'woo-stripe-payment' ); ?></th>
15
+ <td><input type="text" id="wc_stripe_live_id"
16
+ name="wc_stripe_live_id"
17
+ value="<?php echo wc_stripe_get_customer_id( $user->ID, 'live' ); ?>"/>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <th><?php esc_html_e( 'Test ID', 'woo-stripe-payment' ); ?></th>
22
+ <td><input type="text" id="wc_stripe_test_id"
23
+ name="wc_stripe_test_id"
24
+ value="<?php echo wc_stripe_get_customer_id( $user->ID, 'test' ); ?>"/>
25
+ </td>
26
+ </tr>
27
+ </tbody>
28
+ </table>
29
+ <h2><?php esc_html_e( 'Stripe Live Payment Methods', 'woo-stripe-payment' ); ?></h2>
30
  <?php if ( $payment_methods['live'] ) : ?>
31
+ <table class="wc-stripe-payment-methods">
32
+ <thead>
33
+ <tr>
34
+ <th><?php esc_html_e( 'Payment Gateway', 'woo-stripe-payment' ); ?></th>
35
+ <th><?php esc_html_e( 'Payment Method', 'woo-stripe-payment' ); ?></th>
36
+ <th><?php esc_html_e( 'Token', 'woo-stripe-payment' ); ?></th>
37
+ <th><?php esc_html_e( 'Actions', 'woo-stripe-payment' ); ?></th>
38
+ </tr>
39
+ </thead>
40
+ <tbody>
41
  <?php foreach ( $payment_methods['live'] as $token ) : ?>
42
+ <tr>
43
+ <td><?php echo $token->get_gateway_id(); ?></td>
44
+ <td><?php echo $token->get_payment_method_title(); ?></td>
45
+ <td><?php echo $token->get_token(); ?></td>
46
+ <td><input type="checkbox" name="payment_methods[live][]"
47
+ value="<?php echo $token->get_id() . ':' . $token->get_token() ?>"/></td>
48
+ </tr>
49
  <?php endforeach; ?>
50
+ <tr>
51
+ <th><?php esc_html_e( 'Action', 'delete' ); ?></th>
52
+ <td><select name="live_payment_method_actions">
53
+ <option value="none" selected><?php esc_html_e( 'No Action', 'woo-stripe-payment' ); ?></option>
54
+ <option value="delete"><?php esc_html_e( 'Delete', 'woo-stripe-payment' ); ?></option>
55
+ </select></td>
56
+ </tr>
57
+ </tbody>
58
+ </table>
59
  <?php else : ?>
60
  <?php esc_html_e( 'No live payment methods saved', 'woo-stripe-payment' ); ?>
61
  <?php endif; ?>
62
+ <h2><?php esc_html_e( 'Stripe Test Payment Methods', 'woo-stripe-payment' ); ?></h2>
63
  <?php if ( $payment_methods['test'] ) : ?>
64
+ <table class="wc-stripe-payment-methods">
65
+ <thead>
66
+ <tr>
67
+ <th><?php esc_html_e( 'Payment Gateway', 'woo-stripe-payment' ); ?></th>
68
+ <th><?php esc_html_e( 'Payment Method', 'woo-stripe-payment' ); ?></th>
69
+ <th><?php esc_html_e( 'Token', 'woo-stripe-payment' ); ?></th>
70
+ <th><?php esc_html_e( 'Actions', 'woo-stripe-payment' ); ?></th>
71
+ </tr>
72
+ </thead>
73
+ <tbody>
74
  <?php foreach ( $payment_methods['test'] as $token ) : ?>
75
+ <tr>
76
+ <td><?php echo $token->get_gateway_id(); ?></td>
77
+ <td><?php echo $token->get_payment_method_title(); ?></td>
78
+ <td><?php echo $token->get_token(); ?></td>
79
+ <td><input type="checkbox" name="payment_methods[test][]"
80
+ value="<?php echo $token->get_id() . ':' . $token->get_token() ?>"/></td>
81
+ </tr>
82
  <?php endforeach; ?>
83
+ <tr>
84
+ <th><?php esc_html_e( 'Action', 'delete' ); ?></th>
85
+ <td><select name="test_payment_method_actions">
86
+ <option value="none" selected><?php esc_html_e( 'No Action', 'woo-stripe-payment' ); ?></option>
87
+ <option value="delete"><?php esc_html_e( 'Delete', 'woo-stripe-payment' ); ?></option>
88
+ </select></td>
89
+ </tr>
90
+ </tbody>
91
+ </table>
92
  <?php else : ?>
93
  <?php esc_html_e( 'No test payment methods saved', 'woo-stripe-payment' ); ?>
94
  <?php endif; ?>
95
+ <?php printf( __( '%1$sNote:%2$s Payment methods will be deleted from your WordPress site and within Stripe.', 'woo-stripe-payment' ), '<strong>', '</strong>' ); ?>
96
  </div>
includes/class-stripe.php CHANGED
@@ -26,7 +26,7 @@ class WC_Stripe_Manager {
26
  *
27
  * @var string
28
  */
29
- public $version = '3.3.24';
30
 
31
  /**
32
  *
26
  *
27
  * @var string
28
  */
29
+ public $version = '3.3.25';
30
 
31
  /**
32
  *
includes/class-wc-stripe-constants.php CHANGED
@@ -50,6 +50,11 @@ class WC_Stripe_Constants {
50
  */
51
  const PROCESSING_PAYMENT = 'processing_payment';
52
 
 
 
 
 
 
53
  /**
54
  * @since 3.3.3
55
  */
50
  */
51
  const PROCESSING_PAYMENT = 'processing_payment';
52
 
53
+ /**
54
+ * @since 3.3.25
55
+ */
56
+ const PROCESSING_ORDER_PAY = 'processing_order_pay';
57
+
58
  /**
59
  * @since 3.3.3
60
  */
includes/class-wc-stripe-payment-intent.php CHANGED
@@ -70,7 +70,9 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
70
  if ( $intent->status === 'succeeded' || $intent->status === 'requires_capture' ) {
71
  $charge = $intent->charges->data[0];
72
  if ( isset( $intent->setup_future_usage, $intent->customer, $charge->payment_method_details ) && 'off_session' === $intent->setup_future_usage ) {
73
- $this->payment_method->save_payment_method( $intent->payment_method, $order, $charge->payment_method_details );
 
 
74
  }
75
  // remove metadata that's no longer needed
76
  $order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
@@ -120,9 +122,13 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
120
  $args['customer'] = $customer;
121
  }
122
 
123
- $intent = $this->gateway->paymentIntents->mode( wc_stripe_order_mode( $order ) )->create( $args );
124
-
125
  if ( is_wp_error( $intent ) ) {
 
 
 
 
126
  return $intent;
127
  } else {
128
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
70
  if ( $intent->status === 'succeeded' || $intent->status === 'requires_capture' ) {
71
  $charge = $intent->charges->data[0];
72
  if ( isset( $intent->setup_future_usage, $intent->customer, $charge->payment_method_details ) && 'off_session' === $intent->setup_future_usage ) {
73
+ if ( ! defined( WC_Stripe_Constants::PROCESSING_ORDER_PAY ) ) {
74
+ $this->payment_method->save_payment_method( is_object( $intent->payment_method ) ? $intent->payment_method->id : $intent->payment_method, $order, $charge->payment_method_details );
75
+ }
76
  }
77
  // remove metadata that's no longer needed
78
  $order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
122
  $args['customer'] = $customer;
123
  }
124
 
125
+ $retry_mgr = \PaymentPlugins\Stripe\WooCommerceSubscriptions\RetryManager::instance();
126
+ $intent = $this->gateway->mode( $order )->paymentIntents->create( $args );
127
  if ( is_wp_error( $intent ) ) {
128
+ if ( $retry_mgr->should_retry( $order, $this->gateway, $intent, $args ) ) {
129
+ return $this->scheduled_subscription_payment( $amount, $order );
130
+ }
131
+
132
  return $intent;
133
  } else {
134
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
includes/class-wc-stripe-utils.php CHANGED
@@ -235,4 +235,26 @@ class WC_Stripe_Utils {
235
  return true;
236
  }
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
235
  return true;
236
  }
237
 
238
+ public static function get_order_from_payment_intent( $payment_intent ) {
239
+ global $wpdb;
240
+
241
+ if ( isset( $payment_intent->metadata->order_id ) ) {
242
+ $order = wc_get_order( wc_stripe_filter_order_id( $payment_intent->metadata->order_id, $payment_intent ) );
243
+ if ( $order && $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT_ID === $payment_intent->id ) ) {
244
+ return $order;
245
+ }
246
+ }
247
+
248
+ $order_id =
249
+ $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts AS posts LEFT JOIN $wpdb->postmeta AS postmeta ON posts.ID = postmeta.post_id WHERE posts.post_type = %s AND postmeta.meta_key = %s AND postmeta.meta_value = %s LIMIT 1", 'shop_order', WC_Stripe_Constants::PAYMENT_INTENT_ID,
250
+ $payment_intent->id ) );
251
+
252
+ if ( $order_id ) {
253
+ return wc_get_order( $order_id );
254
+ }
255
+
256
+
257
+ return null;
258
+ }
259
+
260
  }
includes/controllers/class-wc-stripe-controller-checkout.php CHANGED
@@ -161,6 +161,12 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
161
  */
162
  public function process_order_pay( $request ) {
163
  global $wp;
 
 
 
 
 
 
164
  /**
165
  * @var \WC_Payment_Gateway_Stripe $payment_method
166
  */
161
  */
162
  public function process_order_pay( $request ) {
163
  global $wp;
164
+
165
+ /**
166
+ * Only set when the order pay is being processed via Ajax.
167
+ */
168
+ wc_maybe_define_constant( WC_Stripe_Constants::PROCESSING_ORDER_PAY, true );
169
+
170
  /**
171
  * @var \WC_Payment_Gateway_Stripe $payment_method
172
  */
includes/wc-stripe-functions.php CHANGED
@@ -308,7 +308,9 @@ function wc_stripe_order_status_completed( $order_id, $order ) {
308
  $gateway = isset( $gateways[ $order->get_payment_method() ] ) ? $gateways[ $order->get_payment_method() ] : null;
309
  // @since 3.0.3 check added to ensure this is a Stripe gateway.
310
  if ( $gateway && $gateway instanceof WC_Payment_Gateway_Stripe && ! $gateway->processing_payment ) {
311
- $gateway->capture_charge( $order->get_total(), $order );
 
 
312
  }
313
  }
314
 
308
  $gateway = isset( $gateways[ $order->get_payment_method() ] ) ? $gateways[ $order->get_payment_method() ] : null;
309
  // @since 3.0.3 check added to ensure this is a Stripe gateway.
310
  if ( $gateway && $gateway instanceof WC_Payment_Gateway_Stripe && ! $gateway->processing_payment ) {
311
+ if ( stripe_wc()->advanced_settings->get_option( 'capture_status', 'completed' ) === $order->get_status() ) {
312
+ $gateway->capture_charge( $order->get_total(), $order );
313
+ }
314
  }
315
  }
316
 
includes/wc-stripe-hooks.php CHANGED
@@ -8,6 +8,7 @@ defined( 'ABSPATH' ) || exit();
8
  add_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10, 2 );
9
  add_action( 'woocommerce_order_status_cancelled', 'wc_stripe_order_cancelled', 10, 2 );
10
  add_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed', 10, 2 );
 
11
  add_action( 'wc_stripe_remove_order_locks', 'wc_stripe_remove_order_locks' );
12
  add_action( 'wc_stripe_retry_source_chargeable', 'wc_stripe_retry_source_chargeable' );
13
 
8
  add_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10, 2 );
9
  add_action( 'woocommerce_order_status_cancelled', 'wc_stripe_order_cancelled', 10, 2 );
10
  add_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed', 10, 2 );
11
+ add_action( 'woocommerce_order_status_processing', 'wc_stripe_order_status_completed', 10, 2 );
12
  add_action( 'wc_stripe_remove_order_locks', 'wc_stripe_remove_order_locks' );
13
  add_action( 'wc_stripe_retry_source_chargeable', 'wc_stripe_retry_source_chargeable' );
14
 
includes/wc-stripe-webhook-functions.php CHANGED
@@ -117,9 +117,10 @@ function wc_stripe_process_charge_succeeded( $charge, $request ) {
117
  * @package Stripe/Functions
118
  */
119
  function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
120
- $order = wc_get_order( wc_stripe_filter_order_id( $intent->metadata['order_id'], $intent ) );
121
  if ( ! $order ) {
122
- wc_stripe_log_error( sprintf( 'Could not complete payment for payment_intent %s. No order ID was found in your WordPress database.', $intent->id ) );
 
123
 
124
  return;
125
  }
@@ -361,7 +362,7 @@ function wc_stripe_review_closed( $review ) {
361
  function wc_stripe_process_requires_action( $payment_intent ) {
362
  if ( isset( $payment_intent->metadata['gateway_id'], $payment_intent->metadata['order_id'] ) ) {
363
  if ( in_array( $payment_intent->metadata['gateway_id'], array( 'stripe_oxxo', 'stripe_boleto' ), true ) ) {
364
- $order = wc_get_order( wc_stripe_filter_order_id( $payment_intent->metadata['order_id'], $payment_intent ) );
365
  if ( ! $order ) {
366
  return;
367
  }
117
  * @package Stripe/Functions
118
  */
119
  function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
120
+ $order = WC_Stripe_Utils::get_order_from_payment_intent( $intent );
121
  if ( ! $order ) {
122
+ wc_stripe_log_info( sprintf( 'Could not complete payment_intent.succeeded event for payment_intent %s. No order ID %s was found in your WordPress database.
123
+ This typically happens when you have multiple webhooks setup for the same account. This order most likely originated from a different site.', $intent->id, isset( $intent->metadata->order_id ) ? $intent->metadata->order_id : '(No Order ID in metadata)' ) );
124
 
125
  return;
126
  }
362
  function wc_stripe_process_requires_action( $payment_intent ) {
363
  if ( isset( $payment_intent->metadata['gateway_id'], $payment_intent->metadata['order_id'] ) ) {
364
  if ( in_array( $payment_intent->metadata['gateway_id'], array( 'stripe_oxxo', 'stripe_boleto' ), true ) ) {
365
+ $order = WC_Stripe_Utils::get_order_from_payment_intent( $payment_intent );
366
  if ( ! $order ) {
367
  return;
368
  }
packages/subscriptions/src/RetryManager.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PaymentPlugins\Stripe\WooCommerceSubscriptions;
4
+
5
+ class RetryManager {
6
+
7
+ /**
8
+ * @var int|mixed
9
+ */
10
+ private $retries = 0;
11
+
12
+ /**
13
+ * @var int|mixed
14
+ */
15
+ private $max_retries;
16
+
17
+ public function __construct( $max_retries = 1 ) {
18
+ $this->max_retries = $max_retries;
19
+ }
20
+
21
+ public static function instance() {
22
+ static $instance;
23
+ if ( ! $instance ) {
24
+ $instance = new self();
25
+ }
26
+
27
+ return $instance;
28
+ }
29
+
30
+ /**
31
+ * @param \WC_Order $order
32
+ * @param \WC_Stripe_Gateway $client
33
+ * @param \WP_Error|\PaymentPlugins\Stripe\WooCommerceSubscriptions\Controllers\PaymentIntent $result
34
+ * @param array $params
35
+ *
36
+ * @return bool
37
+ */
38
+ public function should_retry( $order, $client, $result, $params ) {
39
+ $data = $result->get_error_data();
40
+ if ( $this->has_retries() && isset( $data['param'], $params['customer'], $params['payment_method'] ) && 'payment_method' === $data['param'] ) {
41
+ // check if the payment method's customer doesn't match the customer associated with the subscription
42
+ $payment_method = $client->paymentMethods->retrieve( $params['payment_method'] );
43
+ if ( ! is_wp_error( $payment_method ) ) {
44
+ if ( $payment_method->customer !== $params['customer'] ) {
45
+ $order->update_meta_data( \WC_Stripe_Constants::CUSTOMER_ID, $payment_method->customer );
46
+ $order->save();
47
+ $subscription = wc_get_order( $order->get_meta( '_subscription_renewal' ) );
48
+ if ( $subscription ) {
49
+ $subscription->update_meta_data( \WC_Stripe_Constants::CUSTOMER_ID, $payment_method->customer );
50
+ $subscription->save();
51
+ }
52
+ wc_stripe_log_info( sprintf( 'Retrying payment for renewal order %s. Reason: %s', $order->get_id(), $result->get_error_message() ) );
53
+ $this->retries += 1;
54
+
55
+ return true;
56
+ }
57
+ }
58
+ }
59
+
60
+ return false;
61
+ }
62
+
63
+ private function has_retries() {
64
+ return $this->retries < $this->max_retries;
65
+ }
66
+
67
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofo
4
  Requires at least: 3.0.1
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 3.3.24
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -62,6 +62,10 @@ If you're site is not loading over https, then Stripe won't render the Payment R
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
 
 
 
 
65
  = 3.3.24 - 7/5/22 =
66
  * Fixed - Remove payment intent from session when intent's status is processing
67
  * Updated - If payment intent's status transitions to requires_payment_method, update order status to pending
4
  Requires at least: 3.0.1
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 3.3.25
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
65
+ = 3.3.25 = - 8/3/22 =
66
+ * Added - Advanced Settings option so merchants can control if the processing or completed status triggers the capture for an authorized order
67
+ * Fixed - Customer pay for order page error caused by Stripe payment form (beta)
68
+ * Added - Improved Subscription retry logic
69
  = 3.3.24 - 7/5/22 =
70
  * Fixed - Remove payment intent from session when intent's status is processing
71
  * Updated - If payment intent's status transitions to requires_payment_method, update order status to pending
src/Controllers/PaymentIntent.php CHANGED
@@ -116,17 +116,17 @@ class PaymentIntent {
116
  public function create_payment_intent_from_cart( $payment_method_types ) {
117
  // create the payment intent
118
  if ( WC()->cart && WC()->cart->needs_payment() ) {
119
- $currency = get_woocommerce_currency();
120
- $customer_id = wc_stripe_get_customer_id();
121
- $params = [
122
  'amount' => wc_stripe_add_number_precision( WC()->cart->total, $currency ),
123
  'currency' => $currency,
124
  'confirmation_method' => 'automatic',
125
  'payment_method_types' => $payment_method_types
126
  ];
127
- if ( $customer_id ) {
128
  $params['customer'] = $customer_id;
129
- }
130
  $payment_intent = $this->client->paymentIntents->create( apply_filters( 'wc_stripe_create_payment_intent_params_from_cart', $params, $this ) );
131
  if ( ! is_wp_error( $payment_intent ) ) {
132
  $this->save_payment_intent_to_session( $payment_intent );
@@ -136,8 +136,8 @@ class PaymentIntent {
136
 
137
  public function create_payment_intent_from_order( $order, $payment_method_types ) {
138
  // create the payment intent
139
- $currency = $order->get_currency();
140
- $customer_id = wc_stripe_get_customer_id( $order->get_customer_id() );
141
  if ( 0 < $order->get_total() ) {
142
  $params = [
143
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $currency ),
@@ -145,9 +145,9 @@ class PaymentIntent {
145
  'confirmation_method' => \WC_Stripe_Constants::AUTOMATIC,
146
  'payment_method_types' => $payment_method_types
147
  ];
148
- if ( $customer_id ) {
149
  $params['customer'] = $customer_id;
150
- }
151
  $payment_intent = $this->client->paymentIntents->create( apply_filters( 'wc_stripe_create_payment_intent_params_from_order', $params, $order, $this ) );
152
  if ( ! is_wp_error( $payment_intent ) ) {
153
  $order->update_meta_data( \WC_Stripe_Constants::PAYMENT_INTENT, $payment_intent->toArray() );
@@ -160,17 +160,17 @@ class PaymentIntent {
160
  public function update_payment_intent_from_cart( $payment_intent, $payment_method_types ) {
161
  // create the payment intent
162
  if ( WC()->cart && WC()->cart->needs_payment() ) {
163
- $id = $payment_intent->id;
164
- $currency = get_woocommerce_currency();
165
- $customer_id = wc_stripe_get_customer_id();
166
- $params = [
167
  'amount' => wc_stripe_add_number_precision( WC()->cart->total, $currency ),
168
  'currency' => $currency,
169
  'payment_method_types' => $payment_method_types
170
  ];
171
- if ( $customer_id ) {
172
  $params['customer'] = $customer_id;
173
- }
174
  $payment_intent = $this->client->paymentIntents->update( $id, apply_filters( 'wc_stripe_update_payment_intent_params_from_cart', $params, $this ) );
175
  if ( ! is_wp_error( $payment_intent ) ) {
176
  $this->save_payment_intent_to_session( $payment_intent );
@@ -186,16 +186,16 @@ class PaymentIntent {
186
 
187
  private function update_payment_intent_from_order( $id, $order, $payment_method_types ) {
188
  // create the payment intent
189
- $currency = $order->get_currency();
190
- $customer_id = wc_stripe_get_customer_id( $order->get_customer_id() );
191
- $params = [
192
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $currency ),
193
  'currency' => $currency,
194
  'payment_method_types' => $payment_method_types
195
  ];
196
- if ( $customer_id ) {
197
  $params['customer'] = $customer_id;
198
- }
199
  $payment_intent = $this->client->paymentIntents->update( $id, apply_filters( 'wc_stripe_update_payment_intent_params_from_order', $params, $order, $this ) );
200
  if ( ! is_wp_error( $payment_intent ) ) {
201
  $order->update_meta_data( \WC_Stripe_Constants::PAYMENT_INTENT, $payment_intent->toArray() );
116
  public function create_payment_intent_from_cart( $payment_method_types ) {
117
  // create the payment intent
118
  if ( WC()->cart && WC()->cart->needs_payment() ) {
119
+ $currency = get_woocommerce_currency();
120
+ //$customer_id = wc_stripe_get_customer_id();
121
+ $params = [
122
  'amount' => wc_stripe_add_number_precision( WC()->cart->total, $currency ),
123
  'currency' => $currency,
124
  'confirmation_method' => 'automatic',
125
  'payment_method_types' => $payment_method_types
126
  ];
127
+ /*if ( $customer_id ) {
128
  $params['customer'] = $customer_id;
129
+ }*/
130
  $payment_intent = $this->client->paymentIntents->create( apply_filters( 'wc_stripe_create_payment_intent_params_from_cart', $params, $this ) );
131
  if ( ! is_wp_error( $payment_intent ) ) {
132
  $this->save_payment_intent_to_session( $payment_intent );
136
 
137
  public function create_payment_intent_from_order( $order, $payment_method_types ) {
138
  // create the payment intent
139
+ $currency = $order->get_currency();
140
+ //$customer_id = wc_stripe_get_customer_id( $order->get_customer_id() );
141
  if ( 0 < $order->get_total() ) {
142
  $params = [
143
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $currency ),
145
  'confirmation_method' => \WC_Stripe_Constants::AUTOMATIC,
146
  'payment_method_types' => $payment_method_types
147
  ];
148
+ /*if ( $customer_id ) {
149
  $params['customer'] = $customer_id;
150
+ }*/
151
  $payment_intent = $this->client->paymentIntents->create( apply_filters( 'wc_stripe_create_payment_intent_params_from_order', $params, $order, $this ) );
152
  if ( ! is_wp_error( $payment_intent ) ) {
153
  $order->update_meta_data( \WC_Stripe_Constants::PAYMENT_INTENT, $payment_intent->toArray() );
160
  public function update_payment_intent_from_cart( $payment_intent, $payment_method_types ) {
161
  // create the payment intent
162
  if ( WC()->cart && WC()->cart->needs_payment() ) {
163
+ $id = $payment_intent->id;
164
+ $currency = get_woocommerce_currency();
165
+ //$customer_id = wc_stripe_get_customer_id();
166
+ $params = [
167
  'amount' => wc_stripe_add_number_precision( WC()->cart->total, $currency ),
168
  'currency' => $currency,
169
  'payment_method_types' => $payment_method_types
170
  ];
171
+ /*if ( $customer_id ) {
172
  $params['customer'] = $customer_id;
173
+ }*/
174
  $payment_intent = $this->client->paymentIntents->update( $id, apply_filters( 'wc_stripe_update_payment_intent_params_from_cart', $params, $this ) );
175
  if ( ! is_wp_error( $payment_intent ) ) {
176
  $this->save_payment_intent_to_session( $payment_intent );
186
 
187
  private function update_payment_intent_from_order( $id, $order, $payment_method_types ) {
188
  // create the payment intent
189
+ $currency = $order->get_currency();
190
+ //$customer_id = wc_stripe_get_customer_id( $order->get_customer_id() );
191
+ $params = [
192
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $currency ),
193
  'currency' => $currency,
194
  'payment_method_types' => $payment_method_types
195
  ];
196
+ /*if ( $customer_id ) {
197
  $params['customer'] = $customer_id;
198
+ }*/
199
  $payment_intent = $this->client->paymentIntents->update( $id, apply_filters( 'wc_stripe_update_payment_intent_params_from_order', $params, $order, $this ) );
200
  if ( ! is_wp_error( $payment_intent ) ) {
201
  $order->update_meta_data( \WC_Stripe_Constants::PAYMENT_INTENT, $payment_intent->toArray() );
src/PluginValidation.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PaymentPlugins\Stripe;
4
+
5
+ class PluginValidation {
6
+
7
+ public static function is_valid( $callback ) {
8
+ try {
9
+ self::assert_php_version();
10
+
11
+ $callback();
12
+ } catch ( \Exception $e ) {
13
+ self::add_admin_notice( $e->getMessage() );
14
+ }
15
+ }
16
+
17
+ private static function assert_php_version() {
18
+ if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
19
+ throw new \Exception( sprintf( __( 'Your PHP version is %s but Stripe requires version 5.6+.', 'woo-stripe-payment' ), PHP_VERSION ) );
20
+ }
21
+ }
22
+
23
+ private static function add_admin_notice( $msg ) {
24
+ add_action( 'admin_notices', function () use ( $msg ) {
25
+ ?>
26
+ <div class="notice notice-error woocommerce-message">
27
+ <h4>
28
+ <?php echo $msg ?>
29
+ </h4>
30
+ </div>
31
+ <?php
32
+ } );
33
+ }
34
+
35
+ }
stripe-payments.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
- * Version: 3.3.24
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
@@ -14,21 +14,14 @@
14
  */
15
  defined( 'ABSPATH' ) || exit ();
16
 
17
- function wc_stripe_php_version_notice() {
18
- $message = sprintf( __( 'Your PHP version is %s but Stripe requires version 5.6+.', 'woo-stripe-payment' ), PHP_VERSION );
19
- echo '<div class="notice notice-error"><p style="font-size: 16px">' . $message . '</p></div>';
20
- }
21
-
22
- if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
23
- add_action( 'admin_init', 'wc_stripe_php_version_notice' );
24
-
25
- return;
26
- }
27
 
28
  define( 'WC_STRIPE_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) );
29
  define( 'WC_STRIPE_ASSETS', plugin_dir_url( __FILE__ ) . 'assets/' );
30
  define( 'WC_STRIPE_PLUGIN_NAME', plugin_basename( __FILE__ ) );
31
 
32
  require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'vendor/autoload.php' );
33
- // include main plugin file.
34
- require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-stripe.php' );
 
 
 
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
+ * Version: 3.3.25
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
14
  */
15
  defined( 'ABSPATH' ) || exit ();
16
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  define( 'WC_STRIPE_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) );
19
  define( 'WC_STRIPE_ASSETS', plugin_dir_url( __FILE__ ) . 'assets/' );
20
  define( 'WC_STRIPE_PLUGIN_NAME', plugin_basename( __FILE__ ) );
21
 
22
  require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'vendor/autoload.php' );
23
+
24
+ PaymentPlugins\Stripe\PluginValidation::is_valid( function () {
25
+ // include main plugin file.
26
+ require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-stripe.php' );
27
+ } );
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '0977434b1f22bd484f222a21c2cf60c02734d0dc',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '0977434b1f22bd484f222a21c2cf60c02734d0dc',
20
  'dev_requirement' => false,
21
  ),
22
  'stripe/stripe-php' => array(
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => 'a8f0983821ca1613e713538793ce305f9889e83e',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => 'a8f0983821ca1613e713538793ce305f9889e83e',
20
  'dev_requirement' => false,
21
  ),
22
  'stripe/stripe-php' => array(