diff --git a/assets/js/stripe.js b/assets/js/stripe.js index 5466a2836..8422796c0 100644 --- a/assets/js/stripe.js +++ b/assets/js/stripe.js @@ -129,11 +129,16 @@ jQuery( function( $ ) { wc_stripe_form.mountElements(); - iban.mount( '#stripe-iban-element' ); + if ( $( '#stripe-iban-element' ).length ) { + iban.mount( '#stripe-iban-element' ); + } } ); } else if ( $( 'form#add_payment_method' ).length || $( 'form#order_review' ).length ) { wc_stripe_form.mountElements(); - iban.mount( '#stripe-iban-element' ); + + if ( $( '#stripe-iban-element' ).length ) { + iban.mount( '#stripe-iban-element' ); + } } }, diff --git a/assets/js/stripe.min.js b/assets/js/stripe.min.js index 5a775105f..e32c735d9 100644 --- a/assets/js/stripe.min.js +++ b/assets/js/stripe.min.js @@ -1 +1 @@ -jQuery(function(e){"use strict";var r,t,o,n=Stripe(wc_stripe_params.key),s=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},a=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},i=n.elements(s),c=i.create("iban",a),p={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?r.unmount("#stripe-card-element"):(r.unmount("#stripe-card-element"),t.unmount("#stripe-exp-element"),o.unmount("#stripe-cvc-element"))},mountElements:function(){e("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?r.mount("#stripe-card-element"):(r.mount("#stripe-card-element"),t.mount("#stripe-exp-element"),o.mount("#stripe-cvc-element")))},createElements:function(){var n={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},s={focus:"focused",empty:"empty",invalid:"invalid"};n=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:n,s=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:s,"yes"===wc_stripe_params.inline_cc_form?(r=i.create("card",{style:n,hidePostalCode:!0})).addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}):(r=i.create("cardNumber",{style:n,classes:s}),t=i.create("cardExpiry",{style:n,classes:s}),o=i.create("cardCvc",{style:n,classes:s}),r.addEventListener("change",function(r){p.onCCFormChange(),p.updateCardBrand(r.brand),r.error&&e(document.body).trigger("stripeError",r)}),t.addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),o.addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)})),"yes"===wc_stripe_params.is_checkout?e(document.body).on("updated_checkout",function(){r&&p.unmountElements(),p.mountElements(),c.mount("#stripe-iban-element")}):(e("form#add_payment_method").length||e("form#order_review").length)&&(p.mountElements(),c.mount("#stripe-iban-element"))},updateCardBrand:function(r){var t={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"},o=e(".stripe-card-brand"),n="stripe-credit-card-brand";r in t&&(n=t[r]),e.each(t,function(e,r){o.removeClass(r)}),o.addClass(n)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||e(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,e("form.woocommerce-checkout").length&&(this.form=e("form.woocommerce-checkout")),e("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),e("form#order_review").length&&(this.form=e("form#order_review")),e("form#order_review, form#add_payment_method").on("submit",this.onSubmit),e("form#add_payment_method").length&&(this.form=e("form#add_payment_method")),e("form.woocommerce-checkout").on("change",this.reset),e(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),p.createElements(),"yes"===wc_stripe_params.is_stripe_checkout&&e(document.body).on("click",".wc-stripe-checkout-button",function(){return p.openModal(),!1})},isStripeChosen:function(){return e("#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")||e("#payment_method_stripe").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return e("#payment_method_stripe").is(":checked")&&e('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&e('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return e("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return e("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return e("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return e("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return e("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return e("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return e("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return e("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return e("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return e("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0=o.owner.phone.length)&&delete o.owner.phone,(void 0===o.owner.email||0>=o.owner.email.length)&&(e("#stripe-payment-data").data("email").length?o.owner.email=e("#stripe-payment-data").data("email"):delete o.owner.email),(void 0===o.owner.name||0>=o.owner.name.length)&&delete o.owner.name,e("#billing_address_1").length>0?(o.owner.address.line1=e("#billing_address_1").val(),o.owner.address.line2=e("#billing_address_2").val(),o.owner.address.state=e("#billing_state").val(),o.owner.address.city=e("#billing_city").val(),o.owner.address.postal_code=e("#billing_postcode").val(),o.owner.address.country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(o.owner.address.line1=wc_stripe_params.billing_address_1,o.owner.address.line2=wc_stripe_params.billing_address_2,o.owner.address.state=wc_stripe_params.billing_state,o.owner.address.city=wc_stripe_params.billing_city,o.owner.address.postal_code=wc_stripe_params.billing_postcode,o.owner.address.country=wc_stripe_params.billing_country),o},createSource:function(){var t=p.getOwnerDetails(),o="card";if(p.isBancontactChosen()&&(o="bancontact"),p.isSepaChosen()&&(o="sepa_debit"),p.isIdealChosen()&&(o="ideal"),p.isSofortChosen()&&(o="sofort"),p.isGiropayChosen()&&(o="giropay"),p.isAlipayChosen()&&(o="alipay"),"card"===o)n.createSource(r,t).then(p.sourceResponse);else{switch(o){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":t.amount=e("#stripe-"+o+"-payment-data").data("amount"),t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(t.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(o){case"sepa_debit":t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":t.ideal={bank:e("#stripe-ideal-bank").val()};break;case"alipay":t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.amount=e("#stripe-"+o+"-payment-data").data("amount");break;case"sofort":t.sofort={country:e("#billing_country").val()}}t.type=o,"sepa_debit"===o?n.createSource(c,t).then(p.sourceResponse):n.createSource(t).then(p.sourceResponse)}},sourceResponse:function(r){r.error?e(document.body).trigger("stripeError",r):"no"===wc_stripe_params.allow_prepaid_card&&"card"===r.source.type&&"prepaid"===r.source.card.funding?(r.error={message:wc_stripe_params.no_prepaid_card_msg},"yes"===wc_stripe_params.is_stripe_checkout?p.submitError('"):e(document.body).trigger("stripeError",r)):p.processStripeResponse(r.source)},processStripeResponse:function(r){p.reset(),p.form.append(""),e("form#add_payment_method").length&&e(p.form).off("submit",p.form.onSubmit),p.form.submit()},onSubmit:function(r){if(p.isStripeChosen()){if(!(p.isStripeSaveCardChosen()||p.hasSource()||p.hasToken())){if(r.preventDefault(),p.block(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen())return"yes"===wc_stripe_params.is_checkout||(p.openModal(),!1);if(p.isBancontactChosen()||p.isGiropayChosen()||p.isIdealChosen()||p.isAlipayChosen()||p.isSofortChosen()||p.isP24Chosen()||p.isEpsChosen()||p.isMultibancoChosen()){if(e("form#order_review").length)return e("form#order_review").off("submit",this.onSubmit),p.form.submit(),!1;if(e("form.woocommerce-checkout").length)return!0;if(e("form#add_payment_method").length)return e("form#add_payment_method").off("submit",this.onSubmit),p.form.submit(),!1}return p.createSource(),!1}return e("form#add_payment_method").length?(r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen()?(p.openModal(),!1):(p.block(),p.createSource(),!1)):void 0}},onCCFormChange:function(){p.reset()},reset:function(){e(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(p.stripe_submit=!1)},onSepaError:function(r){var t=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");r.error?(console.log(r.error.message),e(t).html('")):e(t).html("")},onError:function(r,t){var o=t.error.message,n=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(p.isSepaChosen()&&"invalid_owner_name"===t.error.code&&wc_stripe_params.hasOwnProperty(t.error.code)){var s='";return p.submitError(s)}"invalid_request_error"!==t.error.type&&"api_connection_error"!==t.error.type&&"api_error"!==t.error.type&&"authentication_error"!==t.error.type&&"rate_limit_error"!==t.error.type||(o=wc_stripe_params.invalid_request_error),"card_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(o=wc_stripe_params[t.error.code]),"validation_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(o=wc_stripe_params[t.error.code]),p.reset(),e(".woocommerce-NoticeGroup-checkout").remove(),console.log(t.error.message),e(n).html('"),e(".wc-stripe-error").length&&e("html, body").animate({scrollTop:e(".wc-stripe-error").offset().top-200},200),p.unblock()},submitError:function(r){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),p.form.prepend('
'+r+"
"),p.form.removeClass("processing").unblock(),p.form.find(".input-text, select, input:checkbox").blur();var t="";e("#add_payment_method").length&&(t=e("#add_payment_method")),e("#order_review").length&&(t=e("#order_review")),e("form.checkout").length&&(t=e("form.checkout")),t.length&&e("html, body").animate({scrollTop:t.offset().top-100},500),e(document.body).trigger("checkout_error"),p.unblock()}};p.init()}); \ No newline at end of file +jQuery(function(e){"use strict";var r,t,o,n=Stripe(wc_stripe_params.key),s=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},a=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},i=n.elements(s),c=i.create("iban",a),p={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?r.unmount("#stripe-card-element"):(r.unmount("#stripe-card-element"),t.unmount("#stripe-exp-element"),o.unmount("#stripe-cvc-element"))},mountElements:function(){e("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?r.mount("#stripe-card-element"):(r.mount("#stripe-card-element"),t.mount("#stripe-exp-element"),o.mount("#stripe-cvc-element")))},createElements:function(){var n={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},s={focus:"focused",empty:"empty",invalid:"invalid"};n=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:n,s=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:s,"yes"===wc_stripe_params.inline_cc_form?(r=i.create("card",{style:n,hidePostalCode:!0})).addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}):(r=i.create("cardNumber",{style:n,classes:s}),t=i.create("cardExpiry",{style:n,classes:s}),o=i.create("cardCvc",{style:n,classes:s}),r.addEventListener("change",function(r){p.onCCFormChange(),p.updateCardBrand(r.brand),r.error&&e(document.body).trigger("stripeError",r)}),t.addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),o.addEventListener("change",function(r){p.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)})),"yes"===wc_stripe_params.is_checkout?e(document.body).on("updated_checkout",function(){r&&p.unmountElements(),p.mountElements(),e("#stripe-iban-element").length&&c.mount("#stripe-iban-element")}):(e("form#add_payment_method").length||e("form#order_review").length)&&(p.mountElements(),e("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(r){var t={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"},o=e(".stripe-card-brand"),n="stripe-credit-card-brand";r in t&&(n=t[r]),e.each(t,function(e,r){o.removeClass(r)}),o.addClass(n)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||e(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,e("form.woocommerce-checkout").length&&(this.form=e("form.woocommerce-checkout")),e("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),e("form#order_review").length&&(this.form=e("form#order_review")),e("form#order_review, form#add_payment_method").on("submit",this.onSubmit),e("form#add_payment_method").length&&(this.form=e("form#add_payment_method")),e("form.woocommerce-checkout").on("change",this.reset),e(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),p.createElements(),"yes"===wc_stripe_params.is_stripe_checkout&&e(document.body).on("click",".wc-stripe-checkout-button",function(){return p.openModal(),!1})},isStripeChosen:function(){return e("#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")||e("#payment_method_stripe").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return e("#payment_method_stripe").is(":checked")&&e('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&e('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return e("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return e("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return e("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return e("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return e("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return e("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return e("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return e("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return e("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return e("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0=o.owner.phone.length)&&delete o.owner.phone,(void 0===o.owner.email||0>=o.owner.email.length)&&(e("#stripe-payment-data").data("email").length?o.owner.email=e("#stripe-payment-data").data("email"):delete o.owner.email),(void 0===o.owner.name||0>=o.owner.name.length)&&delete o.owner.name,e("#billing_address_1").length>0?(o.owner.address.line1=e("#billing_address_1").val(),o.owner.address.line2=e("#billing_address_2").val(),o.owner.address.state=e("#billing_state").val(),o.owner.address.city=e("#billing_city").val(),o.owner.address.postal_code=e("#billing_postcode").val(),o.owner.address.country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(o.owner.address.line1=wc_stripe_params.billing_address_1,o.owner.address.line2=wc_stripe_params.billing_address_2,o.owner.address.state=wc_stripe_params.billing_state,o.owner.address.city=wc_stripe_params.billing_city,o.owner.address.postal_code=wc_stripe_params.billing_postcode,o.owner.address.country=wc_stripe_params.billing_country),o},createSource:function(){var t=p.getOwnerDetails(),o="card";if(p.isBancontactChosen()&&(o="bancontact"),p.isSepaChosen()&&(o="sepa_debit"),p.isIdealChosen()&&(o="ideal"),p.isSofortChosen()&&(o="sofort"),p.isGiropayChosen()&&(o="giropay"),p.isAlipayChosen()&&(o="alipay"),"card"===o)n.createSource(r,t).then(p.sourceResponse);else{switch(o){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":t.amount=e("#stripe-"+o+"-payment-data").data("amount"),t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(t.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(o){case"sepa_debit":t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":t.ideal={bank:e("#stripe-ideal-bank").val()};break;case"alipay":t.currency=e("#stripe-"+o+"-payment-data").data("currency"),t.amount=e("#stripe-"+o+"-payment-data").data("amount");break;case"sofort":t.sofort={country:e("#billing_country").val()}}t.type=o,"sepa_debit"===o?n.createSource(c,t).then(p.sourceResponse):n.createSource(t).then(p.sourceResponse)}},sourceResponse:function(r){r.error?e(document.body).trigger("stripeError",r):"no"===wc_stripe_params.allow_prepaid_card&&"card"===r.source.type&&"prepaid"===r.source.card.funding?(r.error={message:wc_stripe_params.no_prepaid_card_msg},"yes"===wc_stripe_params.is_stripe_checkout?p.submitError('"):e(document.body).trigger("stripeError",r)):p.processStripeResponse(r.source)},processStripeResponse:function(r){p.reset(),p.form.append(""),e("form#add_payment_method").length&&e(p.form).off("submit",p.form.onSubmit),p.form.submit()},onSubmit:function(r){if(p.isStripeChosen()){if(!(p.isStripeSaveCardChosen()||p.hasSource()||p.hasToken())){if(r.preventDefault(),p.block(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen())return"yes"===wc_stripe_params.is_checkout||(p.openModal(),!1);if(p.isBancontactChosen()||p.isGiropayChosen()||p.isIdealChosen()||p.isAlipayChosen()||p.isSofortChosen()||p.isP24Chosen()||p.isEpsChosen()||p.isMultibancoChosen()){if(e("form#order_review").length)return e("form#order_review").off("submit",this.onSubmit),p.form.submit(),!1;if(e("form.woocommerce-checkout").length)return!0;if(e("form#add_payment_method").length)return e("form#add_payment_method").off("submit",this.onSubmit),p.form.submit(),!1}return p.createSource(),!1}return e("form#add_payment_method").length?(r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen()?(p.openModal(),!1):(p.block(),p.createSource(),!1)):void 0}},onCCFormChange:function(){p.reset()},reset:function(){e(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(p.stripe_submit=!1)},onSepaError:function(r){var t=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");r.error?(console.log(r.error.message),e(t).html('")):e(t).html("")},onError:function(r,t){var o=t.error.message,n=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(p.isSepaChosen()&&"invalid_owner_name"===t.error.code&&wc_stripe_params.hasOwnProperty(t.error.code)){var s='";return p.submitError(s)}"invalid_request_error"!==t.error.type&&"api_connection_error"!==t.error.type&&"api_error"!==t.error.type&&"authentication_error"!==t.error.type&&"rate_limit_error"!==t.error.type||(o=wc_stripe_params.invalid_request_error),"card_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(o=wc_stripe_params[t.error.code]),"validation_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(o=wc_stripe_params[t.error.code]),p.reset(),e(".woocommerce-NoticeGroup-checkout").remove(),console.log(t.error.message),e(n).html('"),e(".wc-stripe-error").length&&e("html, body").animate({scrollTop:e(".wc-stripe-error").offset().top-200},200),p.unblock()},submitError:function(r){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),p.form.prepend('
'+r+"
"),p.form.removeClass("processing").unblock(),p.form.find(".input-text, select, input:checkbox").blur();var t="";e("#add_payment_method").length&&(t=e("#add_payment_method")),e("#order_review").length&&(t=e("#order_review")),e("form.checkout").length&&(t=e("form.checkout")),t.length&&e("html, body").animate({scrollTop:t.offset().top-100},500),e(document.body).trigger("checkout_error"),p.unblock()}};p.init()}); \ No newline at end of file diff --git a/languages/woocommerce-gateway-stripe.pot b/languages/woocommerce-gateway-stripe.pot index b3490a8f3..71409931b 100644 --- a/languages/woocommerce-gateway-stripe.pot +++ b/languages/woocommerce-gateway-stripe.pot @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: WooCommerce Stripe Gateway 4.1.9\n" "Report-Msgid-Bugs-To: " "https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n" -"POT-Creation-Date: 2018-08-27 16:21:18+00:00\n" +"POT-Creation-Date: 2018-08-27 21:24:41+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n"