Version Description
2019-11-12 = * Fix - Overwrite the previous Apple Pay verification file if it has changed. * Fix - Avoid re-mounting card elements if they are already mounted in the DOM. * Fix - Compatibility with WooCommerce Deposits by retrieving order statuses in a different way. * Fix - Duplicate payment notifications for subscriptions. * Fix - Use the same customer after a new credit card has been entered. * Fix - Google Pay buttons on subscriptions. * Add - A filter, which allows all subscriptions' payment methods to be overwritten when adding a new payment method.
Download this release
Release Info
Developer | woothemes |
Plugin | WooCommerce Stripe Payment Gateway |
Version | 4.3.1 |
Comparing to | |
See all releases |
Code changes from version 4.3.0 to 4.3.1
- assets/js/stripe.js +6 -1
- assets/js/stripe.min.js +1 -1
- changelog.txt +9 -0
- includes/abstracts/abstract-wc-stripe-payment-gateway.php +11 -5
- includes/class-wc-gateway-stripe.php +14 -8
- includes/class-wc-stripe-api.php +3 -1
- includes/class-wc-stripe-apple-pay-registration.php +36 -12
- includes/class-wc-stripe-customer.php +40 -7
- includes/class-wc-stripe-order-handler.php +1 -1
- includes/class-wc-stripe-webhook-handler.php +8 -8
- includes/compat/class-wc-stripe-sepa-subs-compat.php +13 -9
- includes/compat/class-wc-stripe-subs-compat.php +17 -10
- includes/payment-methods/class-wc-stripe-payment-request.php +6 -5
- languages/woocommerce-gateway-stripe.pot +39 -34
- readme.txt +11 -5
- woocommerce-gateway-stripe.php +4 -4
assets/js/stripe.js
CHANGED
@@ -136,7 +136,12 @@ jQuery( function( $ ) {
|
|
136 |
*/
|
137 |
if ( 'yes' === wc_stripe_params.is_checkout ) {
|
138 |
$( document.body ).on( 'updated_checkout', function() {
|
139 |
-
// Don't mount
|
|
|
|
|
|
|
|
|
|
|
140 |
if ( stripe_card ) {
|
141 |
wc_stripe_form.unmountElements();
|
142 |
}
|
136 |
*/
|
137 |
if ( 'yes' === wc_stripe_params.is_checkout ) {
|
138 |
$( document.body ).on( 'updated_checkout', function() {
|
139 |
+
// Don't re-mount if already mounted in DOM.
|
140 |
+
if ( $( '#stripe-card-element' ).children().length ) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
|
144 |
+
// Unmount prior to re-mounting.
|
145 |
if ( stripe_card ) {
|
146 |
wc_stripe_form.unmountElements();
|
147 |
}
|
assets/js/stripe.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(c){"use strict";try{var o=Stripe(wc_stripe_params.key)}catch(e){return void console.log(e)}var t,n,i,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},s=o.elements(e),a=s.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),n.unmount("#stripe-exp-element"),i.unmount("#stripe-cvc-element"))},mountElements:function(){if(c("#stripe-card-element").length){if("yes"===wc_stripe_params.inline_cc_form)return t.mount("#stripe-card-element");t.mount("#stripe-card-element"),n.mount("#stripe-exp-element"),i.mount("#stripe-cvc-element")}},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"};e=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:e,r=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:r,"yes"===wc_stripe_params.inline_cc_form?(t=s.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}):(t=s.create("cardNumber",{style:e,classes:r}),n=s.create("cardExpiry",{style:e,classes:r}),i=s.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&c(document.body).trigger("stripeError",e)}),n.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}),i.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?c(document.body).on("updated_checkout",function(){t&&m.unmountElements(),m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element")}):(c("form#add_payment_method").length||c("form#order_review").length)&&(m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=c(".stripe-card-brand"),n="stripe-credit-card-brand";e in r&&(n=r[e]),c.each(r,function(e,r){t.removeClass(r)}),t.addClass(n)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||c(document.body).trigger("wc-credit-card-form-init"),c("form.woocommerce-checkout").length&&(this.form=c("form.woocommerce-checkout")),c("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),c("form#order_review").length&&(this.form=c("form#order_review")),c("form#order_review, form#add_payment_method").on("submit",this.onSubmit),c("form#add_payment_method").length&&(this.form=c("form#add_payment_method")),c("form.woocommerce-checkout").on("change",this.reset),c(document).on("stripeError",this.onError).on("checkout_error",this.reset),a.on("change",this.onSepaError),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent()},isStripeChosen:function(){return c("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||c("#payment_method_stripe").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return c("#payment_method_stripe").is(":checked")&&c('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&c('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return c("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return c("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return c("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return c("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return c("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return c("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return c("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return c("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return c("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return c("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<c("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return c('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=c("#billing_first_name").length?c("#billing_first_name").val():wc_stripe_params.billing_first_name,r=c("#billing_last_name").length?c("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:c("#stripe-payment-data").data("full-name"),t.email=c("#billing_email").val(),t.phone=c("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(c("#stripe-payment-data").data("email").length?t.email=c("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=c("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=c("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=c("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=c("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=c("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=c("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=c("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",o.createSource(a,e).then(m.sourceResponse)):o.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){if(e.error)return c(document.body).trigger("stripeError",e);m.reset(),m.form.append(c('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),c("form#add_payment_method").length&&c(m.form).off("submit",m.form.onSubmit),m.form.submit()},onSubmit:function(){return!m.isStripeChosen()||(!(!m.isStripeSaveCardChosen()&&!m.hasSource())||(!!(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())||(m.block(),m.createSource(),!1)))},onCCFormChange:function(){m.reset()},reset:function(){c(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(!e.error)return c(r).html("");console.log(e.error.message),c(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(r).find("li").text(e.error.message)},onError:function(e,r){var t,n=r.error.message,o=m.getSelectedPaymentElement().closest("li"),i=o.find(".woocommerce-SavedPaymentMethods-tokenInput");if(i.length){var s=i.filter(":checked");t=s.closest(".woocommerce-SavedPaymentMethods-new").length?c("#wc-stripe-cc-form .stripe-source-errors"):s.closest("li").find(".stripe-source-errors")}else t=o.find(".stripe-source-errors");if(m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){var a='<ul class="woocommerce-error"><li /></ul>';return a.find("li").text(wc_stripe_params[r.error.code]),m.submitError(a)}"email_invalid"===r.error.code?n=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(n=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(n=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(n=wc_stripe_params[r.error.code]),m.reset(),c(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),c(t).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(t).find("li").text(n),c(".wc-stripe-error").length&&c("html, body").animate({scrollTop:c(".wc-stripe-error").offset().top-200},200),m.unblock(),c.unblockUI()},submitError:function(e){c(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").blur();var r="";c("#add_payment_method").length&&(r=c("#add_payment_method")),c("#order_review").length&&(r=c("#order_review")),c("form.checkout").length&&(r=c("form.checkout")),r.length&&c("html, body").animate({scrollTop:r.offset().top-100},500),c(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);if(e&&!(e.length<4)){var r=e[1],t=e[2],n=decodeURIComponent(e[3]);window.location.hash="",m.openIntentModal(t,n,!1,"si"===r)}},maybeConfirmIntent:function(){if(c("#stripe-intent-id").length&&c("#stripe-intent-return").length){var e=c("#stripe-intent-id").val(),r=c("#stripe-intent-return").val();m.openIntentModal(e,r,!0,!1)}},openIntentModal:function(e,t,r,n){o[n?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;var r=e[n?"setupIntent":"paymentIntent"];"requires_capture"!==r.status&&"succeeded"!==r.status||(window.location=t)}).catch(function(e){if(r)return window.location=t;c(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),c.get(t+"&is_ajax")})}};m.init()});
|
1 |
+
jQuery(function(c){"use strict";try{var o=Stripe(wc_stripe_params.key)}catch(e){return void console.log(e)}var t,n,i,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},s=o.elements(e),a=s.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),n.unmount("#stripe-exp-element"),i.unmount("#stripe-cvc-element"))},mountElements:function(){if(c("#stripe-card-element").length){if("yes"===wc_stripe_params.inline_cc_form)return t.mount("#stripe-card-element");t.mount("#stripe-card-element"),n.mount("#stripe-exp-element"),i.mount("#stripe-cvc-element")}},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"};e=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:e,r=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:r,"yes"===wc_stripe_params.inline_cc_form?(t=s.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}):(t=s.create("cardNumber",{style:e,classes:r}),n=s.create("cardExpiry",{style:e,classes:r}),i=s.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&c(document.body).trigger("stripeError",e)}),n.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}),i.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?c(document.body).on("updated_checkout",function(){c("#stripe-card-element").children().length||(t&&m.unmountElements(),m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element"))}):(c("form#add_payment_method").length||c("form#order_review").length)&&(m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=c(".stripe-card-brand"),n="stripe-credit-card-brand";e in r&&(n=r[e]),c.each(r,function(e,r){t.removeClass(r)}),t.addClass(n)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||c(document.body).trigger("wc-credit-card-form-init"),c("form.woocommerce-checkout").length&&(this.form=c("form.woocommerce-checkout")),c("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),c("form#order_review").length&&(this.form=c("form#order_review")),c("form#order_review, form#add_payment_method").on("submit",this.onSubmit),c("form#add_payment_method").length&&(this.form=c("form#add_payment_method")),c("form.woocommerce-checkout").on("change",this.reset),c(document).on("stripeError",this.onError).on("checkout_error",this.reset),a.on("change",this.onSepaError),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent()},isStripeChosen:function(){return c("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||c("#payment_method_stripe").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return c("#payment_method_stripe").is(":checked")&&c('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&c('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return c("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return c("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return c("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return c("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return c("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return c("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return c("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return c("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return c("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return c("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<c("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return c('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=c("#billing_first_name").length?c("#billing_first_name").val():wc_stripe_params.billing_first_name,r=c("#billing_last_name").length?c("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:c("#stripe-payment-data").data("full-name"),t.email=c("#billing_email").val(),t.phone=c("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(c("#stripe-payment-data").data("email").length?t.email=c("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=c("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=c("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=c("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=c("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=c("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=c("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=c("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",o.createSource(a,e).then(m.sourceResponse)):o.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){if(e.error)return c(document.body).trigger("stripeError",e);m.reset(),m.form.append(c('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),c("form#add_payment_method").length&&c(m.form).off("submit",m.form.onSubmit),m.form.submit()},onSubmit:function(){return!m.isStripeChosen()||(!(!m.isStripeSaveCardChosen()&&!m.hasSource())||(!!(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())||(m.block(),m.createSource(),!1)))},onCCFormChange:function(){m.reset()},reset:function(){c(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(!e.error)return c(r).html("");console.log(e.error.message),c(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(r).find("li").text(e.error.message)},onError:function(e,r){var t,n=r.error.message,o=m.getSelectedPaymentElement().closest("li"),i=o.find(".woocommerce-SavedPaymentMethods-tokenInput");if(i.length){var s=i.filter(":checked");t=s.closest(".woocommerce-SavedPaymentMethods-new").length?c("#wc-stripe-cc-form .stripe-source-errors"):s.closest("li").find(".stripe-source-errors")}else t=o.find(".stripe-source-errors");if(m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){var a='<ul class="woocommerce-error"><li /></ul>';return a.find("li").text(wc_stripe_params[r.error.code]),m.submitError(a)}"email_invalid"===r.error.code?n=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(n=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(n=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(n=wc_stripe_params[r.error.code]),m.reset(),c(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),c(t).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(t).find("li").text(n),c(".wc-stripe-error").length&&c("html, body").animate({scrollTop:c(".wc-stripe-error").offset().top-200},200),m.unblock(),c.unblockUI()},submitError:function(e){c(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").blur();var r="";c("#add_payment_method").length&&(r=c("#add_payment_method")),c("#order_review").length&&(r=c("#order_review")),c("form.checkout").length&&(r=c("form.checkout")),r.length&&c("html, body").animate({scrollTop:r.offset().top-100},500),c(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);if(e&&!(e.length<4)){var r=e[1],t=e[2],n=decodeURIComponent(e[3]);window.location.hash="",m.openIntentModal(t,n,!1,"si"===r)}},maybeConfirmIntent:function(){if(c("#stripe-intent-id").length&&c("#stripe-intent-return").length){var e=c("#stripe-intent-id").val(),r=c("#stripe-intent-return").val();m.openIntentModal(e,r,!0,!1)}},openIntentModal:function(e,t,r,n){o[n?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;var r=e[n?"setupIntent":"paymentIntent"];"requires_capture"!==r.status&&"succeeded"!==r.status||(window.location=t)}).catch(function(e){if(r)return window.location=t;c(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),c.get(t+"&is_ajax")})}};m.init()});
|
changelog.txt
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
*** Changelog ***
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 4.3.0 2019-10-17 =
|
4 |
* Add - For WooCommerce Subscriptions optimize the payment flow for subsequent subscription payments when authentication may be required by using the `setup_future_usage` parameter for the first subscription payment
|
5 |
* Add - Allow customer to authenticate payment even if they are not charged right away for WooCommerce Subscriptions and Pre-Orders, for example for a WooCommerce Subscription that has a free trial
|
1 |
*** Changelog ***
|
2 |
|
3 |
+
= 4.3.1 2019-11-12 =
|
4 |
+
* Fix - Overwrite the previous Apple Pay verification file if it has changed.
|
5 |
+
* Fix - Avoid re-mounting card elements if they are already mounted in the DOM.
|
6 |
+
* Fix - Compatibility with WooCommerce Deposits by retrieving order statuses in a different way.
|
7 |
+
* Fix - Duplicate payment notifications for subscriptions.
|
8 |
+
* Fix - Use the same customer after a new credit card has been entered.
|
9 |
+
* Fix - Google Pay buttons on subscriptions.
|
10 |
+
* Add - A filter, which allows all subscriptions' payment methods to be overwritten when adding a new payment method.
|
11 |
+
|
12 |
= 4.3.0 2019-10-17 =
|
13 |
* Add - For WooCommerce Subscriptions optimize the payment flow for subsequent subscription payments when authentication may be required by using the `setup_future_usage` parameter for the first subscription payment
|
14 |
* Add - Allow customer to authenticate payment even if they are not charged right away for WooCommerce Subscriptions and Pre-Orders, for example for a WooCommerce Subscription that has a free trial
|
includes/abstracts/abstract-wc-stripe-payment-gateway.php
CHANGED
@@ -576,8 +576,12 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
|
|
576 |
* @throws Exception When card was not added or for and invalid card.
|
577 |
* @return object
|
578 |
*/
|
579 |
-
public function prepare_source( $user_id, $force_save_source = false ) {
|
580 |
-
$customer
|
|
|
|
|
|
|
|
|
581 |
$force_save_source = apply_filters( 'wc_stripe_force_save_source', $force_save_source, $customer );
|
582 |
$source_object = '';
|
583 |
$source_id = '';
|
@@ -641,6 +645,8 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
|
|
641 |
if ( ! $customer_id ) {
|
642 |
$customer->set_id( $customer->create_customer() );
|
643 |
$customer_id = $customer->get_id();
|
|
|
|
|
644 |
}
|
645 |
|
646 |
if ( empty( $source_object ) && ! $is_token ) {
|
@@ -1204,18 +1210,18 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
|
|
1204 |
* @param stdClass $intent The intent that is being processed.
|
1205 |
* @return bool A flag that indicates whether the order is already locked.
|
1206 |
*/
|
1207 |
-
public function lock_order_payment( $order, $intent ) {
|
1208 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
1209 |
$transient_name = 'wc_stripe_processing_intent_' . $order_id;
|
1210 |
$processing = get_transient( $transient_name );
|
1211 |
|
1212 |
// Block the process if the same intent is already being handled.
|
1213 |
-
if ( $processing === $intent->id ) {
|
1214 |
return true;
|
1215 |
}
|
1216 |
|
1217 |
// Save the new intent as a transient, eventually overwriting another one.
|
1218 |
-
set_transient( $transient_name, $intent->id, 5 * MINUTE_IN_SECONDS );
|
1219 |
|
1220 |
return false;
|
1221 |
}
|
576 |
* @throws Exception When card was not added or for and invalid card.
|
577 |
* @return object
|
578 |
*/
|
579 |
+
public function prepare_source( $user_id, $force_save_source = false, $existing_customer_id = null ) {
|
580 |
+
$customer = new WC_Stripe_Customer( $user_id );
|
581 |
+
if ( ! empty( $existing_customer_id ) ) {
|
582 |
+
$customer->set_id( $existing_customer_id );
|
583 |
+
}
|
584 |
+
|
585 |
$force_save_source = apply_filters( 'wc_stripe_force_save_source', $force_save_source, $customer );
|
586 |
$source_object = '';
|
587 |
$source_id = '';
|
645 |
if ( ! $customer_id ) {
|
646 |
$customer->set_id( $customer->create_customer() );
|
647 |
$customer_id = $customer->get_id();
|
648 |
+
} else {
|
649 |
+
$customer->update_customer();
|
650 |
}
|
651 |
|
652 |
if ( empty( $source_object ) && ! $is_token ) {
|
1210 |
* @param stdClass $intent The intent that is being processed.
|
1211 |
* @return bool A flag that indicates whether the order is already locked.
|
1212 |
*/
|
1213 |
+
public function lock_order_payment( $order, $intent = null ) {
|
1214 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
1215 |
$transient_name = 'wc_stripe_processing_intent_' . $order_id;
|
1216 |
$processing = get_transient( $transient_name );
|
1217 |
|
1218 |
// Block the process if the same intent is already being handled.
|
1219 |
+
if ( "-1" === $processing || ( isset( $intent->id ) && $processing === $intent->id ) ) {
|
1220 |
return true;
|
1221 |
}
|
1222 |
|
1223 |
// Save the new intent as a transient, eventually overwriting another one.
|
1224 |
+
set_transient( $transient_name, empty( $intent ) ? '-1' : $intent->id, 5 * MINUTE_IN_SECONDS );
|
1225 |
|
1226 |
return false;
|
1227 |
}
|
includes/class-wc-gateway-stripe.php
CHANGED
@@ -578,7 +578,18 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
|
|
578 |
return $this->pre_orders->process_pre_order( $order_id );
|
579 |
}
|
580 |
|
581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
|
583 |
$this->maybe_disallow_prepaid_card( $prepared_source );
|
584 |
$this->check_source( $prepared_source );
|
@@ -593,11 +604,6 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
|
|
593 |
|
594 |
WC_Stripe_Logger::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
|
595 |
|
596 |
-
$intent = $this->get_intent_from_order( $order );
|
597 |
-
if ( isset( $intent->object ) && 'setup_intent' === $intent->object ) {
|
598 |
-
$intent = false; // This function can only deal with *payment* intents
|
599 |
-
}
|
600 |
-
|
601 |
if ( $intent ) {
|
602 |
$intent = $this->update_existing_intent( $intent, $order, $prepared_source );
|
603 |
} else {
|
@@ -1018,7 +1024,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
|
|
1018 |
clean_post_cache( $order->get_id() );
|
1019 |
$order = wc_get_order( $order->get_id() );
|
1020 |
|
1021 |
-
if (
|
1022 |
// If payment has already been completed, this function is redundant.
|
1023 |
return;
|
1024 |
}
|
@@ -1054,7 +1060,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
|
|
1054 |
*/
|
1055 |
public function failed_sca_auth( $order, $intent ) {
|
1056 |
// If the order has already failed, do not repeat the same message.
|
1057 |
-
if ( 'failed'
|
1058 |
return;
|
1059 |
}
|
1060 |
|
578 |
return $this->pre_orders->process_pre_order( $order_id );
|
579 |
}
|
580 |
|
581 |
+
// Check whether there is an existing intent.
|
582 |
+
$intent = $this->get_intent_from_order( $order );
|
583 |
+
if ( isset( $intent->object ) && 'setup_intent' === $intent->object ) {
|
584 |
+
$intent = false; // This function can only deal with *payment* intents
|
585 |
+
}
|
586 |
+
|
587 |
+
$stripe_customer_id = null;
|
588 |
+
if ( $intent && ! empty( $intent->customer ) ) {
|
589 |
+
$stripe_customer_id = $intent->customer;
|
590 |
+
}
|
591 |
+
|
592 |
+
$prepared_source = $this->prepare_source( get_current_user_id(), $force_save_source, $stripe_customer_id );
|
593 |
|
594 |
$this->maybe_disallow_prepaid_card( $prepared_source );
|
595 |
$this->check_source( $prepared_source );
|
604 |
|
605 |
WC_Stripe_Logger::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
|
606 |
|
|
|
|
|
|
|
|
|
|
|
607 |
if ( $intent ) {
|
608 |
$intent = $this->update_existing_intent( $intent, $order, $prepared_source );
|
609 |
} else {
|
1024 |
clean_post_cache( $order->get_id() );
|
1025 |
$order = wc_get_order( $order->get_id() );
|
1026 |
|
1027 |
+
if ( ! $order->has_status( array( 'pending', 'failed' ) ) ) {
|
1028 |
// If payment has already been completed, this function is redundant.
|
1029 |
return;
|
1030 |
}
|
1060 |
*/
|
1061 |
public function failed_sca_auth( $order, $intent ) {
|
1062 |
// If the order has already failed, do not repeat the same message.
|
1063 |
+
if ( $order->has_status( 'failed' ) ) {
|
1064 |
return;
|
1065 |
}
|
1066 |
|
includes/class-wc-stripe-api.php
CHANGED
@@ -96,8 +96,10 @@ class WC_Stripe_API {
|
|
96 |
* @version 4.0.6
|
97 |
* @param array $request
|
98 |
* @param string $api
|
|
|
99 |
* @param bool $with_headers To get the response with headers.
|
100 |
-
* @return array
|
|
|
101 |
*/
|
102 |
public static function request( $request, $api = 'charges', $method = 'POST', $with_headers = false ) {
|
103 |
WC_Stripe_Logger::log( "{$api} request: " . print_r( $request, true ) );
|
96 |
* @version 4.0.6
|
97 |
* @param array $request
|
98 |
* @param string $api
|
99 |
+
* @param string $method
|
100 |
* @param bool $with_headers To get the response with headers.
|
101 |
+
* @return stdClass|array
|
102 |
+
* @throws WC_Stripe_Exception
|
103 |
*/
|
104 |
public static function request( $request, $api = 'charges', $method = 'POST', $with_headers = false ) {
|
105 |
WC_Stripe_Logger::log( "{$api} request: " . print_r( $request, true ) );
|
includes/class-wc-stripe-apple-pay-registration.php
CHANGED
@@ -60,6 +60,8 @@ class WC_Stripe_Apple_Pay_Registration {
|
|
60 |
public $apple_pay_verify_notice;
|
61 |
|
62 |
public function __construct() {
|
|
|
|
|
63 |
$this->stripe_settings = get_option( 'woocommerce_stripe_settings', array() );
|
64 |
$this->stripe_enabled = $this->get_option( 'enabled' );
|
65 |
$this->payment_request = 'yes' === $this->get_option( 'payment_request', 'yes' );
|
@@ -162,34 +164,56 @@ class WC_Stripe_Apple_Pay_Registration {
|
|
162 |
}
|
163 |
|
164 |
/**
|
165 |
-
*
|
166 |
*
|
167 |
-
* @
|
168 |
-
*
|
|
|
|
|
|
|
169 |
*/
|
170 |
-
public function
|
171 |
-
try {
|
172 |
$path = untrailingslashit( $_SERVER['DOCUMENT_ROOT'] );
|
173 |
$dir = '.well-known';
|
174 |
$file = 'apple-developer-merchantid-domain-association';
|
175 |
$fullpath = $path . '/' . $dir . '/' . $file;
|
176 |
|
177 |
-
|
178 |
-
|
|
|
|
|
179 |
}
|
180 |
|
181 |
if ( ! file_exists( $path . '/' . $dir ) ) {
|
182 |
if ( ! @mkdir( $path . '/' . $dir, 0755 ) ) { // @codingStandardsIgnoreLine
|
183 |
-
|
|
|
184 |
}
|
185 |
}
|
186 |
|
187 |
-
if ( !
|
188 |
-
|
189 |
-
|
190 |
-
}
|
191 |
}
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
// At this point then the domain association folder and file should be available.
|
194 |
// Proceed to verify/and or verify again.
|
195 |
$this->register_apple_pay_domain( $this->secret_key );
|
60 |
public $apple_pay_verify_notice;
|
61 |
|
62 |
public function __construct() {
|
63 |
+
add_action( 'woocommerce_stripe_updated', array( $this, 'update_verification_file' ) );
|
64 |
+
|
65 |
$this->stripe_settings = get_option( 'woocommerce_stripe_settings', array() );
|
66 |
$this->stripe_enabled = $this->get_option( 'enabled' );
|
67 |
$this->payment_request = 'yes' === $this->get_option( 'payment_request', 'yes' );
|
164 |
}
|
165 |
|
166 |
/**
|
167 |
+
* Updates the Apple Pay domain verification file.
|
168 |
*
|
169 |
+
* @param bool $force True to create the file if it didn't exist, false for just updating the file if needed.
|
170 |
+
*
|
171 |
+
* @version 4.3.0
|
172 |
+
* @since 4.3.0
|
173 |
+
* @return bool True on success, false on failure.
|
174 |
*/
|
175 |
+
public function update_verification_file( $force = false ) {
|
|
|
176 |
$path = untrailingslashit( $_SERVER['DOCUMENT_ROOT'] );
|
177 |
$dir = '.well-known';
|
178 |
$file = 'apple-developer-merchantid-domain-association';
|
179 |
$fullpath = $path . '/' . $dir . '/' . $file;
|
180 |
|
181 |
+
$existing_contents = @file_get_contents( $fullpath );
|
182 |
+
$new_contents = @file_get_contents( WC_STRIPE_PLUGIN_PATH . '/' . $file );
|
183 |
+
if ( ( ! $existing_contents && ! $force ) || $existing_contents === $new_contents ) {
|
184 |
+
return true;
|
185 |
}
|
186 |
|
187 |
if ( ! file_exists( $path . '/' . $dir ) ) {
|
188 |
if ( ! @mkdir( $path . '/' . $dir, 0755 ) ) { // @codingStandardsIgnoreLine
|
189 |
+
WC_Stripe_Logger::log( 'Error: ' . __( 'Unable to create domain association folder to domain root.', 'woocommerce-gateway-stripe' ) );
|
190 |
+
return false;
|
191 |
}
|
192 |
}
|
193 |
|
194 |
+
if ( ! @copy( WC_STRIPE_PLUGIN_PATH . '/' . $file, $fullpath ) ) { // @codingStandardsIgnoreLine
|
195 |
+
WC_Stripe_Logger::log( 'Error: ' . __( 'Unable to copy domain association file to domain root.', 'woocommerce-gateway-stripe' ) );
|
196 |
+
return false;
|
|
|
197 |
}
|
198 |
|
199 |
+
WC_Stripe_Logger::log( 'Domain association file updated.' );
|
200 |
+
return true;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Processes the Apple Pay domain verification.
|
205 |
+
*
|
206 |
+
* @since 3.1.0
|
207 |
+
* @version 3.1.0
|
208 |
+
*/
|
209 |
+
public function process_apple_pay_verification() {
|
210 |
+
if ( ! $this->update_verification_file( true ) ) {
|
211 |
+
$this->stripe_settings['apple_pay_domain_set'] = 'no';
|
212 |
+
update_option( 'woocommerce_stripe_settings', $this->stripe_settings );
|
213 |
+
return;
|
214 |
+
}
|
215 |
+
|
216 |
+
try {
|
217 |
// At this point then the domain association folder and file should be available.
|
218 |
// Proceed to verify/and or verify again.
|
219 |
$this->register_apple_pay_domain( $this->secret_key );
|
includes/class-wc-stripe-customer.php
CHANGED
@@ -94,11 +94,12 @@ class WC_Stripe_Customer {
|
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
-
*
|
98 |
-
*
|
99 |
-
* @
|
|
|
100 |
*/
|
101 |
-
|
102 |
$billing_email = isset( $_POST['billing_email'] ) ? filter_var( $_POST['billing_email'], FILTER_SANITIZE_EMAIL ) : '';
|
103 |
$user = $this->get_user();
|
104 |
|
@@ -136,11 +137,19 @@ class WC_Stripe_Customer {
|
|
136 |
);
|
137 |
}
|
138 |
|
139 |
-
$metadata
|
140 |
-
|
141 |
$defaults['metadata'] = apply_filters( 'wc_stripe_customer_metadata', $metadata, $user );
|
142 |
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
$response = WC_Stripe_API::request( apply_filters( 'wc_stripe_create_customer_args', $args ), 'customers' );
|
145 |
|
146 |
if ( ! empty( $response->error ) ) {
|
@@ -160,6 +169,30 @@ class WC_Stripe_Customer {
|
|
160 |
return $response->id;
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/**
|
164 |
* Checks to see if error is of invalid request
|
165 |
* error and it is no such customer.
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
+
* Generates the customer request, used for both creating and updating customers.
|
98 |
+
*
|
99 |
+
* @param array $args Additional arguments (optional).
|
100 |
+
* @return array
|
101 |
*/
|
102 |
+
protected function generate_customer_request( $args = array() ) {
|
103 |
$billing_email = isset( $_POST['billing_email'] ) ? filter_var( $_POST['billing_email'], FILTER_SANITIZE_EMAIL ) : '';
|
104 |
$user = $this->get_user();
|
105 |
|
137 |
);
|
138 |
}
|
139 |
|
140 |
+
$metadata = array();
|
|
|
141 |
$defaults['metadata'] = apply_filters( 'wc_stripe_customer_metadata', $metadata, $user );
|
142 |
|
143 |
+
return wp_parse_args( $args, $defaults );
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Create a customer via API.
|
148 |
+
* @param array $args
|
149 |
+
* @return WP_Error|int
|
150 |
+
*/
|
151 |
+
public function create_customer( $args = array() ) {
|
152 |
+
$args = $this->generate_customer_request( $args );
|
153 |
$response = WC_Stripe_API::request( apply_filters( 'wc_stripe_create_customer_args', $args ), 'customers' );
|
154 |
|
155 |
if ( ! empty( $response->error ) ) {
|
169 |
return $response->id;
|
170 |
}
|
171 |
|
172 |
+
/**
|
173 |
+
* Updates the Stripe customer through the API.
|
174 |
+
*
|
175 |
+
* @param array $args Additional arguments for the request (optional).
|
176 |
+
*/
|
177 |
+
public function update_customer( $args = array() ) {
|
178 |
+
if ( empty( $this->id ) ) {
|
179 |
+
throw new WC_Stripe_Exception( 'id_required_to_update_user', __( 'Attempting to update a Stripe customer without a customer ID.', 'woocommerce-gateway-stripe' ) );
|
180 |
+
}
|
181 |
+
|
182 |
+
$args = $this->generate_customer_request( $args );
|
183 |
+
$args = apply_filters( 'wc_stripe_update_customer_args', $args );
|
184 |
+
$response = WC_Stripe_API::request( $args, 'customers/' . $this->id );
|
185 |
+
|
186 |
+
if ( ! empty( $response->error ) ) {
|
187 |
+
throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
|
188 |
+
}
|
189 |
+
|
190 |
+
$this->clear_cache();
|
191 |
+
$this->set_customer_data( $response );
|
192 |
+
|
193 |
+
do_action( 'woocommerce_stripe_update_customer', $args, $response );
|
194 |
+
}
|
195 |
+
|
196 |
/**
|
197 |
* Checks to see if error is of invalid request
|
198 |
* error and it is no such customer.
|
includes/class-wc-stripe-order-handler.php
CHANGED
@@ -69,7 +69,7 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
|
|
69 |
return;
|
70 |
}
|
71 |
|
72 |
-
if (
|
73 |
return;
|
74 |
}
|
75 |
|
69 |
return;
|
70 |
}
|
71 |
|
72 |
+
if ( $order->has_status( array( 'processing', 'completed', 'on-hold' ) ) ) {
|
73 |
return;
|
74 |
}
|
75 |
|
includes/class-wc-stripe-webhook-handler.php
CHANGED
@@ -172,11 +172,11 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
172 |
$is_pending_receiver = ( 'receiver' === $notification->data->object->flow );
|
173 |
|
174 |
try {
|
175 |
-
if (
|
176 |
return;
|
177 |
}
|
178 |
|
179 |
-
if ( 'on-hold'
|
180 |
return;
|
181 |
}
|
182 |
|
@@ -382,7 +382,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
382 |
|
383 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
384 |
|
385 |
-
if ( 'on-hold'
|
386 |
return;
|
387 |
}
|
388 |
|
@@ -421,7 +421,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
421 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
422 |
|
423 |
// If order status is already in failed status don't continue.
|
424 |
-
if ( 'failed'
|
425 |
return;
|
426 |
}
|
427 |
|
@@ -457,7 +457,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
457 |
return;
|
458 |
}
|
459 |
|
460 |
-
if (
|
461 |
$order->update_status( 'cancelled', __( 'This payment has cancelled.', 'woocommerce-gateway-stripe' ) );
|
462 |
}
|
463 |
|
@@ -587,7 +587,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
587 |
/* translators: 1) The reason type. */
|
588 |
$message = sprintf( __( 'The opened review for this order is now closed. Reason: (%s)', 'woocommerce-gateway-stripe' ), $notification->data->object->reason );
|
589 |
|
590 |
-
if ( 'on-hold'
|
591 |
if ( apply_filters( 'wc_stripe_webhook_review_change_order_status', true, $order, $notification ) ) {
|
592 |
$order->update_status( 'processing', $message );
|
593 |
} else {
|
@@ -660,7 +660,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
660 |
return;
|
661 |
}
|
662 |
|
663 |
-
if (
|
664 |
return;
|
665 |
}
|
666 |
|
@@ -701,7 +701,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
|
|
701 |
return;
|
702 |
}
|
703 |
|
704 |
-
if (
|
705 |
return;
|
706 |
}
|
707 |
|
172 |
$is_pending_receiver = ( 'receiver' === $notification->data->object->flow );
|
173 |
|
174 |
try {
|
175 |
+
if ( $order->has_status( array( 'processing', 'completed' ) ) ) {
|
176 |
return;
|
177 |
}
|
178 |
|
179 |
+
if ( $order->has_status( 'on-hold' ) && ! $is_pending_receiver ) {
|
180 |
return;
|
181 |
}
|
182 |
|
382 |
|
383 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
384 |
|
385 |
+
if ( ! $order->has_status( 'on-hold' ) ) {
|
386 |
return;
|
387 |
}
|
388 |
|
421 |
$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
|
422 |
|
423 |
// If order status is already in failed status don't continue.
|
424 |
+
if ( $order->has_status( 'failed' ) ) {
|
425 |
return;
|
426 |
}
|
427 |
|
457 |
return;
|
458 |
}
|
459 |
|
460 |
+
if ( ! $order->has_status( 'cancelled' ) ) {
|
461 |
$order->update_status( 'cancelled', __( 'This payment has cancelled.', 'woocommerce-gateway-stripe' ) );
|
462 |
}
|
463 |
|
587 |
/* translators: 1) The reason type. */
|
588 |
$message = sprintf( __( 'The opened review for this order is now closed. Reason: (%s)', 'woocommerce-gateway-stripe' ), $notification->data->object->reason );
|
589 |
|
590 |
+
if ( $order->has_status( 'on-hold' ) ) {
|
591 |
if ( apply_filters( 'wc_stripe_webhook_review_change_order_status', true, $order, $notification ) ) {
|
592 |
$order->update_status( 'processing', $message );
|
593 |
} else {
|
660 |
return;
|
661 |
}
|
662 |
|
663 |
+
if ( ! $order->has_status( array( 'pending', 'failed' ) ) ) {
|
664 |
return;
|
665 |
}
|
666 |
|
701 |
return;
|
702 |
}
|
703 |
|
704 |
+
if ( ! $order->has_status( array( 'pending', 'failed' ) ) ) {
|
705 |
return;
|
706 |
}
|
707 |
|
includes/compat/class-wc-stripe-sepa-subs-compat.php
CHANGED
@@ -74,18 +74,21 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
|
|
74 |
* @since 4.1.11
|
75 |
*/
|
76 |
public function display_update_subs_payment_checkout() {
|
|
|
77 |
if (
|
78 |
apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
|
79 |
-
wcs_user_has_subscription( get_current_user_id(), '',
|
80 |
is_add_payment_method_page()
|
81 |
) {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
89 |
);
|
90 |
}
|
91 |
}
|
@@ -100,10 +103,11 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
|
|
100 |
public function handle_add_payment_method_success( $source_id, $source_object ) {
|
101 |
if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
|
102 |
$all_subs = wcs_get_users_subscriptions();
|
|
|
103 |
|
104 |
if ( ! empty( $all_subs ) ) {
|
105 |
foreach ( $all_subs as $sub ) {
|
106 |
-
if (
|
107 |
update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
|
108 |
update_post_meta( $sub->get_id(), '_payment_method', $this->id );
|
109 |
update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
|
74 |
* @since 4.1.11
|
75 |
*/
|
76 |
public function display_update_subs_payment_checkout() {
|
77 |
+
$subs_statuses = apply_filters( 'wc_stripe_update_subs_payment_method_card_statuses', array( 'active' ) );
|
78 |
if (
|
79 |
apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
|
80 |
+
wcs_user_has_subscription( get_current_user_id(), '', $subs_statuses ) &&
|
81 |
is_add_payment_method_page()
|
82 |
) {
|
83 |
+
$label = esc_html( apply_filters( 'wc_stripe_save_to_subs_text', __( 'Update the Payment Method used for all of my active subscriptions.', 'woocommerce-gateway-stripe' ) ) );
|
84 |
+
$id = sprintf( 'wc-%1$s-update-subs-payment-method-card', $this->id );
|
85 |
+
woocommerce_form_field(
|
86 |
+
$id,
|
87 |
+
array(
|
88 |
+
'type' => 'checkbox',
|
89 |
+
'label' => $label,
|
90 |
+
'default' => apply_filters( 'wc_stripe_save_to_subs_checked', false ),
|
91 |
+
)
|
92 |
);
|
93 |
}
|
94 |
}
|
103 |
public function handle_add_payment_method_success( $source_id, $source_object ) {
|
104 |
if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
|
105 |
$all_subs = wcs_get_users_subscriptions();
|
106 |
+
$subs_statuses = apply_filters( 'wc_stripe_update_subs_payment_method_card_statuses', array( 'active' ) );
|
107 |
|
108 |
if ( ! empty( $all_subs ) ) {
|
109 |
foreach ( $all_subs as $sub ) {
|
110 |
+
if ( $sub->has_status( $subs_statuses ) ) {
|
111 |
update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
|
112 |
update_post_meta( $sub->get_id(), '_payment_method', $this->id );
|
113 |
update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
|
includes/compat/class-wc-stripe-subs-compat.php
CHANGED
@@ -83,18 +83,21 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
|
|
83 |
* @since 4.1.11
|
84 |
*/
|
85 |
public function display_update_subs_payment_checkout() {
|
|
|
86 |
if (
|
87 |
apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
|
88 |
-
wcs_user_has_subscription( get_current_user_id(), '',
|
89 |
is_add_payment_method_page()
|
90 |
) {
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
98 |
);
|
99 |
}
|
100 |
}
|
@@ -109,10 +112,11 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
|
|
109 |
public function handle_add_payment_method_success( $source_id, $source_object ) {
|
110 |
if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
|
111 |
$all_subs = wcs_get_users_subscriptions();
|
|
|
112 |
|
113 |
if ( ! empty( $all_subs ) ) {
|
114 |
foreach ( $all_subs as $sub ) {
|
115 |
-
if (
|
116 |
update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
|
117 |
update_post_meta( $sub->get_id(), '_payment_method', $this->id );
|
118 |
update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
|
@@ -247,8 +251,9 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
|
|
247 |
$prepared_source->source = '';
|
248 |
}
|
249 |
|
250 |
-
$
|
251 |
|
|
|
252 |
$is_authentication_required = $this->is_authentication_required_for_payment( $response );
|
253 |
|
254 |
// It's only a failed payment if it's an error and it's not of the type 'authentication_required'.
|
@@ -310,6 +315,8 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
|
|
310 |
|
311 |
$this->process_response( end( $response->charges->data ), $renewal_order );
|
312 |
}
|
|
|
|
|
313 |
} catch ( WC_Stripe_Exception $e ) {
|
314 |
WC_Stripe_Logger::log( 'Error: ' . $e->getMessage() );
|
315 |
|
83 |
* @since 4.1.11
|
84 |
*/
|
85 |
public function display_update_subs_payment_checkout() {
|
86 |
+
$subs_statuses = apply_filters( 'wc_stripe_update_subs_payment_method_card_statuses', array( 'active' ) );
|
87 |
if (
|
88 |
apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
|
89 |
+
wcs_user_has_subscription( get_current_user_id(), '', $subs_statuses ) &&
|
90 |
is_add_payment_method_page()
|
91 |
) {
|
92 |
+
$label = esc_html( apply_filters( 'wc_stripe_save_to_subs_text', __( 'Update the Payment Method used for all of my active subscriptions.', 'woocommerce-gateway-stripe' ) ) );
|
93 |
+
$id = sprintf( 'wc-%1$s-update-subs-payment-method-card', $this->id );
|
94 |
+
woocommerce_form_field(
|
95 |
+
$id,
|
96 |
+
array(
|
97 |
+
'type' => 'checkbox',
|
98 |
+
'label' => $label,
|
99 |
+
'default' => apply_filters( 'wc_stripe_save_to_subs_checked', false ),
|
100 |
+
)
|
101 |
);
|
102 |
}
|
103 |
}
|
112 |
public function handle_add_payment_method_success( $source_id, $source_object ) {
|
113 |
if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
|
114 |
$all_subs = wcs_get_users_subscriptions();
|
115 |
+
$subs_statuses = apply_filters( 'wc_stripe_update_subs_payment_method_card_statuses', array( 'active' ) );
|
116 |
|
117 |
if ( ! empty( $all_subs ) ) {
|
118 |
foreach ( $all_subs as $sub ) {
|
119 |
+
if ( $sub->has_status( $subs_statuses ) ) {
|
120 |
update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
|
121 |
update_post_meta( $sub->get_id(), '_payment_method', $this->id );
|
122 |
update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
|
251 |
$prepared_source->source = '';
|
252 |
}
|
253 |
|
254 |
+
$this->lock_order_payment( $renewal_order );
|
255 |
|
256 |
+
$response = $this->create_and_confirm_intent_for_off_session( $renewal_order, $prepared_source, $amount );
|
257 |
$is_authentication_required = $this->is_authentication_required_for_payment( $response );
|
258 |
|
259 |
// It's only a failed payment if it's an error and it's not of the type 'authentication_required'.
|
315 |
|
316 |
$this->process_response( end( $response->charges->data ), $renewal_order );
|
317 |
}
|
318 |
+
|
319 |
+
$this->unlock_order_payment( $renewal_order );
|
320 |
} catch ( WC_Stripe_Exception $e ) {
|
321 |
WC_Stripe_Logger::log( 'Error: ' . $e->getMessage() );
|
322 |
|
includes/payment-methods/class-wc-stripe-payment-request.php
CHANGED
@@ -917,14 +917,15 @@ class WC_Stripe_Payment_Request {
|
|
917 |
|
918 |
WC()->shipping->reset_shipping();
|
919 |
|
920 |
-
$product_id
|
921 |
-
$qty
|
922 |
-
$product
|
|
|
923 |
|
924 |
// First empty the cart to prevent wrong calculation.
|
925 |
WC()->cart->empty_cart();
|
926 |
|
927 |
-
if ( 'variable' ===
|
928 |
$attributes = array_map( 'wc_clean', $_POST['attributes'] );
|
929 |
|
930 |
if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
|
@@ -937,7 +938,7 @@ class WC_Stripe_Payment_Request {
|
|
937 |
WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes );
|
938 |
}
|
939 |
|
940 |
-
if ( 'simple' ===
|
941 |
WC()->cart->add_to_cart( $product->get_id(), $qty );
|
942 |
}
|
943 |
|
917 |
|
918 |
WC()->shipping->reset_shipping();
|
919 |
|
920 |
+
$product_id = absint( $_POST['product_id'] );
|
921 |
+
$qty = ! isset( $_POST['qty'] ) ? 1 : absint( $_POST['qty'] );
|
922 |
+
$product = wc_get_product( $product_id );
|
923 |
+
$product_type = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type();
|
924 |
|
925 |
// First empty the cart to prevent wrong calculation.
|
926 |
WC()->cart->empty_cart();
|
927 |
|
928 |
+
if ( ( 'variable' === $product_type || 'variable-subscription' === $product_type ) && isset( $_POST['attributes'] ) ) {
|
929 |
$attributes = array_map( 'wc_clean', $_POST['attributes'] );
|
930 |
|
931 |
if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
|
938 |
WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes );
|
939 |
}
|
940 |
|
941 |
+
if ( 'simple' === $product_type || 'subscription' === $product_type ) {
|
942 |
WC()->cart->add_to_cart( $product->get_id(), $qty );
|
943 |
}
|
944 |
|
languages/woocommerce-gateway-stripe.pot
CHANGED
@@ -3,8 +3,9 @@
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: WooCommerce Stripe Gateway 4.3.0\n"
|
6 |
-
"Report-Msgid-Bugs-To:
|
7 |
-
"
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -74,20 +75,20 @@ msgid ""
|
|
74 |
"cancel to remove the pre-authorization."
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:
|
78 |
msgid "Invalid payment method. Please input a new card number."
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:
|
82 |
#. translators: 1) dollar amount 2) transaction id 3) refund message
|
83 |
msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:
|
87 |
msgid "Pre-Authorization Released"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:
|
91 |
msgid "There was a problem adding the payment method."
|
92 |
msgstr ""
|
93 |
|
@@ -210,8 +211,8 @@ msgstr ""
|
|
210 |
|
211 |
#: includes/admin/class-wc-stripe-privacy.php:41
|
212 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:463
|
213 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
214 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
215 |
msgid "N/A"
|
216 |
msgstr ""
|
217 |
|
@@ -828,37 +829,37 @@ msgstr ""
|
|
828 |
msgid "Billing First Name and Last Name are required."
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: includes/class-wc-gateway-stripe.php:
|
832 |
#. translators: error message
|
833 |
msgid "This represents the fee Stripe collects for the transaction."
|
834 |
msgstr ""
|
835 |
|
836 |
-
#: includes/class-wc-gateway-stripe.php:
|
837 |
msgid "Stripe Fee:"
|
838 |
msgstr ""
|
839 |
|
840 |
-
#: includes/class-wc-gateway-stripe.php:
|
841 |
msgid ""
|
842 |
"This represents the net total that will be credited to your Stripe bank "
|
843 |
"account. This may be in the currency that is set in your Stripe account."
|
844 |
msgstr ""
|
845 |
|
846 |
-
#: includes/class-wc-gateway-stripe.php:
|
847 |
msgid "Stripe Payout:"
|
848 |
msgstr ""
|
849 |
|
850 |
-
#: includes/class-wc-gateway-stripe.php:
|
851 |
#: includes/class-wc-stripe-order-handler.php:162
|
852 |
#: includes/class-wc-stripe-webhook-handler.php:238
|
853 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:263
|
854 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
855 |
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:373
|
856 |
msgid ""
|
857 |
"Sorry, we are unable to process your payment at this time. Please retry "
|
858 |
"later."
|
859 |
msgstr ""
|
860 |
|
861 |
-
#: includes/class-wc-gateway-stripe.php:
|
862 |
msgid ""
|
863 |
"Almost there!\n"
|
864 |
"\n"
|
@@ -866,57 +867,61 @@ msgid ""
|
|
866 |
"done is for you to authorize the payment with your bank."
|
867 |
msgstr ""
|
868 |
|
869 |
-
#: includes/class-wc-gateway-stripe.php:
|
870 |
#: includes/class-wc-stripe-webhook-handler.php:685
|
871 |
#: includes/class-wc-stripe-webhook-handler.php:724
|
872 |
#. translators: 1) The error message that was received from Stripe.
|
873 |
msgid "Stripe SCA authentication failed. Reason: %s"
|
874 |
msgstr ""
|
875 |
|
876 |
-
#: includes/class-wc-gateway-stripe.php:
|
877 |
msgid "Stripe SCA authentication failed."
|
878 |
msgstr ""
|
879 |
|
880 |
-
#: includes/class-wc-stripe-api.php:
|
881 |
msgid "There was a problem connecting to the Stripe API endpoint."
|
882 |
msgstr ""
|
883 |
|
884 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
885 |
msgid "Unable to verify domain - missing secret key."
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
889 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
890 |
#. translators: error message
|
891 |
msgid "Unable to verify domain - %s"
|
892 |
msgstr ""
|
893 |
|
894 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
895 |
msgid "Unable to create domain association folder to domain root."
|
896 |
msgstr ""
|
897 |
|
898 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
899 |
msgid "Unable to copy domain association file to domain root."
|
900 |
msgstr ""
|
901 |
|
902 |
-
#: includes/class-wc-stripe-apple-pay-registration.php:
|
903 |
#. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
|
904 |
msgid ""
|
905 |
"Apple Pay domain verification failed. Please check the %1$slog%2$s to see "
|
906 |
"the issue. (Logging must be enabled to see recorded logs)"
|
907 |
msgstr ""
|
908 |
|
909 |
-
#: includes/class-wc-stripe-customer.php:
|
910 |
#. translators: %1$s First name, %2$s Second name, %3$s Username.
|
911 |
msgid "Name: %1$s %2$s, Username: %s"
|
912 |
msgstr ""
|
913 |
|
914 |
-
#: includes/class-wc-stripe-customer.php:
|
915 |
#. translators: %1$s First name, %2$s Second name.
|
916 |
msgid "Name: %1$s %2$s, Guest"
|
917 |
msgstr ""
|
918 |
|
919 |
-
#: includes/class-wc-stripe-customer.php:
|
|
|
|
|
|
|
|
|
920 |
msgid "Unable to add payment source."
|
921 |
msgstr ""
|
922 |
|
@@ -1150,8 +1155,8 @@ msgid "Unable to store payment details. Please try again."
|
|
1150 |
msgstr ""
|
1151 |
|
1152 |
#: includes/compat/class-wc-stripe-pre-orders-compat.php:121
|
1153 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1154 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1155 |
msgid "Stripe charge awaiting authentication by user: %s."
|
1156 |
msgstr ""
|
1157 |
|
@@ -1173,20 +1178,20 @@ msgid "Customer not found"
|
|
1173 |
msgstr ""
|
1174 |
|
1175 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:386
|
1176 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1177 |
#. translators: error message
|
1178 |
msgid "A \"Stripe Customer ID\" value is required."
|
1179 |
msgstr ""
|
1180 |
|
1181 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:388
|
1182 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1183 |
msgid ""
|
1184 |
"Invalid customer ID. A valid \"Stripe Customer ID\" must begin with "
|
1185 |
"\"cus_\"."
|
1186 |
msgstr ""
|
1187 |
|
1188 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:397
|
1189 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1190 |
msgid ""
|
1191 |
"Invalid source ID. A valid source \"Stripe Source ID\" must begin with "
|
1192 |
"\"src_\" or \"card_\"."
|
@@ -1197,11 +1202,11 @@ msgstr ""
|
|
1197 |
msgid "Via SEPA Direct Debit ending in %1$s"
|
1198 |
msgstr ""
|
1199 |
|
1200 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1201 |
msgid "This transaction requires authentication."
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: includes/compat/class-wc-stripe-subs-compat.php:
|
1205 |
#. translators: 1) card brand 2) last 4 digits
|
1206 |
msgid "Via %1$s card ending in %2$s"
|
1207 |
msgstr ""
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: WooCommerce Stripe Gateway 4.3.0\n"
|
6 |
+
"Report-Msgid-Bugs-To: "
|
7 |
+
"https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
|
8 |
+
"POT-Creation-Date: 2019-11-12 11:30:47+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
75 |
"cancel to remove the pre-authorization."
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:619
|
79 |
msgid "Invalid payment method. Please input a new card number."
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:901
|
83 |
#. translators: 1) dollar amount 2) transaction id 3) refund message
|
84 |
msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:901
|
88 |
msgid "Pre-Authorization Released"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:919
|
92 |
msgid "There was a problem adding the payment method."
|
93 |
msgstr ""
|
94 |
|
211 |
|
212 |
#: includes/admin/class-wc-stripe-privacy.php:41
|
213 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:463
|
214 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:530
|
215 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:545
|
216 |
msgid "N/A"
|
217 |
msgstr ""
|
218 |
|
829 |
msgid "Billing First Name and Last Name are required."
|
830 |
msgstr ""
|
831 |
|
832 |
+
#: includes/class-wc-gateway-stripe.php:720
|
833 |
#. translators: error message
|
834 |
msgid "This represents the fee Stripe collects for the transaction."
|
835 |
msgstr ""
|
836 |
|
837 |
+
#: includes/class-wc-gateway-stripe.php:721
|
838 |
msgid "Stripe Fee:"
|
839 |
msgstr ""
|
840 |
|
841 |
+
#: includes/class-wc-gateway-stripe.php:757
|
842 |
msgid ""
|
843 |
"This represents the net total that will be credited to your Stripe bank "
|
844 |
"account. This may be in the currency that is set in your Stripe account."
|
845 |
msgstr ""
|
846 |
|
847 |
+
#: includes/class-wc-gateway-stripe.php:758
|
848 |
msgid "Stripe Payout:"
|
849 |
msgstr ""
|
850 |
|
851 |
+
#: includes/class-wc-gateway-stripe.php:805
|
852 |
#: includes/class-wc-stripe-order-handler.php:162
|
853 |
#: includes/class-wc-stripe-webhook-handler.php:238
|
854 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:263
|
855 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:272
|
856 |
#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:373
|
857 |
msgid ""
|
858 |
"Sorry, we are unable to process your payment at this time. Please retry "
|
859 |
"later."
|
860 |
msgstr ""
|
861 |
|
862 |
+
#: includes/class-wc-gateway-stripe.php:858
|
863 |
msgid ""
|
864 |
"Almost there!\n"
|
865 |
"\n"
|
867 |
"done is for you to authorize the payment with your bank."
|
868 |
msgstr ""
|
869 |
|
870 |
+
#: includes/class-wc-gateway-stripe.php:1070
|
871 |
#: includes/class-wc-stripe-webhook-handler.php:685
|
872 |
#: includes/class-wc-stripe-webhook-handler.php:724
|
873 |
#. translators: 1) The error message that was received from Stripe.
|
874 |
msgid "Stripe SCA authentication failed. Reason: %s"
|
875 |
msgstr ""
|
876 |
|
877 |
+
#: includes/class-wc-gateway-stripe.php:1071
|
878 |
msgid "Stripe SCA authentication failed."
|
879 |
msgstr ""
|
880 |
|
881 |
+
#: includes/class-wc-stripe-api.php:140 includes/class-wc-stripe-api.php:174
|
882 |
msgid "There was a problem connecting to the Stripe API endpoint."
|
883 |
msgstr ""
|
884 |
|
885 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:129
|
886 |
msgid "Unable to verify domain - missing secret key."
|
887 |
msgstr ""
|
888 |
|
889 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:153
|
890 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:162
|
891 |
#. translators: error message
|
892 |
msgid "Unable to verify domain - %s"
|
893 |
msgstr ""
|
894 |
|
895 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:189
|
896 |
msgid "Unable to create domain association folder to domain root."
|
897 |
msgstr ""
|
898 |
|
899 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:195
|
900 |
msgid "Unable to copy domain association file to domain root."
|
901 |
msgstr ""
|
902 |
|
903 |
+
#: includes/class-wc-stripe-apple-pay-registration.php:270
|
904 |
#. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
|
905 |
msgid ""
|
906 |
"Apple Pay domain verification failed. Please check the %1$slog%2$s to see "
|
907 |
"the issue. (Logging must be enabled to see recorded logs)"
|
908 |
msgstr ""
|
909 |
|
910 |
+
#: includes/class-wc-stripe-customer.php:121
|
911 |
#. translators: %1$s First name, %2$s Second name, %3$s Username.
|
912 |
msgid "Name: %1$s %2$s, Username: %s"
|
913 |
msgstr ""
|
914 |
|
915 |
+
#: includes/class-wc-stripe-customer.php:132
|
916 |
#. translators: %1$s First name, %2$s Second name.
|
917 |
msgid "Name: %1$s %2$s, Guest"
|
918 |
msgstr ""
|
919 |
|
920 |
+
#: includes/class-wc-stripe-customer.php:179
|
921 |
+
msgid "Attempting to update a Stripe customer without a customer ID."
|
922 |
+
msgstr ""
|
923 |
+
|
924 |
+
#: includes/class-wc-stripe-customer.php:242
|
925 |
msgid "Unable to add payment source."
|
926 |
msgstr ""
|
927 |
|
1155 |
msgstr ""
|
1156 |
|
1157 |
#: includes/compat/class-wc-stripe-pre-orders-compat.php:121
|
1158 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:304
|
1159 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:609
|
1160 |
msgid "Stripe charge awaiting authentication by user: %s."
|
1161 |
msgstr ""
|
1162 |
|
1178 |
msgstr ""
|
1179 |
|
1180 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:386
|
1181 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:453
|
1182 |
#. translators: error message
|
1183 |
msgid "A \"Stripe Customer ID\" value is required."
|
1184 |
msgstr ""
|
1185 |
|
1186 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:388
|
1187 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:455
|
1188 |
msgid ""
|
1189 |
"Invalid customer ID. A valid \"Stripe Customer ID\" must begin with "
|
1190 |
"\"cus_\"."
|
1191 |
msgstr ""
|
1192 |
|
1193 |
#: includes/compat/class-wc-stripe-sepa-subs-compat.php:397
|
1194 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:464
|
1195 |
msgid ""
|
1196 |
"Invalid source ID. A valid source \"Stripe Source ID\" must begin with "
|
1197 |
"\"src_\" or \"card_\"."
|
1202 |
msgid "Via SEPA Direct Debit ending in %1$s"
|
1203 |
msgstr ""
|
1204 |
|
1205 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:296
|
1206 |
msgid "This transaction requires authentication."
|
1207 |
msgstr ""
|
1208 |
|
1209 |
+
#: includes/compat/class-wc-stripe-subs-compat.php:545
|
1210 |
#. translators: 1) card brand 2) last 4 digits
|
1211 |
msgid "Via %1$s card ending in %2$s"
|
1212 |
msgstr ""
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: automattic, royho, akeda, mattyza, bor0, woothemes
|
3 |
Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort, bancontact, alipay, giropay, ideal, p24, woocommerce, automattic
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 4.3.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
Attributions: thorsten-stripe
|
@@ -113,6 +113,15 @@ If you get stuck, you can ask for help in the Plugin Forum.
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= 4.3.0 2019-10-17 =
|
117 |
* Add - For WooCommerce Subscriptions optimize the payment flow for subsequent subscription payments when authentication may be required by using the `setup_future_usage` parameter for the first subscription payment
|
118 |
* Add - Allow customer to authenticate payment even if they are not charged right away for WooCommerce Subscriptions and Pre-Orders, for example for a WooCommerce Subscription that has a free trial
|
@@ -123,9 +132,6 @@ If you get stuck, you can ask for help in the Plugin Forum.
|
|
123 |
* Fix - Avoid idempotency key errors for Pre-Orders
|
124 |
* Fix - Use unique anchor for link about checkout styling changes
|
125 |
|
126 |
-
= 4.2.5 - 2019-10-02 =
|
127 |
-
* Fix - WooCommerce Subscriptions that use only the Stripe customer ID can again be renewed
|
128 |
-
|
129 |
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
|
130 |
|
131 |
== Upgrade Notice ==
|
2 |
Contributors: automattic, royho, akeda, mattyza, bor0, woothemes
|
3 |
Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort, bancontact, alipay, giropay, ideal, p24, woocommerce, automattic
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 5.3.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 4.3.1
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
Attributions: thorsten-stripe
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 4.3.1 2019-11-12 =
|
117 |
+
* Fix - Overwrite the previous Apple Pay verification file if it has changed.
|
118 |
+
* Fix - Avoid re-mounting card elements if they are already mounted in the DOM.
|
119 |
+
* Fix - Compatibility with WooCommerce Deposits by retrieving order statuses in a different way.
|
120 |
+
* Fix - Duplicate payment notifications for subscriptions.
|
121 |
+
* Fix - Use the same customer after a new credit card has been entered.
|
122 |
+
* Fix - Google Pay buttons on subscriptions.
|
123 |
+
* Add - A filter, which allows all subscriptions' payment methods to be overwritten when adding a new payment method.
|
124 |
+
|
125 |
= 4.3.0 2019-10-17 =
|
126 |
* Add - For WooCommerce Subscriptions optimize the payment flow for subsequent subscription payments when authentication may be required by using the `setup_future_usage` parameter for the first subscription payment
|
127 |
* Add - Allow customer to authenticate payment even if they are not charged right away for WooCommerce Subscriptions and Pre-Orders, for example for a WooCommerce Subscription that has a free trial
|
132 |
* Fix - Avoid idempotency key errors for Pre-Orders
|
133 |
* Fix - Use unique anchor for link about checkout styling changes
|
134 |
|
|
|
|
|
|
|
135 |
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/master/changelog.txt).
|
136 |
|
137 |
== Upgrade Notice ==
|
woocommerce-gateway-stripe.php
CHANGED
@@ -5,11 +5,11 @@
|
|
5 |
* Description: Take credit card payments on your store using Stripe.
|
6 |
* Author: WooCommerce
|
7 |
* Author URI: https://woocommerce.com/
|
8 |
-
* Version: 4.3.
|
9 |
* Requires at least: 4.4
|
10 |
-
* Tested up to: 5.
|
11 |
* WC requires at least: 2.6
|
12 |
-
* WC tested up to: 3.
|
13 |
* Text Domain: woocommerce-gateway-stripe
|
14 |
* Domain Path: /languages
|
15 |
*
|
@@ -46,7 +46,7 @@ function woocommerce_gateway_stripe_init() {
|
|
46 |
/**
|
47 |
* Required minimums and constants
|
48 |
*/
|
49 |
-
define( 'WC_STRIPE_VERSION', '4.3.
|
50 |
define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
|
51 |
define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
|
52 |
define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
|
5 |
* Description: Take credit card payments on your store using Stripe.
|
6 |
* Author: WooCommerce
|
7 |
* Author URI: https://woocommerce.com/
|
8 |
+
* Version: 4.3.1
|
9 |
* Requires at least: 4.4
|
10 |
+
* Tested up to: 5.3.0
|
11 |
* WC requires at least: 2.6
|
12 |
+
* WC tested up to: 3.8
|
13 |
* Text Domain: woocommerce-gateway-stripe
|
14 |
* Domain Path: /languages
|
15 |
*
|
46 |
/**
|
47 |
* Required minimums and constants
|
48 |
*/
|
49 |
+
define( 'WC_STRIPE_VERSION', '4.3.1' );
|
50 |
define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
|
51 |
define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
|
52 |
define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
|