PluginProbe ʕ •ᴥ•ʔ
WooCommerce Square / 5.4.3
WooCommerce Square v5.4.3
5.4.3 5.4.2 5.4.1 5.4.0 trunk 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.7.0 2.8.0 2.9.0 2.9.1 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.2.0 3.3.0 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.7.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 4.0.0 4.1.0 4.2.0 4.2.1 4.2.2 4.2.3 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.4.2 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 4.9.8 4.9.9 5.0.0 5.0.1 5.1.0 5.1.1 5.1.2 5.2.0 5.3.0 5.3.1 5.3.2 5.3.3
woocommerce-square / build / assets / admin / wc-square-payment-gateway-token-editor.js
woocommerce-square / build / assets / admin Last commit date
wc-square-admin-products-styles.asset.php 1 year ago wc-square-admin-products-styles.css 1 year ago wc-square-admin-products-styles.js 1 year ago wc-square-admin-products.asset.php 7 months ago wc-square-admin-products.js 7 months ago wc-square-admin-settings.asset.php 1 year ago wc-square-admin-settings.js 1 year ago wc-square-admin.asset.php 3 months ago wc-square-admin.css 3 months ago wc-square-admin.js 2 years ago wc-square-payment-gateway-admin-order.asset.php 1 year ago wc-square-payment-gateway-admin-order.css 2 years ago wc-square-payment-gateway-admin-order.js 1 year ago wc-square-payment-gateway-token-editor.asset.php 1 year ago wc-square-payment-gateway-token-editor.css 2 years ago wc-square-payment-gateway-token-editor.js 1 year ago
wc-square-payment-gateway-token-editor.js
1 lines
1 (()=>{"use strict";(function(){jQuery(document).ready(function(t){let e,n,a;return a=null!=(n=window.wc_payment_gateway_token_editor)?n:{},t(".sv_wc_payment_gateway_token_editor").each(function(){let e;return e=t(this).find("tr.token"),0===e.length?t(this).find("tr.no-tokens").show():t(this).find("tr.no-tokens").hide()}),t(".sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="remove"]',function(n){let o,r,s;if(n.preventDefault(),confirm(a.actions.remove_token.ays))return r=t(this).closest("table"),r.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),r.find(".error").remove(),s=t(this).closest("tr"),s.hasClass("new-token")?s.remove():(o={action:"wc_payment_gateway_"+r.data("gateway-id")+"_admin_remove_payment_token",user_id:t(this).data("user-id"),token_id:t(this).data("token-id"),payment_token_id:t(this).data("payment-token-id"),security:a.actions.remove_token.nonce},t.post(a.ajax_url,o).done(function(n){return n.success?(t(s).remove(),0===r.find("tr.token").length?r.find("tr.no-tokens").show():void 0):e(r,n.data)}).fail(function(t,n,a){return e(r,n+": "+a)}).always(function(){return r.unblock()}))}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="add-new"]',function(e){let n,o,r,s;return e.preventDefault(),s=t(this).closest("table"),s.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),n=s.find("tbody.tokens"),o=n.find("tr.token").length,r={action:"wc_payment_gateway_"+s.data("gateway-id")+"_admin_get_blank_payment_token",index:o+1,security:a.actions.add_token.nonce},t.post(a.ajax_url,r,function(t){return!0===t.success&&n.append(t.data),s.find("tr.no-tokens").hide(),s.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="refresh"]',function(n){let o,r,s,i;return n.preventDefault(),i=t(this).closest("table"),i.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),i.find(".error").remove(),o=i.find("tbody.tokens"),r=o.find("tr.token").length,s={action:"wc_payment_gateway_"+i.data("gateway-id")+"_admin_refresh_payment_tokens",user_id:t(this).data("user-id"),security:a.actions.refresh.nonce},t.post(a.ajax_url,s).done(function(t){return t.success?null!=t.data?(i.find("tr.no-tokens").hide(),o.html(t.data)):(o.empty(),i.find("tr.no-tokens").show()):e(i,t.data)}).fail(function(t,n,a){return e(i,n+": "+a)}).always(function(){return i.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.sv-wc-payment-gateway-token-editor-action-button[data-action="save"]',function(e){let n,o,r,s;return o=t(this).closest("table"),n=o.find("tfoot th"),o.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),n.find(".error, .success").remove(),s=o.find('tbody.tokens tr.token input[type="text"]'),r=!1,s.each(function(s){let i,c,d;if(t(this).removeClass("error"),d=t(this).val(),c=t(this).prop("required"),i=t(this).attr("pattern"),c||d)return!d.match(i)||c&&!d?(e.preventDefault(),t(this).addClass("error"),r||(n.prepend('<span class="error">'+a.actions.save.error+"</span>"),t(this).focus(),r=!0),o.unblock()):void 0})}),t("select#customer_user, select#_payment_method").change(function(){var e=t("select#customer_user").val();if("square_credit_card"===t("select#_payment_method").val()&&!isNaN(e)){var n={action:"woocommerce_subscription_get_user_id_and_token",user_id:e,security:a.actions.get_token.nonce};t.ajax({url:a.ajax_url,data:n,type:"POST",success:function(e){if(e.success){t(".order_data_column .edit_address").filter(":visible").trigger("click");var{customer_id:n,token:a}=e.data||{},o=t('[name="_payment_method_meta[square_credit_card][post_meta][_wc_square_credit_card_payment_token]"]'),r=t('[name="_payment_method_meta[square_credit_card][post_meta][_wc_square_credit_card_customer_id]"]');n&&r.val()!==n&&(r.val(n),o.val(a))}}})}}),e=function(t,e,n){return null==n&&(n=""),console.error(e),n||(n=a.i18n.general_error),t.find("th.actions").prepend('<span class="error">'+n+"</span>")}})}).call(void 0)})();