Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the media-library-organizer domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/clanmac2/public_html/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the s2member domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/clanmac2/public_html/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the unlimited-elements-for-elementor domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/clanmac2/public_html/wp-includes/functions.php on line 6121
(function(a){if(typeof a.sprintf!=="function"){a.sprintf=function(){var g=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;var h=arguments,f=0,k=h[f++];var b=function(o,i,l,n){if(!l){l=" "}var m=(o.length>=i)?"":Array(1+i-o.length>>>0).join(l);return n?o+m:m+o};var c=function(n,m,q,i,l,p){var o=i-n.length;if(o>0){if(q||!l){n=b(n,i,p,q)}else{n=n.slice(0,m.length)+b("",o,"0",true)+n.slice(m.length)}}return n};var j=function(q,p,o,r,l,i,n){var m=q>>>0;o=o&&m&&{"2":"0b","8":"0","16":"0x"}[p]||"";q=o+b(m.toString(p),i||0,"0",false);return c(q,o,r,l,n)};var e=function(n,p,l,i,m,o){if(i!=null){n=n.slice(0,i)}return c(n,"",p,l,m,o)};var d=function(A,n,o,s,C,x,m){var i;var w;var l;var B;var u;if(A=="%%"){return"%"}var t=false,p="",r=false,z=false,y=" ";var q=o.length;for(var v=0;o&&v-1?6:(m=="d")?0:undefined}else{if(x=="*"){x=+h[f++]}else{if(x.charAt(0)=="*"){x=+h[x.slice(1,-1)]}else{x=+x}}}u=n?h[n.slice(0,-1)]:h[f++];switch(m){case"s":return e(String(u),t,s,x,r,y);case"c":return e(String.fromCharCode(+u),t,s,x,r);case"b":return j(u,2,z,t,s,x,r);case"o":return j(u,8,z,t,s,x,r);case"x":return j(u,16,z,t,s,x,r);case"X":return j(u,16,z,t,s,x,r).toUpperCase();case"u":return j(u,10,z,t,s,x,r);case"i":case"d":i=(+u)|0;w=i<0?"-":p;u=w+b(String(Math.abs(i)),x,"0",false);return c(u,w,t,s,r);case"e":case"E":case"f":case"F":case"g":case"G":i=+u;w=i<0?"-":p;l=["toExponential","toFixed","toPrecision"]["efg".indexOf(m.toLowerCase())];B=["toString","toUpperCase"]["eEfFgG".indexOf(m)%2];u=w+Math.abs(i)[l](x);return c(u,w,t,s,r)[B]();default:return A}};return k.replace(g,d)}}})(jQuery); var S2MEMBER_CURRENT_USER_IS_LOGGED_IN = false,S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = false,S2MEMBER_CURRENT_USER_FIRST_NAME = '',S2MEMBER_CURRENT_USER_LAST_NAME = '',S2MEMBER_CURRENT_USER_LOGIN = '',S2MEMBER_CURRENT_USER_EMAIL = '',S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = 0,S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = false,S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = 0,S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = 0; jQuery(document).ready(function(d){window.ws_plugin__s2member_skip_all_file_confirmations=window.ws_plugin__s2member_skip_all_file_confirmations||false;var c='',a='s2member-files',b=ws_plugin__s2member_skip_all_file_confirmations?true:false,e=[];window.ws_plugin__s2member_passwordMinLength=function(){return parseInt("8")};window.ws_plugin__s2member_passwordMinStrengthCode=function(){return"good"};window.ws_plugin__s2member_passwordMinStrengthLabel=function(){return"`good` or `strong` (i.e., use numbers, letters, and mixed caSe)"};window.ws_plugin__s2member_passwordMinStrengthScore=function(){return parseInt("30")};window.ws_plugin__s2member_passwordStrengthMeter=function(j,g,i){var h=0,f=ws_plugin__s2member_passwordMinLength();j=String(j);g=String(g);if(j!=g&&g.length>0){return"mismatch"}else{if(j.length<1){return"empty"}else{if(j.length0);var i=new RegExp('^()@',"i");if(t==="input"&&o==="checkbox"&&/\[\]$/.test(f)){if(typeof q.id==="string"&&/-0$/.test(q.id)){if(m&&!d('input[name="'+ws_plugin__s2member_escjQAttr(f)+'"]:checked',g).length){return r+'\nPlease check at least one of the boxes.'}}}else{if(t==="input"&&o==="checkbox"){if(m&&!q.checked){return r+'\nRequired. This box must be checked.'}}else{if(t==="input"&&o==="radio"){if(typeof q.id==="string"&&/-0$/.test(q.id)){if(m&&!d('input[name="'+ws_plugin__s2member_escjQAttr(f)+'"]:checked',g).length){return r+'\nPlease select one of the options.'}}}else{if(t==="select"&&p.attr("multiple")){if(m&&(!(s instanceof Array)||!s.length)){return r+'\nPlease select at least one of the options.'}}else{if(typeof s!=="string"||(m&&!(s=d.trim(s)).length)){return r+'\nThis is a required field, please try again.'}else{if((s=d.trim(s)).length&&((t==="input"&&/^(text|password)$/i.test(o))||t==="textarea")&&typeof l==="string"&&l.length){if(l==="numeric-wp-commas"&&(!/^[0-9\.,]+$/.test(s)||isNaN(s.replace(/,/g,"")))){return r+'\nMust be numeric (with or without decimals, commas allowed).'}else{if(l==="numeric"&&(!/^[0-9\.]+$/.test(s)||isNaN(s))){return r+'\nMust be numeric (with or without decimals, no commas).'}else{if(l==="integer"&&(!/^[0-9]+$/.test(s)||isNaN(s))){return r+'\nMust be an integer (a whole number, without any decimals).'}else{if(l==="integer-gt-0"&&(!/^[0-9]+$/.test(s)||isNaN(s)||s<=0)){return r+'\nMust be an integer > 0 (whole number, no decimals, greater than 0).'}else{if(l==="float"&&(!/^[0-9\.]+$/.test(s)||!/[0-9]/.test(s)||!/\./.test(s)||isNaN(s))){return r+'\nMust be a float (floating point number, decimals required).'}else{if(l==="float-gt-0"&&(!/^[0-9\.]+$/.test(s)||!/[0-9]/.test(s)||!/\./.test(s)||isNaN(s)||s<=0)){return r+'\nMust be a float > 0 (floating point number, decimals required, greater than 0).'}else{if(l==="date"&&!/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/.test(s)){return r+'\nMust be a date (required date format: dd/mm/yyyy).'}else{if(l==="email"&&!/^[a-zA-Z0-9_!#$%&*+=?`{}~|\/\^\'\-]+(?:\.?[a-zA-Z0-9_!#$%&*+=?`{}~|\/\^\'\-]+)*@[a-zA-Z0-9]+(?:\-*[a-zA-Z0-9]+)*(?:\.[a-zA-Z0-9]+(?:\-*[a-zA-Z0-9]+)*)*(?:\.[a-zA-Z][a-zA-Z0-9]+)?$/.test(s)){return r+'\nMust be a valid email address.'}else{if(l==="email"&&k&&i.test(s)){return r+"\n"+d.sprintf('Please use a personal email address.\nAddresses like <%s@> are problematic.',s.split("@")[0])}else{if(l==="url"&&!/^https?\:\/\/.+$/i.test(s)){return r+'\nMust be a full URL (starting with http or https).'}else{if(l==="domain"&&!/^[a-zA-Z0-9]+(?:\-*[a-zA-Z0-9]+)*(?:\.[a-zA-Z0-9]+(?:\-*[a-zA-Z0-9]+)*)*(?:\.[a-zA-Z][a-zA-Z0-9]+)?$/.test(s)){return r+'\nMust be a domain name (domain name only, without http).'}else{if(l==="phone"&&(!/^[0-9 ()\-]+$/.test(s)||s.replace(/[^0-9]+/g,"").length!==10)){return r+'\nMust be a phone # (10 digits w/possible hyphens, spaces, brackets).'}else{if(l==="uszip"&&!/^[0-9]{5}(?:\-[0-9]{4})?$/.test(s)){return r+'\nMust be a US zipcode (5-9 digits w/ possible hyphen).'}else{if(l==="cazip"&&!/^[0-9A-Z]{3} ?[0-9A-Z]{3}$/i.test(s)){return r+'\nMust be a Canadian zipcode (6 alpha-numerics w/possible space).'}else{if(l==="uczip"&&!/^[0-9]{5}(?:\-[0-9]{4})?$/.test(s)&&!/^[0-9A-Z]{3} ?[0-9A-Z]{3}$/i.test(s)){return r+'\nMust be a zipcode (either a US or Canadian zipcode).'}else{if(/^alphanumerics\-spaces\-punctuation\-[0-9]+(?:\-e)?$/.test(l)&&!/^[a-z 0-9\/\\\\,.?:;"\'{}[\]\^|+=_()*&%$#@!`~\-]+$/i.test(s)){return r+'\nPlease use alphanumerics, spaces & punctuation only.'}else{if(/^alphanumerics\-spaces\-[0-9]+(?:\-e)?$/.test(l)&&!/^[a-z 0-9]+$/i.test(s)){return r+'\nPlease use alphanumerics & spaces only.'}else{if(/^alphanumerics\-punctuation\-[0-9]+(?:\-e)?$/.test(l)&&!/^[a-z0-9\/\\\\,.?:;"\'{}[\]\^|+=_()*&%$#@!`~\-]+$/i.test(s)){return r+'\nPlease use alphanumerics & punctuation only (no spaces).'}else{if(/^alphanumerics\-[0-9]+(?:\-e)?$/.test(l)&&!/^[a-z0-9]+$/i.test(s)){return r+'\nPlease use alphanumerics only (no spaces/punctuation).'}else{if(/^alphabetics\-[0-9]+(?:\-e)?$/.test(l)&&!/^[a-z]+$/i.test(s)){return r+'\nPlease use alphabetics only (no digits/spaces/punctuation).'}else{if(/^numerics\-[0-9]+(?:\-e)?$/.test(l)&&!/^[0-9]+$/i.test(s)){return r+'\nPlease use numeric digits only.'}else{if(/^(?:any|alphanumerics\-spaces\-punctuation|alphanumerics\-spaces|alphanumerics\-punctuation|alphanumerics|alphabetics|numerics)\-[0-9]+(?:\-e)?$/.test(l)){var n=l.split("-"),h=Number(n[1]),j=(n.length>2&&n[2]==="e");if(j&&s.length!==h){return r+"\n"+d.sprintf('Must be exactly %s %s.',h,((n[0]==="numerics")?((h===1)?'digit':'digits'):((h===1)?'character':'characters')))}else{if(s.length"']/.test(f=String(f))){f=f.replace(/&/g,"&").replace(//g,">"),f=f.replace(/"/g,""").replace(/'/g,"'")}return f};window.ws_plugin__s2member_escjQAttr=function(f){return String(f).replace(/([.:\[\]])/g,"\\$1")};if(!b&&S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY div.mu_register > form#setupform").submit(function(){var h=this,g="",f="",j="",i=d('p.submit input[type="submit"]',h);d("input#user_email",h).attr("data-expected","email");d("input#user_name, input#user_email, input#blogname, input#blog_title, input#captcha_code",h).attr({"aria-required":"true"});d(":input",h).each(function(){var k=d.trim(d(this).attr("id")).replace(/---[0-9]+$/g,"");if(k&&(g=d.trim(d('label[for="'+k+'"]',h).first().text().replace(/[\r\n\t]+/g," ")))){if(f=ws_plugin__s2member_validationErrors(g,this,h)){j+=f+"\n\n"}}});if(j=d.trim(j)){alert('— Oops, you missed something: —\n\n'+j);return false}ws_plugin__s2member_animateProcessing(i);return true})}if(/\/wp-login\.php/i.test(location.href)){d("div#login > form#registerform input#user_login").attr("tabindex","10");d("div#login > form#registerform input#user_email").attr("tabindex","20");d("div#login > form#registerform input#wp-submit").attr("tabindex","1000");d("input#ws-plugin--s2member-custom-reg-field-user-pass1, input#ws-plugin--s2member-custom-reg-field-user-pass2").on("keyup initialize.s2",function(){ws_plugin__s2member_passwordStrength(d("input#user_login"),d("input#ws-plugin--s2member-custom-reg-field-user-pass1"),d("input#ws-plugin--s2member-custom-reg-field-user-pass2"),d("div#ws-plugin--s2member-custom-reg-field-user-pass-strength"))}).trigger("initialize.s2");d("div#login > form#registerform").submit(function(){var h=this,g="",f="",l="",k=d('input#ws-plugin--s2member-custom-reg-field-user-pass1[aria-required="true"]',h),i=d("input#ws-plugin--s2member-custom-reg-field-user-pass2",h),j=d("input#wp-submit",h);d("input#user_email",h).attr("data-expected","email");d("input#user_login, input#user_email, input#captcha_code",h).attr({"aria-required":"true"});d(":input",h).each(function(){var m=d.trim(d(this).attr("id")).replace(/---[0-9]+$/g,"");if(d.inArray(m,["user_login","user_email","captcha_code"])!==-1){if((g=d.trim(d(this).parent("label").text().replace(/[\r\n\t]+/g," ")))){if(f=ws_plugin__s2member_validationErrors(g,this,h)){l+=f+"\n\n"}}}else{if(m&&(g=d.trim(d('label[for="'+m+'"]',h).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(f=ws_plugin__s2member_validationErrors(g,this,h)){l+=f+"\n\n"}}}});if(l=d.trim(l)){alert('— Oops, you missed something: —\n\n'+l);return false}else{if(k.length&&d.trim(k.val())!==d.trim(i.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(k.length&&d.trim(k.val()).length1||A("form.s2member-pro-paypal-checkout-form").length>1||A("form.s2member-pro-paypal-sp-checkout-form").length>1){return alert("Detected more than one s2Member Pro-Form.\n\nPlease use only ONE s2Member Pro-Form Shortcode on each Post/Page. Attempting to serve more than one Pro-Form on each Post/Page (even w/ DHTML) may result in unexpected/broken functionality.")}if((e=A("form#s2member-pro-paypal-cancellation-form")).length===1){var O="div#s2member-pro-paypal-cancellation-form-captcha-section",o="div#s2member-pro-paypal-cancellation-form-submission-section",w=A(o+" button#s2member-pro-paypal-cancellation-submit");ws_plugin__s2member_animateProcessing(w,"reset"),w.removeAttr("disabled");e.submit(function(){var U=this,S="",R="",V="";var T=A(O+" input#recaptcha_response_field, "+O+" #g-recaptcha-response");A(":input",U).each(function(){var W=A.trim(A(this).attr("id")).replace(/---[0-9]+$/g,"");if(W&&(S=A.trim(A('label[for="'+W+'"]',U).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(R=ws_plugin__s2member_validationErrors(S,this,U)){V+=R+"\n\n"}}});if(V=A.trim(V)){alert('— Oops, you missed something: —\n\n'+V);return false}else{if(T.length&&!T.val()){alert('— Oops, you missed something: —\n\nSecurity Verification missing. Please try again.');return false}}w.attr(B),ws_plugin__s2member_animateProcessing(w);return true})}else{if((r=A("form#s2member-pro-paypal-update-form")).length===1){var u,v="div#s2member-pro-paypal-update-form-billing-method-section",I="div#s2member-pro-paypal-update-form-billing-address-section",m=v+' input[name="s2member_pro_paypal_update[card_type]"]',O="div#s2member-pro-paypal-update-form-captcha-section",o="div#s2member-pro-paypal-update-form-submission-section",w=A(o+" button#s2member-pro-paypal-update-submit");ws_plugin__s2member_animateProcessing(w,"reset"),w.removeAttr("disabled");(u=function(R){var S=A(m+":checked").val();if(A.inArray(S,["Visa","MasterCard","Amex","Discover"])!==-1){A(v+" > div.s2member-pro-paypal-update-form-div").show();A(v+" > div.s2member-pro-paypal-update-form-div :input").attr(x);A(v+" > div#s2member-pro-paypal-update-form-card-start-date-issue-number-div").hide();A(v+" > div#s2member-pro-paypal-update-form-card-start-date-issue-number-div :input").attr(b);A(I+" > div.s2member-pro-paypal-update-form-div").show();A(I+" > div.s2member-pro-paypal-update-form-div :input").attr(x);A(I).show(),(R)?A(v+" input#s2member-pro-paypal-update-card-number").focus():null}else{if(A.inArray(S,["Maestro","Solo"])!==-1){A(v+" > div.s2member-pro-paypal-update-form-div").show();A(v+" > div.s2member-pro-paypal-update-form-div :input").attr(x);A(I+" > div.s2member-pro-paypal-update-form-div").show();A(I+" > div.s2member-pro-paypal-update-form-div :input").attr(x);A(I).show(),(R)?A(v+" input#s2member-pro-paypal-update-card-number").focus():null}else{if(!S){A(v+" > div.s2member-pro-paypal-update-form-div").hide();A(v+" > div.s2member-pro-paypal-update-form-div :input").attr(b);A(v+" > div#s2member-pro-paypal-update-form-card-type-div").show();A(v+" > div#s2member-pro-paypal-update-form-card-type-div :input").attr(x);A(I+" > div.s2member-pro-paypal-update-form-div").hide();A(I+" > div.s2member-pro-paypal-update-form-div :input").attr(b);A(I).hide(),(R)?A(o+" button#s2member-pro-paypal-update-submit").focus():null}}}})();A(m).click(u).change(u);r.submit(function(){var U=this,S="",R="",V="";var T=A(O+" input#recaptcha_response_field, "+O+" #g-recaptcha-response");if(!A(m+":checked").val()){alert('Please choose a Billing Method.');return false}A(":input",U).each(function(){var W=A.trim(A(this).attr("id")).replace(/---[0-9]+$/g,"");if(W&&(S=A.trim(A('label[for="'+W.replace(/-(month|year)/,"")+'"]',U).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(R=ws_plugin__s2member_validationErrors(S,this,U)){V+=R+"\n\n"}}});if(V=A.trim(V)){alert('— Oops, you missed something: —\n\n'+V);return false}else{if(T.length&&!T.val()){alert('— Oops, you missed something: —\n\nSecurity Verification missing. Please try again.');return false}}w.attr(B),ws_plugin__s2member_animateProcessing(w);return true})}else{if((k=A("form#s2member-pro-paypal-registration-form")).length===1){var j,M,s,a="div#s2member-pro-paypal-registration-form-options-section",G="div#s2member-pro-paypal-registration-form-description-section",N="div#s2member-pro-paypal-registration-form-registration-section",O="div#s2member-pro-paypal-registration-form-captcha-section",o="div#s2member-pro-paypal-registration-form-submission-section",l=o+" input#s2member-pro-paypal-registration-nonce",w=A(o+" button#s2member-pro-paypal-registration-submit");ws_plugin__s2member_animateProcessing(w,"reset"),w.removeAttr("disabled");(j=function(R){if(!A(a+" select#s2member-pro-paypal-registration-options option").length){A(a).hide();A(G).show()}else{A(a).show();A(G).hide();A(a+" select#s2member-pro-paypal-registration-options").change(function(){A(l).val("option");k.attr("action",k.attr("action").replace(/#.*$/,"")+"#s2p-form");k.submit()})}})();(M=function(R){if(A(o+" input#s2member-pro-paypal-registration-names-not-required-or-not-possible").length){A(N+" > div#s2member-pro-paypal-registration-form-first-name-div").hide();A(N+" > div#s2member-pro-paypal-registration-form-first-name-div :input").attr(i);A(N+" > div#s2member-pro-paypal-registration-form-last-name-div").hide();A(N+" > div#s2member-pro-paypal-registration-form-last-name-div :input").attr(i)}})();(s=function(R){if(A(o+" input#s2member-pro-paypal-registration-password-not-required-or-not-possible").length){A(N+" > div#s2member-pro-paypal-registration-form-password-div").hide();A(N+" > div#s2member-pro-paypal-registration-form-password-div :input").attr(i)}})();A(N+" > div#s2member-pro-paypal-registration-form-password-div :input").on("keyup initialize.s2",function(){ws_plugin__s2member_passwordStrength(A(N+" input#s2member-pro-paypal-registration-username"),A(N+" input#s2member-pro-paypal-registration-password1"),A(N+" input#s2member-pro-paypal-registration-password2"),A(N+" div#s2member-pro-paypal-registration-form-password-strength"))}).trigger("initialize.s2");k.submit(function(){if(A.inArray(A(l).val(),["option"])===-1){var U=this,S="",R="",X="";var T=A(O+" input#recaptcha_response_field, "+O+" #g-recaptcha-response");var W=A(N+' input#s2member-pro-paypal-registration-password1[aria-required="true"]');var V=A(N+" input#s2member-pro-paypal-registration-password2");A(":input",U).each(function(){var Y=A.trim(A(this).attr("id")).replace(/---[0-9]+$/g,"");if(Y&&(S=A.trim(A('label[for="'+Y+'"]',U).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(R=ws_plugin__s2member_validationErrors(S,this,U)){X+=R+"\n\n"}}});if(X=A.trim(X)){alert('— Oops, you missed something: —\n\n'+X);return false}else{if(W.length&&A.trim(W.val())!==A.trim(V.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(W.length&&A.trim(W.val()).length div#s2member-pro-paypal-sp-checkout-form-ajax-tax-div"),O="div#s2member-pro-paypal-sp-checkout-form-captcha-section",o="div#s2member-pro-paypal-sp-checkout-form-submission-section",l=o+" input#s2member-pro-paypal-sp-checkout-nonce",d=o+" #s2member-pro-paypal-sp-checkout-submit";var C=A.trim(A("input#s2member-pro-paypal-lang-attr").val());var g='';var h='';ws_plugin__s2member_animateProcessing(A(d),"reset"),A(d).removeAttr("disabled"),A(P).removeAttr("disabled");(j=function(R){if(!A(a+" select#s2member-pro-paypal-sp-checkout-options option").length){A(a).hide();A(G).show()}else{A(a).show();A(G).hide();A(a+" select#s2member-pro-paypal-sp-checkout-options").change(function(){A(l).val("option");n.attr("action",n.attr("action").replace(/#.*$/,"")+"#s2p-form");n.submit()})}})();(F=function(R){if(A(o+" input#s2member-pro-paypal-sp-checkout-coupons-not-required-or-not-possible").length){A(H).hide()}else{A(H).show()}})();(K=function(R){if(A(o+" input#s2member-pro-paypal-sp-checkout-tax-not-required-or-not-possible").length){y.hide(),t=false}})();(J=function(S){if(t&&!(S&&S.interval&&document.activeElement.id==="s2member-pro-paypal-sp-checkout-country")){var R=A(o+" input#s2member-pro-paypal-sp-checkout-attr").val();var V=A.trim(A(I+" input#s2member-pro-paypal-sp-checkout-state").val());var W=A(I+" select#s2member-pro-paypal-sp-checkout-country").val();var U=A.trim(A(I+" input#s2member-pro-paypal-sp-checkout-zip").val());var T=V+"|"+W+"|"+U;if(V&&W&&U&&T&&(!c||c!==T)&&(c=T)){(D)?D.abort():null,clearTimeout(f),f=null;y.html('
Calculating Sales Tax... calculating sales tax...
');f=setTimeout(function(){D=A.post('https://clanmacneilusa.us/wp-admin/admin-ajax.php',{action:"ws_plugin__s2member_pro_paypal_ajax_tax",ws_plugin__s2member_pro_paypal_ajax_tax:'ZGVmNTAyMDAxZjQ1MTMxMzQxZDA5MDE1Njk4YWE5Zjc3MDlhODEyYWQzODcxYzVlNzAxYTE5YzAzNGMwZjYwM2I4NjgxNDgyZDg1NGY2YmIwNzhmMzRkODIyNGU2MmY1NDAyYzkzNmUyYzcwOGFkNjA1NTBiODkxZDMxMjk1NjFlZDU3ZTQxYzRiYTE1OGNlZmIwNDYyZmJlYTFkYjhiM2Y1NTQ3ZmZkOGMwNzNiYjVjMDU1OTJkOWJkYTMyNDdiZWFhZGY5NTUzY2FlMWM3NWMwODUyYmVhNWU4MDBiY2E3YjVjMGMxOWNlMzI3ODNkMGVlNGFj',"ws_plugin__s2member_pro_paypal_ajax_tax_vars[attr]":R,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[state]":V,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[country]":W,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[zip]":U},function(X){clearTimeout(f),f=null;try{y.html("
"+A.sprintf('Sales Tax%s: %s
— Total%s: %s',((X.trial)?' Today':""),((X.tax_per)?""+X.tax_per+" ( "+X.cur_symbol+""+X.tax+" )":X.cur_symbol+""+X.tax),((X.trial)?' Today':""),X.cur_symbol+""+X.total)+"
")}catch(Y){}},"json")},((S&&S.keyCode)?1000:100))}else{if(!V||!W||!U||!T){y.html(""),c=null}}}})();p=function(R){setTimeout(function(){J(R)},10)};A(I+" input#s2member-pro-paypal-sp-checkout-state").bind("keyup blur",J).bind("cut paste",p);A(I+" input#s2member-pro-paypal-sp-checkout-zip").bind("keyup blur",J).bind("cut paste",p);A(I+" select#s2member-pro-paypal-sp-checkout-country").bind("change",J);setInterval(function(){J({interval:true})},1000);(E=function(R){if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN){A(N+" input#s2member-pro-paypal-sp-checkout-first-name").each(function(){var S=A(this),T=S.val();(!T)?S.val(S2MEMBER_CURRENT_USER_FIRST_NAME):null});A(N+" input#s2member-pro-paypal-sp-checkout-last-name").each(function(){var S=A(this),T=S.val();(!T)?S.val(S2MEMBER_CURRENT_USER_LAST_NAME):null});A(N+" input#s2member-pro-paypal-sp-checkout-email").each(function(){var S=A(this),T=S.val();(!T)?S.val(S2MEMBER_CURRENT_USER_EMAIL):null})}})();(u=function(R){if(A(o+" input#s2member-pro-paypal-sp-checkout-payment-not-required-or-not-possible").length){A(m).val(["Free"])}var S=A(m+":checked").val();if(A.inArray(S,["Free"])!==-1){A(v).hide(),A(I).hide();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(b);A(I+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();A(I+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(b);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-sp-checkout-submit").replaceWith(g);(R)?A(o+" #s2member-pro-paypal-sp-checkout-submit").focus():null}else{if(A.inArray(S,["Visa","MasterCard","Amex","Discover"])!==-1){A(v).show(),A(I).show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div").hide();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div :input").attr(b);A(I+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-sp-checkout-submit").replaceWith(g);(R)?A(v+" input#s2member-pro-paypal-sp-checkout-card-number").focus():null}else{if(A.inArray(S,["Maestro","Solo"])!==-1){A(v).show(),A(I).show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);A(I+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-sp-checkout-submit").replaceWith(g);(R)?A(v+" input#s2member-pro-paypal-sp-checkout-card-number").focus():null}else{if((!S||S==="PayPal")&&t){if(A(v).attr("data-paypal-only")){A(v).hide()}else{A(v).show()}A(I).show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-number-div").hide();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-number-div :input").attr(b);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-expiration-div").hide();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-expiration-div :input").attr(b);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-verification-div").hide();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-verification-div :input").attr(b);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div").hide();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-start-date-issue-number-div :input").attr(b);A(I+" > div.s2member-pro-paypal-sp-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(x);A(I+" > div#s2member-pro-paypal-sp-checkout-form-street-div").hide();A(I+" > div#s2member-pro-paypal-sp-checkout-form-street-div :input").attr(b);A(I+" > div#s2member-pro-paypal-sp-checkout-form-city-div").hide();A(I+" > div#s2member-pro-paypal-sp-checkout-form-city-div :input").attr(b);A(o+" #s2member-pro-paypal-sp-checkout-submit").replaceWith(h);(R)?A(I+" input#s2member-pro-paypal-sp-checkout-state").focus():null}else{if(!S||S==="PayPal"){if(A(v).attr("data-paypal-only")){A(v).hide()}else{A(v).show()}A(I).hide();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();A(v+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(b);A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-type-div").show();A(v+" > div#s2member-pro-paypal-sp-checkout-form-card-type-div :input").attr(x);A(I+" > div.s2member-pro-paypal-sp-checkout-form-div").hide();A(I+" > div.s2member-pro-paypal-sp-checkout-form-div :input").attr(b);A(o+" #s2member-pro-paypal-sp-checkout-submit").replaceWith(h);(R)?A(o+" #s2member-pro-paypal-sp-checkout-submit").focus():null}}}}}K()})();A(m).click(u).change(u);A(P).click(function(){A(l).val("apply-coupon"),n.submit()});n.submit(function(){if(A.inArray(A(l).val(),["option","apply-coupon"])===-1){var U=this,S="",R="",V="";var T=A(O+" input#recaptcha_response_field, "+O+" #g-recaptcha-response");if(!A(m+":checked").val()){A(m).val(["PayPal"])}A(":input",U).each(function(){var W=A.trim(A(this).attr("id")).replace(/---[0-9]+$/g,"");if(W&&(S=A.trim(A('label[for="'+W.replace(/-(month|year)/,"")+'"]',U).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(R=ws_plugin__s2member_validationErrors(S,this,U)){V+=R+"\n\n"}}});if(V=A.trim(V)){alert('— Oops, you missed something: —\n\n'+V);return false}else{if(T.length&&!T.val()){alert('— Oops, you missed something: —\n\nSecurity Verification missing. Please try again.');return false}}}A(d).attr(B),ws_plugin__s2member_animateProcessing(A(d)),A(P).attr(B);return true})}else{if((q=A("form#s2member-pro-paypal-checkout-form")).length===1){var j,F,K,t=true,J,p,f,D,c,s,u,E,a="div#s2member-pro-paypal-checkout-form-options-section",G="div#s2member-pro-paypal-checkout-form-description-section",H="div#s2member-pro-paypal-checkout-form-coupon-section",P=H+" input#s2member-pro-paypal-checkout-coupon-apply",N="div#s2member-pro-paypal-checkout-form-registration-section",Q="div#s2member-pro-paypal-checkout-form-custom-fields-section",v="div#s2member-pro-paypal-checkout-form-billing-method-section",m=v+' input[name="s2member_pro_paypal_checkout[card_type]"]',I="div#s2member-pro-paypal-checkout-form-billing-address-section",y=A(I+" > div#s2member-pro-paypal-checkout-form-ajax-tax-div"),O="div#s2member-pro-paypal-checkout-form-captcha-section",o="div#s2member-pro-paypal-checkout-form-submission-section",l=o+" input#s2member-pro-paypal-checkout-nonce",d=o+" #s2member-pro-paypal-checkout-submit";var C=A.trim(A("input#s2member-pro-paypal-lang-attr").val());var g='';var h='';ws_plugin__s2member_animateProcessing(A(d),"reset"),A(d).removeAttr("disabled"),A(P).removeAttr("disabled");(j=function(R){if(!A(a+" select#s2member-pro-paypal-checkout-options option").length){A(a).hide();A(G).show()}else{A(a).show();A(G).hide();A(a+" select#s2member-pro-paypal-checkout-options").change(function(){A(l).val("option");q.attr("action",q.attr("action").replace(/#.*$/,"")+"#s2p-form");q.submit()})}})();(F=function(R){if(A(o+" input#s2member-pro-paypal-checkout-coupons-not-required-or-not-possible").length){A(H).hide()}else{A(H).show()}})();(K=function(R){if(A(o+" input#s2member-pro-paypal-checkout-tax-not-required-or-not-possible").length){y.hide(),t=false}})();(J=function(S){if(t&&!(S&&S.interval&&document.activeElement.id==="s2member-pro-paypal-checkout-country")){var R=A(o+" input#s2member-pro-paypal-checkout-attr").val();var V=A.trim(A(I+" input#s2member-pro-paypal-checkout-state").val());var W=A(I+" select#s2member-pro-paypal-checkout-country").val();var U=A.trim(A(I+" input#s2member-pro-paypal-checkout-zip").val());var T=V+"|"+W+"|"+U;if(V&&W&&U&&T&&(!c||c!==T)&&(c=T)){(D)?D.abort():null,clearTimeout(f),f=null;y.html('
Calculating Sales Tax... calculating sales tax...
');f=setTimeout(function(){D=A.post('https://clanmacneilusa.us/wp-admin/admin-ajax.php',{action:"ws_plugin__s2member_pro_paypal_ajax_tax",ws_plugin__s2member_pro_paypal_ajax_tax:'ZGVmNTAyMDBkNDc1Mzg3ZjVkZDhjZWNhYTBjNTk5MzM5NWUyYzhhMzUzM2VlNDk4MGU0N2U1N2IxZDFhM2ExNmFkYjIxY2FiYWE4ZDhiNzQ5N2RiYWJhMzM1OGFiNDQ5YzlhZmIwMjc1ZTIyYTJjN2I0NTM5NGY1MjY1NmQ4NGE5NGMwMTZlZGMzY2M0NmU3NGIzNjYyYjJkMGJiNDQ1YzU2NzcwMzhmMDhkMjliZDJkNTUyOThmNDJhYjRmNDNlYjMwOWYyNTE1MmNiMzU4OTIwMmI5MDcyNTNkMGE5YzY0MTM1MjMxY2Q0NDg2MGQ2OTU3MTE0',"ws_plugin__s2member_pro_paypal_ajax_tax_vars[attr]":R,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[state]":V,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[country]":W,"ws_plugin__s2member_pro_paypal_ajax_tax_vars[zip]":U},function(X,Z){clearTimeout(f),f=null;try{y.html("
"+A.sprintf('Sales Tax%s: %s
— Total%s: %s',((X.trial)?' Today':""),((X.tax_per)?""+X.tax_per+" ( "+X.cur_symbol+""+X.tax+" )":X.cur_symbol+""+X.tax),((X.trial)?' Today':""),X.cur_symbol+""+X.total)+"
")}catch(Y){}},"json")},((S&&S.keyCode)?1000:100))}else{if(!V||!W||!U||!T){y.html(""),c=null}}}})();p=function(R){setTimeout(function(){J(R)},10)};A(I+" input#s2member-pro-paypal-checkout-state").bind("keyup blur",J).bind("cut paste",p);A(I+" input#s2member-pro-paypal-checkout-zip").bind("keyup blur",J).bind("cut paste",p);A(I+" select#s2member-pro-paypal-checkout-country").bind("change",J);setInterval(function(){J({interval:true})},1000);(s=function(R){if(A(o+" input#s2member-pro-paypal-checkout-password-not-required-or-not-possible").length){A(N+" > div#s2member-pro-paypal-checkout-form-password-div").hide();A(N+" > div#s2member-pro-paypal-checkout-form-password-div :input").attr(i)}})();(E=function(R){if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN){A(N+" input#s2member-pro-paypal-checkout-first-name").each(function(){var S=A(this),T=S.val();(!T)?S.val(S2MEMBER_CURRENT_USER_FIRST_NAME):null});A(N+" input#s2member-pro-paypal-checkout-last-name").each(function(){var S=A(this),T=S.val();(!T)?S.val(S2MEMBER_CURRENT_USER_LAST_NAME):null});A(N+" input#s2member-pro-paypal-checkout-email").val(S2MEMBER_CURRENT_USER_EMAIL).attr(i);A(N+" input#s2member-pro-paypal-checkout-username").val(S2MEMBER_CURRENT_USER_LOGIN).attr(i);A(N+" > div#s2member-pro-paypal-checkout-form-password-div").hide();A(N+" > div#s2member-pro-paypal-checkout-form-password-div :input").attr(i);if(A.trim(A(N+" > div#s2member-pro-paypal-checkout-form-registration-section-title").html())==='Create Profile'){A(N+" > div#s2member-pro-paypal-checkout-form-registration-section-title").html('Your Profile')}A(Q).hide(),A(Q+" :input").attr(i)}})();(u=function(R){if(A(o+" input#s2member-pro-paypal-checkout-payment-not-required-or-not-possible").length){A(m).val(["Free"])}var S=A(m+":checked").val();if(A.inArray(S,["Free"])!==-1){A(v).hide(),A(I).hide();A(v+" > div.s2member-pro-paypal-checkout-form-div").hide();A(v+" > div.s2member-pro-paypal-checkout-form-div :input").attr(b);A(I+" > div.s2member-pro-paypal-checkout-form-div").hide();A(I+" > div.s2member-pro-paypal-checkout-form-div :input").attr(b);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-checkout-submit").replaceWith(g);(R)?A(o+" #s2member-pro-paypal-checkout-submit").focus():null}else{if(A.inArray(S,["Visa","MasterCard","Amex","Discover"])!==-1){A(v).show(),A(I).show();A(v+" > div.s2member-pro-paypal-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);A(v+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div").hide();A(v+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div :input").attr(b);A(I+" > div.s2member-pro-paypal-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-checkout-submit").replaceWith(g);(R)?A(v+" input#s2member-pro-paypal-checkout-card-number").focus():null}else{if(A.inArray(S,["Maestro","Solo"])!==-1){A(v).show(),A(I).show();A(v+" > div.s2member-pro-paypal-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);A(I+" > div.s2member-pro-paypal-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);(!t)?y.hide():null;A(o+" #s2member-pro-paypal-checkout-submit").replaceWith(g);(R)?A(v+" input#s2member-pro-paypal-checkout-card-number").focus():null}else{if((!S||S==="PayPal")&&t){if(A(v).attr("data-paypal-only")){A(v).hide()}else{A(v).show()}A(I).show();A(v+" > div.s2member-pro-paypal-checkout-form-div").show();A(v+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);A(v+" > div#s2member-pro-paypal-checkout-form-card-number-div").hide();A(v+" > div#s2member-pro-paypal-checkout-form-card-number-div :input").attr(b);A(v+" > div#s2member-pro-paypal-checkout-form-card-expiration-div").hide();A(v+" > div#s2member-pro-paypal-checkout-form-card-expiration-div :input").attr(b);A(v+" > div#s2member-pro-paypal-checkout-form-card-verification-div").hide();A(v+" > div#s2member-pro-paypal-checkout-form-card-verification-div :input").attr(b);A(v+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div").hide();A(v+" > div#s2member-pro-paypal-checkout-form-card-start-date-issue-number-div :input").attr(b);A(I+" > div.s2member-pro-paypal-checkout-form-div").show();A(I+" > div.s2member-pro-paypal-checkout-form-div :input").attr(x);A(I+" > div#s2member-pro-paypal-checkout-form-street-div").hide();A(I+" > div#s2member-pro-paypal-checkout-form-street-div :input").attr(b);A(I+" > div#s2member-pro-paypal-checkout-form-city-div").hide();A(I+" > div#s2member-pro-paypal-checkout-form-city-div :input").attr(b);A(o+" #s2member-pro-paypal-checkout-submit").replaceWith(h);(R)?A(I+" input#s2member-pro-paypal-checkout-state").focus():null}else{if(!S||S==="PayPal"){if(A(v).attr("data-paypal-only")){A(v).hide()}else{A(v).show()}A(I).hide();A(v+" > div.s2member-pro-paypal-checkout-form-div").hide();A(v+" > div.s2member-pro-paypal-checkout-form-div :input").attr(b);A(v+" > div#s2member-pro-paypal-checkout-form-card-type-div").show();A(v+" > div#s2member-pro-paypal-checkout-form-card-type-div :input").attr(x);A(I+" > div.s2member-pro-paypal-checkout-form-div").hide();A(I+" > div.s2member-pro-paypal-checkout-form-div :input").attr(b);A(o+" #s2member-pro-paypal-checkout-submit").replaceWith(h);(R)?A(o+" #s2member-pro-paypal-checkout-submit").focus():null}}}}}})();A(m).click(u).change(u);A(P).click(function(){A(l).val("apply-coupon"),q.submit()});A(N+" > div#s2member-pro-paypal-checkout-form-password-div :input").on("keyup initialize.s2",function(){ws_plugin__s2member_passwordStrength(A(N+" input#s2member-pro-paypal-checkout-username"),A(N+" input#s2member-pro-paypal-checkout-password1"),A(N+" input#s2member-pro-paypal-checkout-password2"),A(N+" div#s2member-pro-paypal-checkout-form-password-strength"))}).trigger("initialize.s2");q.submit(function(){if(A.inArray(A(l).val(),["option","apply-coupon"])===-1){var U=this,S="",R="",X="";var T=A(O+" input#recaptcha_response_field, "+O+" #g-recaptcha-response");var W=A(N+' input#s2member-pro-paypal-checkout-password1[aria-required="true"]');var V=A(N+" input#s2member-pro-paypal-checkout-password2");if(!A(m+":checked").val()){A(m).val(["PayPal"])}A(":input",U).each(function(){var Y=A.trim(A(this).attr("id")).replace(/---[0-9]+$/g,"");if(Y&&(S=A.trim(A('label[for="'+Y.replace(/-(month|year)/,"")+'"]',U).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(R=ws_plugin__s2member_validationErrors(S,this,U)){X+=R+"\n\n"}}});if(X=A.trim(X)){alert('— Oops, you missed something: —\n\n'+X);return false}else{if(W.length&&A.trim(W.val())!==A.trim(V.val())){alert('— Oops, you missed something: —\n\nPasswords do not match up. Please try again.');return false}else{if(W.length&&A.trim(W.val()).length 0) { // Setup the pro-forms only after we managed to load stripe's JS. $.ajax({cache: true, dataType: 'script', url: 'https://js.stripe.com/v3/'}); var stripeCheck = function() { if(window.Stripe) // Stripe available? clearInterval(stripeCheckInterval), setupProForms(); }, stripeCheckInterval = setInterval(stripeCheck, 100); var setupProForms = function() { /* Initializations. */ var preloadAjaxLoader, // Loading image. $clForm, $upForm, $rgForm, $spForm, $coForm, ariaTrue = {'aria-required': 'true'}, ariaFalse = {'aria-required': 'false'}, ariaFalseDis = {'aria-required': 'false', 'disabled': 'disabled'}, disabled = {'disabled': 'disabled'}, taxMayApply = true, calculateTax, cTaxDelay, cTaxTimeout, cTaxReq, cTaxLocation, ajaxTaxDiv, optionsSection, optionsSelect, descSection, couponSection, couponApplyButton, registrationSection, customFieldsSection, billingMethodSection, handleBillingMethod, sourceTokenButton, sourceTokenSummary, sourceTokenInput, sourceTokenSummaryInput, billingAddressSection, captchaSection, submissionSection, submissionButton, submissionNonceVerification; preloadAjaxLoader = new Image(), preloadAjaxLoader.src = 'https://clanmacneilusa.us/wp-content/plugins/s2member/src/images/ajax-loader.gif'; /* Check for more than a single form on this page. */ if($('form.s2member-pro-stripe-cancellation-form').length > 1 || $('form.s2member-pro-stripe-registration-form').length > 1 || $('form.s2member-pro-stripe-update-form').length > 1 || $('form.s2member-pro-stripe-sp-checkout-form').length > 1 || $('form.s2member-pro-stripe-checkout-form').length > 1) { return alert('Detected more than one s2Member Pro-Form.\n\nPlease use only ONE s2Member Pro-Form Shortcode on each Post/Page.' + ' Attempting to serve more than one Pro-Form on each Post/Page (even w/ DHTML) may result in unexpected/broken functionality.'); } /* Cancellation form handler. */ if(($clForm = $('form#s2member-pro-stripe-cancellation-form')).length === 1) { captchaSection = 'div#s2member-pro-stripe-cancellation-form-captcha-section', submissionSection = 'div#s2member-pro-stripe-cancellation-form-submission-section', submissionButton = submissionSection + ' button#s2member-pro-stripe-cancellation-submit'; $(submissionButton).removeAttr('disabled'), ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'); $clForm.on('submit', function(/* Form validation. */) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field, '+captchaSection+' #g-recaptcha-response'); $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__s2member_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; // Error; cannot continue in this scenario. } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Verification missing. Please try again.'); return false; // Error; cannot continue in this scenario. } $(submissionButton).attr(disabled), ws_plugin__s2member_animateProcessing($(submissionButton)); return true; // Allow submission. }); } /* Registration form handler. */ else if(($rgForm = $('form#s2member-pro-stripe-registration-form')).length === 1) { optionsSection = 'div#s2member-pro-stripe-registration-form-options-section', optionsSelect = optionsSection + ' select#s2member-pro-stripe-registration-options', descSection = 'div#s2member-pro-stripe-registration-form-description-section', registrationSection = 'div#s2member-pro-stripe-registration-form-registration-section', captchaSection = 'div#s2member-pro-stripe-registration-form-captcha-section', submissionSection = 'div#s2member-pro-stripe-registration-form-submission-section', submissionButton = submissionSection + ' button#s2member-pro-stripe-registration-submit', submissionNonceVerification = submissionSection + ' input#s2member-pro-stripe-registration-nonce'; $(submissionButton).removeAttr('disabled'), ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'); if(!$(optionsSelect + ' option').length) $(optionsSection).hide(), $(descSection).show(); else $(optionsSection).show(), $(descSection).hide(), $(optionsSelect).on('change', function(/* Handle checkout option changes. */) { $(submissionNonceVerification).val('option'), $rgForm.attr('action', $rgForm.attr('action').replace(/#.*$/, '') + '#s2p-form'), $rgForm.submit(); // Submit form with a new checkout option. }); if($(submissionSection + ' input#s2member-pro-stripe-registration-names-not-required-or-not-possible').length) { $(registrationSection + ' > div#s2member-pro-stripe-registration-form-first-name-div').hide(), $(registrationSection + ' > div#s2member-pro-stripe-registration-form-first-name-div :input').attr(ariaFalseDis); $(registrationSection + ' > div#s2member-pro-stripe-registration-form-last-name-div').hide(), $(registrationSection + ' > div#s2member-pro-stripe-registration-form-last-name-div :input').attr(ariaFalseDis); } if($(submissionSection + ' input#s2member-pro-stripe-registration-password-not-required-or-not-possible').length) { $(registrationSection + ' > div#s2member-pro-stripe-registration-form-password-div').hide(), $(registrationSection + ' > div#s2member-pro-stripe-registration-form-password-div :input').attr(ariaFalseDis); } $(registrationSection + ' > div#s2member-pro-stripe-registration-form-password-div :input').on('keyup initialize.s2', function() { ws_plugin__s2member_passwordStrength( $(registrationSection + ' input#s2member-pro-stripe-registration-username'), $(registrationSection + ' input#s2member-pro-stripe-registration-password1'), $(registrationSection + ' input#s2member-pro-stripe-registration-password2'), $(registrationSection + ' div#s2member-pro-stripe-registration-form-password-strength') ); }).trigger('initialize.s2'); $rgForm.on('submit', function(/* Form validation. */) { if($.inArray($(submissionNonceVerification).val(), ['option']) === -1) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field, '+captchaSection+' #g-recaptcha-response'), $password1 = $(registrationSection + ' input#s2member-pro-stripe-registration-password1[aria-required="true"]'), $password2 = $(registrationSection + ' input#s2member-pro-stripe-registration-password2'); $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__s2member_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; // Error; cannot continue in this scenario. } else if($password1.length && $.trim($password1.val()) !== $.trim($password2.val())) { alert('— Oops, you missed something: —' + '\n\n' + 'Passwords do not match up. Please try again.'); return false; // Error; cannot continue in this scenario. } else if($password1.length && $.trim($password1.val()).length < ws_plugin__s2member_passwordMinLength()) { alert('— Oops, you missed something: —' + '\n\n' + 'Password MUST be at least 8 characters. Please try again.'); return false; } else if($password1.length && ws_plugin__s2member_passwordStrengthMeter($.trim($password1.val()), $.trim($password2.val()), true) < ws_plugin__s2member_passwordMinStrengthScore()) { alert('— Oops, you missed something: —' + '\n\n' + 'Password strength MUST be `good` or `strong` (i.e., use numbers, letters, and mixed caSe). Please try again.'); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Verification missing. Please try again.'); return false; // Error; cannot continue in this scenario. } // $(optionsSelect).attr(disabled); // Not an option selection. // Bug fix. Don't disable, because that prevents it from being submitted. } $(submissionButton).attr(disabled), ws_plugin__s2member_animateProcessing($(submissionButton)); return true; // Allow submission. }); } /* Update form handler. */ else if(($upForm = $('form#s2member-pro-stripe-update-form')).length === 1) { billingMethodSection = 'div#s2member-pro-stripe-update-form-billing-method-section', sourceTokenButton = billingMethodSection + ' button#s2member-pro-stripe-update-form-source-token-button', sourceTokenSummary = billingMethodSection + ' div#s2member-pro-stripe-update-form-source-token-summary', billingAddressSection = 'div#s2member-pro-stripe-update-form-billing-address-section', captchaSection = 'div#s2member-pro-stripe-update-form-captcha-section', submissionSection = 'div#s2member-pro-stripe-update-form-submission-section', sourceTokenInput = submissionSection + ' input[name="' + ws_plugin__s2member_escjQAttr('s2member_pro_stripe_update[source_token]') + '"]', sourceTokenSummaryInput = submissionSection + ' input[name="' + ws_plugin__s2member_escjQAttr('s2member_pro_stripe_update[source_token_summary]') + '"]', submissionButton = submissionSection + ' button#s2member-pro-stripe-update-submit'; $(submissionButton).removeAttr('disabled'), ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'); handleBillingMethod = function(eventTrigger /* eventTrigger is passed by jQuery for DOM events. */) { var sourceToken = $(sourceTokenInput).val(/* Source token from Stripe. */); if(sourceToken/* They have now supplied a source token? */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.s2member-pro-stripe-update-form-div').show(), $(billingMethodSection + ' > div.s2member-pro-stripe-update-form-div :input').attr(ariaTrue); if(taxMayApply/* If tax may apply, we need to collect a tax location. */) { $(billingAddressSection).show(), // Show billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div').show(), $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div :input').attr(ariaTrue); } else // There is no reason to collect tax information in this case. { $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div :input').attr(ariaFalse); } if(eventTrigger) $(submissionSection + ' button#s2member-pro-stripe-update-submit').focus(); } else if(!sourceToken/* Else there is no Billing Method supplied. */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.s2member-pro-stripe-update-form-div').show(), $(billingMethodSection + ' > div.s2member-pro-stripe-update-form-div :input').attr(ariaTrue); $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-update-form-div :input').attr(ariaFalse); } }; handleBillingMethod(); // Handle billing method immediately to deal with fields already filled in. $(sourceTokenButton).on('click', function() // Stripe integration. { var validateZipCode = $(submissionSection + ' input#s2member-pro-stripe-update-should-validate-zipcode').val() == '1', collectBillingAddress = $(submissionSection + ' input#s2member-pro-stripe-update-should-collect-billing-address').val() == '1', collectShippingAddress = $(submissionSection + ' input#s2member-pro-stripe-update-should-collect-shipping-address').val() == '1', stripeImage = ''; var getSourceToken = StripeCheckout.configure ({ bitcoin: false, // Accept Bitcoin as a funding source in this instance? image : stripeImage ? stripeImage : undefined, locale : 'auto', // Based on visitor's country. key : 'pk_live_51MRgsMF5uJstpXSqs27NXVVfgqvg5xrF5mWh9d2J6D7dObQAtZIcHNI4AOLnMWnqDZosBsBl9dmMlzcxUApovlXi00Ndu3SOyP', allowRememberMe: '1' == '1', panelLabel : 'Add', zipCode : validateZipCode, billingAddress : collectBillingAddress, shippingAddress: collectShippingAddress, email : typeof S2MEMBER_CURRENT_USER_EMAIL === 'string' ? S2MEMBER_CURRENT_USER_EMAIL : '', token: function(token) // Callback handler. { $(sourceTokenInput).val(token.id), $(sourceTokenSummaryInput).val(buildSourceTokenTextSummary(token)), $(sourceTokenSummary).html(ws_plugin__s2member_escHtml(buildSourceTokenTextSummary(token))), handleBillingMethod(); // Adjust billing methods fields now also. } }); getSourceToken.open(); // Open Stripe overlay. }); $upForm.on('submit', function(/* Form validation. */) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field, '+captchaSection+' #g-recaptcha-response'); //!!! if(!$(sourceTokenInput).val()) // { // alert('No Billing Method; please try again.'); // return false; // Error; cannot continue in this scenario. // } $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id.replace(/-(month|year)/, '') + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__s2member_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; // Error; cannot continue in this scenario. } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Verification missing. Please try again.'); return false; // Error; cannot continue in this scenario. } $(submissionButton).attr(disabled), ws_plugin__s2member_animateProcessing($(submissionButton)); return true; // Allow submission. }); } /* Handles both types of checkout forms. */ else if(($coForm = $('form#s2member-pro-stripe-sp-checkout-form')).length === 1 || ($coForm = $('form#s2member-pro-stripe-checkout-form')).length === 1) { (function($coForm)// Handles both types of checkout forms; i.e., Specific Post/Page and also Checkout/Modification forms. { var coTypeWithDashes = $coForm[0].id.replace(/^s2member\-pro\-stripe\-/, '').replace(/\-form$/, ''), coTypeWithUnderscores = coTypeWithDashes.replace(/[^a-z0-9]/gi, '_'); // e.g., `sp_checkout`. optionsSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-options-section', optionsSelect = optionsSection + ' select#s2member-pro-stripe-' + coTypeWithDashes + '-options', descSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-description-section', couponSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-coupon-section', couponApplyButton = couponSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-coupon-apply', registrationSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-registration-section', customFieldsSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-custom-fields-section', billingMethodSection = 'div#s2member-pro-stripe-form-billing-method-section', sourceTokenButton = billingMethodSection + ' button#s2member-pro-stripe-' + coTypeWithDashes + '-form-source-token-button', sourceTokenSummary = billingMethodSection + ' div#s2member-pro-stripe-' + coTypeWithDashes + '-form-source-token-summary', billingAddressSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-billing-address-section', ajaxTaxDiv = billingAddressSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-ajax-tax-div', captchaSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-captcha-section', submissionSection = 'div#s2member-pro-stripe-' + coTypeWithDashes + '-form-submission-section', sourceTokenInput = submissionSection + ' input[name="' + ws_plugin__s2member_escjQAttr('s2member_pro_stripe_' + coTypeWithUnderscores + '[source_token]') + '"]', sourceTokenSummaryInput = submissionSection + ' input[name="' + ws_plugin__s2member_escjQAttr('s2member_pro_stripe_' + coTypeWithUnderscores + '[source_token_summary]') + '"]', submissionNonceVerification = submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-nonce', submissionButton = submissionSection + ' button#s2member-pro-stripe-' + coTypeWithDashes + '-submit'; /* Reset button states; in case of a back button. */ $(optionsSelect).removeAttr('disabled'), $(couponApplyButton).removeAttr('disabled'), $(submissionButton).removeAttr('disabled'), ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'); /* Handle checkout options. Does this form have checkout options? */ if(!$(optionsSelect + ' option').length) $(optionsSection).hide(), $(descSection).show(); else $(optionsSection).show(), $(descSection).hide(), $(optionsSelect).on('change', function(/* Handle checkout option changes. */) { $(submissionNonceVerification).val('option'), $coForm.attr('action', $coForm.attr('action').replace(/#.*$/, '') + '#s2p-form'), $coForm.submit(); // Submit form with a new checkout option. }); /* Handle the coupon code section. Enabled on this form? */ if($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-coupons-not-required-or-not-possible').length) $(couponSection).hide(); // Not accepting coupons on this particular form. else $(couponSection).show(), $(couponApplyButton).on('click', function(/* Submit coupon code upon clicking apply button. */) { $(submissionNonceVerification).val('apply-coupon'), $coForm.attr('action', $coForm.attr('action').replace(/#.*$/, '') + '#s2p-form'), $coForm.submit(); // Submit form with hash positioning. }); /* Handle a user that is already logged into their account. */ if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN/* User is already logged in? */) { $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-first-name') .each(function() { var $this = $(this), val = $this.val(); if(!val) $this.val(S2MEMBER_CURRENT_USER_FIRST_NAME); }); $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-last-name') .each(function() { var $this = $(this), val = $this.val(); if(!val) $this.val(S2MEMBER_CURRENT_USER_LAST_NAME); }); $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-email').val(S2MEMBER_CURRENT_USER_EMAIL).attr(ariaFalseDis), $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-username').val(S2MEMBER_CURRENT_USER_LOGIN).attr(ariaFalseDis); if(coTypeWithDashes === 'sp-checkout') // Specific Post/Page Access requires an email address. $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-email').attr(ariaTrue).removeAttr('disabled'); $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-div').hide(), $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').attr(ariaFalseDis); if($.trim($(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-registration-section-title').html()) === 'Create Profile') $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-registration-section-title').html('Your Profile'); $(customFieldsSection).hide(), $(customFieldsSection + ' :input').attr(ariaFalseDis); } /* Handle the password input field in various scenarios. */ if($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-password-not-required-or-not-possible').length) { $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-div').hide(), $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').attr(ariaFalseDis); } else $(registrationSection + ' > div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-div :input').on('keyup initialize.s2', function() { ws_plugin__s2member_passwordStrength( $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-username'), $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-password1'), $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-password2'), $(registrationSection + ' div#s2member-pro-stripe-' + coTypeWithDashes + '-form-password-strength') ); }).trigger('initialize.s2'); /* Handle tax calulations via tax-related input fields. */ if($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-tax-not-required-or-not-possible').length) $(ajaxTaxDiv).hide(), taxMayApply = false; // Tax does NOT even apply. else // We need to setup a few handlers. { cTaxDelay = function(eventTrigger) { setTimeout(function(){ calculateTax(eventTrigger); }, 10); }; calculateTax = function(eventTrigger) // Calculates tax. { if(!taxMayApply) return; // Not applicable. if(eventTrigger && eventTrigger.interval && document.activeElement && document.activeElement.id === 's2member-pro-stripe-' + coTypeWithDashes + '-country') return; // Nothing to do in this special case. var attr = $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-attr').val(), state = $.trim($(billingAddressSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-state').val()), country = $.trim($(billingAddressSection + ' select#s2member-pro-stripe-' + coTypeWithDashes + '-country').val()), zip = $.trim($(billingAddressSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-zip').val()), thisTaxLocation = state + '|' + country + '|' + zip, // Three part location. isBitcoin = $.trim($(sourceTokenInput).val()).indexOf('btcrcv_') === 0; if(state && country && zip && thisTaxLocation && !isBitcoin && (!cTaxLocation || cTaxLocation !== thisTaxLocation)) { clearTimeout(cTaxTimeout), cTaxTimeout = 0, cTaxLocation = thisTaxLocation; // Set current location. if(cTaxReq) cTaxReq.abort(); // Abort any existing connections. var verifier = 'ZGVmNTAyMDA0YzMwZGZmMmIyY2IyZDA3ZWQwNzBjYzU5NmNkYzY3MjhhNTJlYjM1OTVkNjgwMjcwZGE4ODY3Zjc0MWIxZWU4YzA1NjQ2YTNmMmU0Nzc3MWY3NDhjOWE3ODAzOWIzZDQ0ODEwNGJjMzdhOTJjOGM1NmY3YzViZDY5Mzg3MWM4ZDY5ZGY1Njk1N2M3ZDQzZDE0ZTIyMmYzNzhiYzI2ZDJiNjZiNGJjY2Y4MDFkOWUwZjgwNDRjNDIzMTk1OTRmZmExYzkwMjgwMjU1YTBmZDI0N2ZiOTE4YWZhYWRmMGFjNGY2MTM2NjQxYzNjZmEz', calculating = '
calculating sales tax...
', ajaxTaxHandler = function(/* Create a new cTaxTimeout with a one second delay. */) { cTaxReq = $.post('https://clanmacneilusa.us/wp-admin/admin-ajax.php', { 'action' : 'ws_plugin__s2member_pro_stripe_ajax_tax', 'ws_plugin__s2member_pro_stripe_ajax_tax' : verifier, 'ws_plugin__s2member_pro_stripe_ajax_tax_vars[attr]' : attr, 'ws_plugin__s2member_pro_stripe_ajax_tax_vars[state]' : state, 'ws_plugin__s2member_pro_stripe_ajax_tax_vars[country]': country, 'ws_plugin__s2member_pro_stripe_ajax_tax_vars[zip]' : zip }, function(response, textStatus) { clearTimeout(cTaxTimeout), cTaxTimeout = 0; if(typeof response === 'object' && response.hasOwnProperty('tax')) /* translators: `Sales Tax (Today)` and `Total (Today)`. The word `Today` is displayed when/if a trial period is offered. The word `Today` is translated elsewhere. */ $(ajaxTaxDiv).html('
' + $.sprintf('Sales Tax%s: %s
— Total%s: %s', ((response.trial) ? ' ' + 'Today' : ''), ((response.tax_per) ? '' + response.tax_per + ' ( ' + response.cur_symbol + '' + response.tax + ' )' : response.cur_symbol + '' + response.tax), ((response.trial) ? ' ' + 'Today' : ''), response.cur_symbol + '' + response.total) + '
'); }, 'json'); }; $(ajaxTaxDiv).html(calculating), cTaxTimeout = setTimeout(ajaxTaxHandler, ((eventTrigger && eventTrigger.keyCode) ? 1000 : 100)); } else if(!state || !country || !zip || !thisTaxLocation || isBitcoin) { clearTimeout(cTaxTimeout), cTaxTimeout = 0, cTaxLocation = ''; // Reset the current location. if(cTaxReq) cTaxReq.abort(); // Abort any existing connections. $(ajaxTaxDiv).html(''); // Empty the tax calculation div here also. } }; setInterval(function(){ calculateTax({interval: true}); }, 1000), // Helps with things like Google's Autofill feature. $(billingAddressSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-state').on('keyup blur', calculateTax).on('cut paste', cTaxDelay), $(billingAddressSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-zip').on('keyup blur', calculateTax).on('cut paste', cTaxDelay), $(billingAddressSection + ' select#s2member-pro-stripe-' + coTypeWithDashes + '-country').on('change', calculateTax), calculateTax(); // Calculate immediately to deal with fields already filled in. } handleBillingMethod = function(eventTrigger /* eventTrigger is passed by jQuery for DOM events. */) { if($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-payment-not-required-or-not-possible').length) $(sourceTokenInput).val('free'); // No payment required in this very special case. var sourceToken = $(sourceTokenInput).val(/* Source token from Stripe. */); if(sourceToken/* They have now supplied a source token? */) { if(sourceToken === 'free' /* Special source token value. */) { $(billingMethodSection).hide(), // Hide billing method section. $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } else // We need to display the billing method section in all other cases. { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); } if(sourceToken !== 'free' && taxMayApply && sourceToken.indexOf('btcrcv_') !== 0) { $(billingAddressSection).show(), // Show billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); } else // There is no reason to collect tax information in this case. { $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } if(eventTrigger) $(submissionSection + ' button#s2member-pro-stripe-' + coTypeWithDashes + '-submit').focus(); } else if(!sourceToken/* Else there is no Billing Method supplied. */) { $(billingMethodSection).show(), // Show billing method section. $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingMethodSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } }; handleBillingMethod(); // Handle billing method immediately to deal with fields already filled in. //!!! ^^^We don't use tokens anymore... if(taxMayApply) { $(billingAddressSection).show(), // Show billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').show(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaTrue); } else // There is no reason to collect tax information in this case. { $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } //!!! "free" check to hide the billing method when 100% off coupons. if($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-payment-not-required-or-not-possible').length) { var isFree = true; $(billingMethodSection).hide(), // Hide billing method section. $(billingMethodSection + ' > div').hide(), $(billingMethodSection + ' > label').hide(); $(billingAddressSection).hide(), // Hide billing address section. $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div').hide(), $(billingAddressSection + ' > div.s2member-pro-stripe-' + coTypeWithDashes + '-form-div :input').attr(ariaFalse); } $(sourceTokenButton).on('click', function() // Stripe integration. { var isBuyNow = $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-is-buy-now-amount-in-cents').length > 0, validateZipCode = $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-should-validate-zipcode').val() == '1', collectBillingAddress = $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-should-collect-billing-address').val() == '1', collectShippingAddress = $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-should-collect-shipping-address').val() == '1', acceptBitcoin = isBuyNow && $(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-is-buy-now-bitcoin-accepted').length > 0, isBuyNowAmountInCents = isBuyNow ? parseInt($.trim($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-is-buy-now-amount-in-cents').val())) : 0, isBuyNowCurrency = isBuyNow ? $.trim($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-is-buy-now-currency').val()).toUpperCase() : '', isBuyNowDesc = isBuyNow ? $.trim($(submissionSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-is-buy-now-desc').val()) : '', stripeImage = ''; if(isBuyNow && (isNaN(isBuyNowAmountInCents) || isBuyNowAmountInCents <= 0)) isBuyNow = false, acceptBitcoin = false, isBuyNowAmountInCents = 0, isBuyNowCurrency = '', isBuyNowDesc = ''; var getSourceToken = StripeCheckout.configure ({ image : stripeImage ? stripeImage : undefined, locale : 'auto', // Based on visitor's country. amount : isBuyNow ? isBuyNowAmountInCents : undefined, currency : isBuyNow ? isBuyNowCurrency : undefined, description: isBuyNow ? isBuyNowDesc : undefined, bitcoin : isBuyNow && acceptBitcoin, key : 'pk_live_51MRgsMF5uJstpXSqs27NXVVfgqvg5xrF5mWh9d2J6D7dObQAtZIcHNI4AOLnMWnqDZosBsBl9dmMlzcxUApovlXi00Ndu3SOyP', allowRememberMe: '1' == '1', panelLabel : 'Add', zipCode : validateZipCode, billingAddress : collectBillingAddress, shippingAddress: collectShippingAddress, email : $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-email').val(), token: function(token) // Callback handler. { $(sourceTokenInput).val(token.id), $(sourceTokenSummaryInput).val(buildSourceTokenTextSummary(token)), $(sourceTokenSummary).html(ws_plugin__s2member_escHtml(buildSourceTokenTextSummary(token))), handleBillingMethod(); // Adjust billing methods fields now also. } }); getSourceToken.open(); // Open Stripe overlay. }); $coForm.on('submit', function(/* Form validation. */) { if($.inArray($(submissionNonceVerification).val(), ['option', 'apply-coupon']) === -1) { var context = this, label = '', error = '', errors = '', $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field, '+captchaSection+' #g-recaptcha-response'), $password1 = $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-password1[aria-required="true"]'), $password2 = $(registrationSection + ' input#s2member-pro-stripe-' + coTypeWithDashes + '-password2'); $(':input', context) .each(function(/* Go through them all together. */) { var id = $.trim($(this).attr('id')).replace(/---[0-9]+$/g, ''/* Remove numeric suffixes. */); if(id && (label = $.trim($('label[for="' + id.replace(/-(month|year)/, '') + '"]', context).first().children('span').first().text().replace(/[\r\n\t]+/g, ' ')))) { if(error = ws_plugin__s2member_validationErrors(label, this, context)) errors += error + '\n\n'/* Collect errors. */; } }); if((errors = $.trim(errors))) { alert('— Oops, you missed something: —' + '\n\n' + errors); return false; // Error; cannot continue in this scenario. } else if($password1.length && $.trim($password1.val()) !== $.trim($password2.val())) { alert('— Oops, you missed something: —' + '\n\n' + 'Passwords do not match up. Please try again.'); return false; // Error; cannot continue in this scenario. } else if($password1.length && $.trim($password1.val()).length < ws_plugin__s2member_passwordMinLength()) { alert('— Oops, you missed something: —' + '\n\n' + 'Password MUST be at least 8 characters. Please try again.'); return false; } else if($password1.length && ws_plugin__s2member_passwordStrengthMeter($.trim($password1.val()), $.trim($password2.val()), true) < ws_plugin__s2member_passwordMinStrengthScore()) { alert('— Oops, you missed something: —' + '\n\n' + 'Password strength MUST be `good` or `strong` (i.e., use numbers, letters, and mixed caSe). Please try again.'); return false; } else if($recaptchaResponse.length && !$recaptchaResponse.val()) { alert('— Oops, you missed something: —' + '\n\n' + 'Security Verification missing. Please try again.'); return false; // Error; cannot continue in this scenario. } // $(optionsSelect).attr(disabled); // Not an option selection. //!!! Bug fix. Don't disable, because that prevents it from being submitted. } $(couponApplyButton).attr(disabled), $(submissionButton).attr(disabled), ws_plugin__s2member_animateProcessing($(submissionButton)); return true; // Allow submission. }); })($coForm); } var buildSourceTokenTextSummary = function(token, args) { if(typeof token !== 'object') return ''; // `args` contains billing/shipping address. if(token.type === 'card' && token.card && token.card.brand && token.card.last4) return token.card.brand + ': xxxx-xxxx-xxxx-' + token.card.last4; if(token.type === 'alipay_account' && token.alipay_account && token.alipay_account.username) return 'Alipay: ' + token.alipay_account.username; if(token.type === 'bank_account' && token.bank_account && token.bank_account.bank_name && token.bank_account.last4) return token.bank_account.bank_name + ': xxxx...' + token.bank_account.last4; if(token.type === 'source_bitcoin' && token.bitcoin && token.bitcoin.address) return 'Bitcoin: ' + token.bitcoin.address; return 'Token: ' + token.id; }; /* Jump to responses. */ $('div#s2member-pro-stripe-form-response') .each(function() { scrollTo(0, $(this).offset().top - 100); }); // Stripe SCA update. var form = document.getElementsByClassName('s2member-pro-stripe-form')[0]; var isFree = ($('input#s2member-pro-stripe-sp-checkout-payment-not-required-or-not-possible').length || $('input#s2member-pro-stripe-checkout-payment-not-required-or-not-possible').length) ? true : false; if (form && !isFree) { var stripe = Stripe('pk_live_51MRgsMF5uJstpXSqs27NXVVfgqvg5xrF5mWh9d2J6D7dObQAtZIcHNI4AOLnMWnqDZosBsBl9dmMlzcxUApovlXi00Ndu3SOyP', { apiVersion: '2019-10-08', }); var elements = stripe.elements(); var piSecret = jQuery('#s2member-pro-stripe-form-pi-secret').val(); var setiSecret = jQuery('#s2member-pro-stripe-form-seti-secret').val(); // Do we have a Setup Intent with status require_action? if (setiSecret) { stripe.handleCardSetup( setiSecret ).then(function(result) { // Handle result.error or result.setupIntent if (result.error) { // Display result.error.message in UI. var errorElement = document.getElementById('s2member-pro-stripe-form-card-errors'); errorElement.textContent = result.error.message; } else { // The SetupIntent has successfully been authorized. // Update Setup Intent hidden field with ID. jQuery('#s2member-pro-stripe-form-seti-id').val(result.setupIntent.id); // Make it more obvious that something is happening, and just wait... jQuery('.s2member-pro-stripe-submit') .prop('disabled', true) .addClass('ws-plugin--s2member-animate-processing'); jQuery(form).addClass('s2member-pro-stripe-form-disabled'); jQuery('#s2member-pro-stripe-form-response') .removeClass('s2member-pro-stripe-form-response-error') .addClass('s2member-pro-stripe-form-response-info') .text('Please wait. Don´t close or refresh the window. Processing...'); // Submit the form form.submit(); } }); } // Do we have a Payment Intent with status require_action? if (piSecret) { // If there's a subscription ID, it's a subscription // then payment intent's confirmation_method will be set to "automatic", so use handleCardPayment // else it's a single payment with confirmation_method set to "manual", so use handleCardAction. if (jQuery('#s2member-pro-stripe-form-sub-id').val()) { handleCardResult = stripe.handleCardPayment(piSecret); } else { handleCardResult = stripe.handleCardAction(piSecret); } handleCardResult.then(function(result) { // Handle result.error or result.paymentIntent if (result.error) { // Display result.error.message in UI. var errorElement = document.getElementById('s2member-pro-stripe-form-card-errors'); errorElement.textContent = result.error.message; } else { // The PaymentIntent has successfully been authorized. // Update Payment Intent hidden field with ID. jQuery('#s2member-pro-stripe-form-pi-id').val(result.paymentIntent.id); // Make it more obvious that something is happening, and just wait... jQuery('.s2member-pro-stripe-submit') .prop('disabled', true) .addClass('ws-plugin--s2member-animate-processing'); jQuery(form).addClass('s2member-pro-stripe-form-disabled'); jQuery('#s2member-pro-stripe-form-response') .removeClass('s2member-pro-stripe-form-response-error') .addClass('s2member-pro-stripe-form-response-info') .text('Please wait. Don´t close or refresh the window. Processing...'); // Submit the form form.submit(); } }); } // Options when creating an Element. var style = { base: { fontSize: '17px', color: '#333', } }; var hideZip = '1' == 1 ? false : true; // Create an instance of the card Element. var cardElement = elements.create('card', { style: style, hidePostalCode: hideZip, }); // Add an instance of the card Element into the `card-element` div. cardElement.mount('#s2member-pro-stripe-form-card-element'); // Listen to change events on the card Element and display any errors. cardElement.addEventListener('change', function(event) { var displayError = document.getElementById('s2member-pro-stripe-form-card-errors'); if (event.error) { displayError.textContent = event.error.message; } else { displayError.textContent = ''; } }); // Control form submit. form.addEventListener('submit', function(event) { event.preventDefault(); var fullName = jQuery('.s2member-pro-stripe-first-name').val() + ' ' + jQuery('.s2member-pro-stripe-last-name').val(); var emailAddress = jQuery('.s2member-pro-stripe-email').val(); var addrStreet = jQuery('.s2member-pro-stripe-street').val(); var addrCity = jQuery('.s2member-pro-stripe-city').val(); var addrState = jQuery('.s2member-pro-stripe-state').val(); var addrCountry = jQuery('.s2member-pro-stripe-country').val(); var addrZip = jQuery('.s2member-pro-stripe-zip').val(); var billAddr = { line1: addrStreet, city: addrCity, state: addrState, country: addrCountry, postal_code: addrZip, }; // Create the Payment Method. stripe.createPaymentMethod( 'card', cardElement, { billing_details: { email: emailAddress, name: fullName, address: addrState ? billAddr : null, } } ).then(function(result) { if (result.error) { // Display result.error.message in UI. jQuery('#s2member-pro-stripe-form-card-errors').text(result.error.message); jQuery('.s2member-pro-stripe-submit') .prop('disabled', false) .removeClass('ws-plugin--s2member-animate-processing'); } else { // The PaymentMethod has successfully been created. // Update Payment Method hidden field with ID. jQuery('#s2member-pro-stripe-form-pm-id').val(result.paymentMethod.id); // Submit the form form.submit(); } }).catch(console.error.bind(console)); }); } } } });