Source Code Documentation


s2member-pro\includes\separates\gateways\authnet\authnet.js


  1. /**
  2. * Core JavaScript routines for Authorize.Net®.
  3. *
  4. * Copyright: © 2009-2011
  5. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  6. * ( coded in the USA )
  7. *
  8. * This WordPress® plugin ( s2Member Pro ) is comprised of two parts:
  9. *
  10. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  11. * You should have received a copy of the GNU General Public License,
  12. * along with this software. In the main directory, see: /licensing/
  13. * If not, see: {@link http://www.gnu.org/licenses/}.
  14. *
  15. * o (2) All other parts of ( s2Member Pro ); including, but not limited to:
  16. * the CSS code, some JavaScript code, images, and design;
  17. * are licensed according to the license purchased.
  18. * See: {@link http://www.s2member.com/prices/}
  19. *
  20. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  21. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  22. * or make an offer to do any of these things. All of these things are strictly
  23. * prohibited with part (2) of the s2Member Pro Module.
  24. *
  25. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  26. * ( i.e. new features, bug fixes, updates, improvements ); along with full access
  27. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  28. *
  29. * @package s2Member\AuthNet
  30. * @since 1.5
  31. */
  32. jQuery(document).ready (function($)
  33. {
  34. var $clForm, $upForm, $rgForm, $spForm, $coForm, jumpToResponses, preloadAjaxLoader, ariaTrue = {'aria-required': 'true'}, ariaFalse = {'aria-required': 'false'}, disabled = {'disabled': 'disabled'}, ariaFalseDis = {'aria-required': 'false', 'disabled': 'disabled'};
  35. /**/
  36. preloadAjaxLoader = new Image (), preloadAjaxLoader.src = '<?php echo $vars["i"]; ?>/ajax-loader.gif';
  37. /**/
  38. if (($clForm = $('form#s2member-pro-authnet-cancellation-form')).length === 1)
  39. {
  40. var captchaSection = 'div#s2member-pro-authnet-cancellation-form-captcha-section', submissionSection = 'div#s2member-pro-authnet-cancellation-form-submission-section', $submissionButton = $(submissionSection + ' input#s2member-pro-authnet-cancellation-submit');
  41. /**/
  42. ws_plugin__s2member_animateProcessing($submissionButton, 'reset'), $submissionButton.removeAttr ('disabled');
  43. /**/
  44. $clForm.submit ( /* Form validation. */function()
  45. {
  46. var context = this, label = '', error = '', errors = '';
  47. /**/
  48. var $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field');
  49. /**/
  50. $(':input', context).each ( /* Go through them all together. */function()
  51. {
  52. var id = /* Remove numeric suffixes. */ $.trim ($(this).attr ('id')).replace (/-[0-9]+$/g, '');
  53. /**/
  54. if (id && (label = $.trim ($('label[for="' + id + '"]', context).first ().children ('span').first ().text ().replace (/[\r\n\t]+/g, ' '))))
  55. {
  56. if (error = ws_plugin__s2member_validationErrors(label, this, context))
  57. errors += /* Collect errors. */ error + '\n\n';
  58. }
  59. });
  60. /**/
  61. if (errors = $.trim (errors))
  62. {
  63. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + errors);
  64. /**/
  65. return false;
  66. }
  67. /**/
  68. else if ($recaptchaResponse.length && !$recaptchaResponse.val ())
  69. {
  70. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Security Code missing. Please try again.", "s2member-front", "s2member")); ?>');
  71. /**/
  72. return false;
  73. }
  74. /**/
  75. $submissionButton.attr (disabled), ws_plugin__s2member_animateProcessing($submissionButton);
  76. /**/
  77. return true;
  78. });
  79. }
  80. /**/
  81. else if (($upForm = $('form#s2member-pro-authnet-update-form')).length === 1)
  82. {
  83. var handleBillingMethod, billingMethodSection = 'div#s2member-pro-authnet-update-form-billing-method-section', billingAddressSection = 'div#s2member-pro-authnet-update-form-billing-address-section', cardType = billingMethodSection + ' input[name="s2member_pro_authnet_update\[card_type\]"]', captchaSection = 'div#s2member-pro-authnet-update-form-captcha-section', submissionSection = 'div#s2member-pro-authnet-update-form-submission-section', $submissionButton = $(submissionSection + ' input#s2member-pro-authnet-update-submit');
  84. /**/
  85. ws_plugin__s2member_animateProcessing($submissionButton, 'reset'), $submissionButton.removeAttr ('disabled');
  86. /**/
  87. (handleBillingMethod = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  88. {
  89. var billingMethod = /* Billing Method. */ $(cardType + ':checked').val ();
  90. /**/
  91. if ($.inArray (billingMethod, ['Visa', 'MasterCard', 'Amex', 'Discover']) !== -1)
  92. {
  93. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div').show ();
  94. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaTrue);
  95. /**/
  96. $(billingMethodSection + ' > div#s2member-pro-authnet-update-form-card-start-date-issue-number-div').hide ();
  97. $(billingMethodSection + ' > div#s2member-pro-authnet-update-form-card-start-date-issue-number-div :input').attr (ariaFalse);
  98. /**/
  99. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div').show ();
  100. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaTrue);
  101. /**/
  102. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-update-card-number').focus () : null;
  103. }
  104. else if ($.inArray (billingMethod, ['Maestro', 'Solo']) !== -1)
  105. {
  106. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div').show ();
  107. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaTrue);
  108. /**/
  109. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div').show ();
  110. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaTrue);
  111. /**/
  112. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-update-card-number').focus () : null;
  113. }
  114. else if /* Else there was no Billing Method supplied. */ (!billingMethod)
  115. {
  116. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div').hide ();
  117. $(billingMethodSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaFalse);
  118. /**/
  119. $(billingMethodSection + ' > div#s2member-pro-authnet-update-form-card-type-div').show ();
  120. $(billingMethodSection + ' > div#s2member-pro-authnet-update-form-card-type-div :input').attr (ariaTrue);
  121. /**/
  122. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div').hide ();
  123. $(billingAddressSection + ' > div.s2member-pro-authnet-update-form-div :input').attr (ariaFalse);
  124. /**/
  125. $(billingAddressSection).hide (), (eventTrigger) ? $(submissionSection + ' input#s2member-pro-authnet-update-submit').focus () : null;
  126. }
  127. }) ();
  128. /**/
  129. $(cardType).click (handleBillingMethod).change (handleBillingMethod);
  130. /**/
  131. $upForm.submit ( /* Form validation. */function()
  132. {
  133. var context = this, label = '', error = '', errors = '';
  134. /**/
  135. var $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field');
  136. /**/
  137. if (!$(cardType + ':checked').val ())
  138. {
  139. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Please choose a Billing Method.", "s2member-front", "s2member")); ?>');
  140. /**/
  141. return false;
  142. }
  143. /**/
  144. $(':input', context).each ( /* Go through them all together. */function()
  145. {
  146. var id = /* Remove numeric suffixes. */ $.trim ($(this).attr ('id')).replace (/-[0-9]+$/g, '');
  147. /**/
  148. if (id && (label = $.trim ($('label[for="' + id + '"]', context).first ().children ('span').first ().text ().replace (/[\r\n\t]+/g, ' '))))
  149. {
  150. if (error = ws_plugin__s2member_validationErrors(label, this, context))
  151. errors += /* Collect errors. */ error + '\n\n';
  152. }
  153. });
  154. /**/
  155. if (errors = $.trim (errors))
  156. {
  157. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + errors);
  158. /**/
  159. return false;
  160. }
  161. /**/
  162. else if ($recaptchaResponse.length && !$recaptchaResponse.val ())
  163. {
  164. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Security Code missing. Please try again.", "s2member-front", "s2member")); ?>');
  165. /**/
  166. return false;
  167. }
  168. /**/
  169. $submissionButton.attr (disabled), ws_plugin__s2member_animateProcessing($submissionButton);
  170. /**/
  171. return true;
  172. });
  173. }
  174. /**/
  175. else if (($rgForm = $('form#s2member-pro-authnet-registration-form')).length === 1)
  176. {
  177. var handleNameIssues, handlePasswordIssues, registrationSection = 'div#s2member-pro-authnet-registration-form-registration-section', captchaSection = 'div#s2member-pro-authnet-registration-form-captcha-section', submissionSection = 'div#s2member-pro-authnet-registration-form-submission-section', $submissionButton = $(submissionSection + ' input#s2member-pro-authnet-registration-submit');
  178. /**/
  179. ws_plugin__s2member_animateProcessing($submissionButton, 'reset'), $submissionButton.removeAttr ('disabled');
  180. /**/
  181. (handleNameIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  182. {
  183. if ($(submissionSection + ' input#s2member-pro-authnet-registration-names-not-required-or-not-possible').length)
  184. {
  185. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-first-name-div').hide ();
  186. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-first-name-div :input').attr (ariaFalseDis);
  187. /**/
  188. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-last-name-div').hide ();
  189. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-last-name-div :input').attr (ariaFalseDis);
  190. }
  191. }) ();
  192. /**/
  193. (handlePasswordIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  194. {
  195. if ($(submissionSection + ' input#s2member-pro-authnet-registration-password-not-required-or-not-possible').length)
  196. {
  197. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-password-div').hide ();
  198. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-password-div :input').attr (ariaFalseDis);
  199. }
  200. }) ();
  201. /**/
  202. $(registrationSection + ' > div#s2member-pro-authnet-registration-form-password-div :input').keyup (function()
  203. {
  204. ws_plugin__s2member_passwordStrength($(registrationSection + ' input#s2member-pro-authnet-registration-username'), $(registrationSection + ' input#s2member-pro-authnet-registration-password1'), $(registrationSection + ' input#s2member-pro-authnet-registration-password2'), $(registrationSection + ' div#s2member-pro-authnet-registration-form-password-strength'));
  205. });
  206. /**/
  207. $rgForm.submit ( /* Form validation. */function()
  208. {
  209. var context = this, label = '', error = '', errors = '';
  210. /**/
  211. var $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field');
  212. /**/
  213. var $password1 = $(registrationSection + ' input#s2member-pro-authnet-registration-password1[aria-required="true"]');
  214. var $password2 = $(registrationSection + ' input#s2member-pro-authnet-registration-password2');
  215. /**/
  216. $(':input', context).each ( /* Go through them all together. */function()
  217. {
  218. var id = /* Remove numeric suffixes. */ $.trim ($(this).attr ('id')).replace (/-[0-9]+$/g, '');
  219. /**/
  220. if (id && (label = $.trim ($('label[for="' + id + '"]', context).first ().children ('span').first ().text ().replace (/[\r\n\t]+/g, ' '))))
  221. {
  222. if (error = ws_plugin__s2member_validationErrors(label, this, context))
  223. errors += /* Collect errors. */ error + '\n\n';
  224. }
  225. });
  226. /**/
  227. if (errors = $.trim (errors))
  228. {
  229. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + errors);
  230. /**/
  231. return false;
  232. }
  233. /**/
  234. else if ($password1.length && $.trim ($password1.val ()) !== $.trim ($password2.val ()))
  235. {
  236. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Passwords do not match up. Please try again.", "s2member-front", "s2member")); ?>');
  237. /**/
  238. return false;
  239. }
  240. /**/
  241. else if /* Enforce minimum length requirement here. */ ($password1.length && $.trim ($password1.val ()).length < 6)
  242. {
  243. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Password MUST be at least 6 characters. Please try again.", "s2member-front", "s2member")); ?>');
  244. /**/
  245. return false;
  246. }
  247. /**/
  248. else if ($recaptchaResponse.length && !$recaptchaResponse.val ())
  249. {
  250. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Security Code missing. Please try again.", "s2member-front", "s2member")); ?>');
  251. /**/
  252. return false;
  253. }
  254. /**/
  255. $submissionButton.attr (disabled), ws_plugin__s2member_animateProcessing($submissionButton);
  256. /**/
  257. return true;
  258. });
  259. }
  260. /**/
  261. else if (($spForm = $('form#s2member-pro-authnet-sp-checkout-form')).length === 1)
  262. {
  263. var handleCouponIssues, handleTaxIssues, taxMayApply = true, calculateTax, cTaxDelay, cTaxTimeout, cTaxReq, cTaxLocation, handleExistingUsers, handleBillingMethod, couponSection = 'div#s2member-pro-authnet-sp-checkout-form-coupon-section', couponApplyButton = couponSection + ' input#s2member-pro-authnet-sp-checkout-coupon-apply', registrationSection = 'div#s2member-pro-authnet-sp-checkout-form-registration-section', billingMethodSection = 'div#s2member-pro-authnet-sp-checkout-form-billing-method-section', cardType = billingMethodSection + ' input[name="s2member_pro_authnet_sp_checkout\[card_type\]"]', billingAddressSection = 'div#s2member-pro-authnet-sp-checkout-form-billing-address-section', $ajaxTaxDiv = $(billingAddressSection + ' > div#s2member-pro-authnet-sp-checkout-form-ajax-tax-div'), captchaSection = 'div#s2member-pro-authnet-sp-checkout-form-captcha-section', submissionSection = 'div#s2member-pro-authnet-sp-checkout-form-submission-section', submissionNonceVerification = submissionSection + ' input#s2member-pro-authnet-sp-checkout-nonce', submissionButton = submissionSection + ' input#s2member-pro-authnet-sp-checkout-submit';
  264. /**/
  265. ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'), $(submissionButton).removeAttr ('disabled'), $(couponApplyButton).removeAttr ('disabled');
  266. /**/
  267. (handleCouponIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  268. {
  269. if ($(submissionSection + ' input#s2member-pro-authnet-sp-checkout-coupons-not-required-or-not-possible').length)
  270. {
  271. $(couponSection).hide /* Not accepting Coupons on this particular form. */ ();
  272. }
  273. else /* This is turned off by default for smoother loading. ( via: display:none ). */
  274. $(couponSection).show /* OK. So we need to display this now. */ ();
  275. }) ();
  276. /**/
  277. (handleTaxIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  278. {
  279. if ($(submissionSection + ' input#s2member-pro-authnet-sp-checkout-tax-not-required-or-not-possible').length)
  280. {
  281. $ajaxTaxDiv.hide (), taxMayApply = /* Tax does NOT even apply. */ false;
  282. }
  283. }) ();
  284. /**/
  285. (calculateTax = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  286. {
  287. if (taxMayApply && !(eventTrigger && eventTrigger.interval && document.activeElement.id === 's2member-pro-authnet-sp-checkout-country'))
  288. {
  289. var attr = $(submissionSection + ' input#s2member-pro-authnet-sp-checkout-attr').val ();
  290. var state = $.trim ($(billingAddressSection + ' input#s2member-pro-authnet-sp-checkout-state').val ());
  291. var country = $(billingAddressSection + ' select#s2member-pro-authnet-sp-checkout-country').val ();
  292. var zip = $.trim ($(billingAddressSection + ' input#s2member-pro-authnet-sp-checkout-zip').val ());
  293. var thisTaxLocation = /* Three part location. */ state + '|' + country + '|' + zip;
  294. /**/
  295. if (state && country && zip && thisTaxLocation && (!cTaxLocation || cTaxLocation !== thisTaxLocation) && (cTaxLocation = thisTaxLocation))
  296. {
  297. (cTaxReq) ? /* Abort. */ cTaxReq.abort () : null, /* Clear. */ clearTimeout(cTaxTimeout), cTaxTimeout = null;
  298. /**/
  299. $ajaxTaxDiv.html ('<div><img src="<?php echo $vars["i"]; ?>/ajax-loader.gif" alt="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (_x ("Calculating Sales Tax...", "s2member-front", "s2member"))); ?>" /> <?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("calculating sales tax...", "s2member-front", "s2member")); ?></div>');
  300. /**/
  301. cTaxTimeout = setTimeout( /* Create a new cTaxTimeout with a one second delay. */function()
  302. {
  303. cTaxReq = $.post ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (admin_url ("/admin-ajax.php")); ?>', {'action': 'ws_plugin__s2member_pro_authnet_ajax_tax', 'ws_plugin__s2member_pro_authnet_ajax_tax': '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (c_ws_plugin__s2member_utils_encryption::encrypt ("ws-plugin--s2member-pro-authnet-ajax-tax")); ?>', 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[attr]': attr, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[state]': state, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[country]': country, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[zip]': zip}, function(response)
  304. {
  305. clearTimeout /* Clear cTaxTimeout. */(cTaxTimeout), cTaxTimeout = null;
  306. /**/
  307. try /* Try/catch here. jQuery will sometimes return a successful response in IE, whenever the connection is aborted with a null response. */
  308. {
  309. /* 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. */
  310. $ajaxTaxDiv.html ('<div>' + $.sprintf ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("<strong>Sales Tax%s:</strong> %s<br /><strong>— Total%s:</strong> %s", "s2member-front", "s2member")); ?>', ((response.trial) ? ' ' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Today", "s2member-front", "s2member")); ?>' : ''), ((response.tax_per) ? '<em>' + response.tax_per + '</em> ( ' + response.cur_symbol + '' + response.tax + ' )' : response.cur_symbol + '' + response.tax), ((response.trial) ? ' ' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Today", "s2member-front", "s2member")); ?>' : ''), response.cur_symbol + '' + response.total) + '</div>');
  311. }
  312. catch (e) {}
  313. /**/
  314. }, 'json');
  315. /**/
  316. }, ((eventTrigger && eventTrigger.keyCode) ? 1000 : 100));
  317. }
  318. /**/
  319. else if (!state || !country || !zip || !thisTaxLocation)
  320. $ajaxTaxDiv.html (''), cTaxLocation = null;
  321. }
  322. }) ();
  323. /**/
  324. cTaxDelay = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  325. {
  326. setTimeout( /* Trigger event handler with a brief delay. */function()
  327. {
  328. calculateTax(eventTrigger);
  329. }, 10); /* Brief delay. */
  330. }
  331. /**/
  332. $(billingAddressSection + ' input#s2member-pro-authnet-sp-checkout-state').bind ('keyup blur', calculateTax).bind ('cut paste', cTaxDelay);
  333. $(billingAddressSection + ' input#s2member-pro-authnet-sp-checkout-zip').bind ('keyup blur', calculateTax).bind ('cut paste', cTaxDelay);
  334. $(billingAddressSection + ' select#s2member-pro-authnet-sp-checkout-country').bind ('change', calculateTax);
  335. /**/
  336. setInterval( /* Helps with things like Google's Autofill feature. */function()
  337. {
  338. calculateTax /* Identify as interval trigger. */({interval: true});
  339. }, 1000);
  340. /**/
  341. (handleExistingUsers = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  342. {
  343. if /* If User/Member is already logged in. */ (S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
  344. {
  345. $(registrationSection + ' input#s2member-pro-authnet-sp-checkout-first-name').each (function()
  346. {
  347. var $this = $(this), val = $this.val ();
  348. (!val) ? $this.val (S2MEMBER_CURRENT_USER_FIRST_NAME) : null;
  349. });
  350. /**/
  351. $(registrationSection + ' input#s2member-pro-authnet-sp-checkout-last-name').each (function()
  352. {
  353. var $this = $(this), val = $this.val ();
  354. (!val) ? $this.val (S2MEMBER_CURRENT_USER_LAST_NAME) : null;
  355. });
  356. /**/
  357. $(registrationSection + ' input#s2member-pro-authnet-sp-checkout-email').each (function()
  358. {
  359. var $this = $(this), val = $this.val ();
  360. (!val) ? $this.val (S2MEMBER_CURRENT_USER_EMAIL) : null;
  361. });
  362. }
  363. }) ();
  364. /**/
  365. (handleBillingMethod = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  366. {
  367. var billingMethod = /* Billing Method. */ $(cardType + ':checked').val ();
  368. /**/
  369. if ($.inArray (billingMethod, ['Visa', 'MasterCard', 'Amex', 'Discover']) !== -1)
  370. {
  371. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').show ();
  372. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaTrue);
  373. /**/
  374. $(billingMethodSection + ' > div#s2member-pro-authnet-sp-checkout-form-card-start-date-issue-number-div').hide ();
  375. $(billingMethodSection + ' > div#s2member-pro-authnet-sp-checkout-form-card-start-date-issue-number-div :input').attr (ariaFalse);
  376. /**/
  377. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').show ();
  378. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaTrue);
  379. /**/
  380. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  381. /**/
  382. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-sp-checkout-card-number').focus () : null;
  383. }
  384. else if ($.inArray (billingMethod, ['Maestro', 'Solo']) !== -1)
  385. {
  386. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').show ();
  387. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaTrue);
  388. /**/
  389. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').show ();
  390. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaTrue);
  391. /**/
  392. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  393. /**/
  394. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-sp-checkout-card-number').focus () : null;
  395. }
  396. else if /* Else there was no Billing Method supplied. */ (!billingMethod)
  397. {
  398. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').hide ();
  399. $(billingMethodSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaFalse);
  400. /**/
  401. $(billingMethodSection + ' > div#s2member-pro-authnet-sp-checkout-form-card-type-div').show ();
  402. $(billingMethodSection + ' > div#s2member-pro-authnet-sp-checkout-form-card-type-div :input').attr (ariaTrue);
  403. /**/
  404. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div').hide ();
  405. $(billingAddressSection + ' > div.s2member-pro-authnet-sp-checkout-form-div :input').attr (ariaFalse);
  406. /**/
  407. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  408. /**/
  409. $(billingAddressSection).hide (), (eventTrigger) ? $(submissionSection + ' input#s2member-pro-authnet-sp-checkout-submit').focus () : null;
  410. }
  411. /**/
  412. handleTaxIssues /* Tax issues. */ ();
  413. }) ();
  414. /**/
  415. $(cardType).click (handleBillingMethod).change (handleBillingMethod);
  416. /**/
  417. $(couponApplyButton).click ( /* Only applying coupon. */function()
  418. {
  419. $(submissionNonceVerification).val ('apply-coupon'), $spForm.submit ();
  420. });
  421. /**/
  422. $spForm.submit ( /* Form validation. */function()
  423. {
  424. if ($(submissionNonceVerification).val () !== 'apply-coupon')
  425. {
  426. var context = this, label = '', error = '', errors = '';
  427. /**/
  428. var $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field');
  429. /**/
  430. if (!$(cardType + ':checked').val ())
  431. {
  432. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Please choose a Billing Method.", "s2member-front", "s2member")); ?>');
  433. /**/
  434. return false;
  435. }
  436. /**/
  437. $(':input', context).each ( /* Go through them all together. */function()
  438. {
  439. var id = /* Remove numeric suffixes. */ $.trim ($(this).attr ('id')).replace (/-[0-9]+$/g, '');
  440. /**/
  441. if (id && (label = $.trim ($('label[for="' + id + '"]', context).first ().children ('span').first ().text ().replace (/[\r\n\t]+/g, ' '))))
  442. {
  443. if (error = ws_plugin__s2member_validationErrors(label, this, context))
  444. errors += /* Collect errors. */ error + '\n\n';
  445. }
  446. });
  447. /**/
  448. if (errors = $.trim (errors))
  449. {
  450. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + errors);
  451. /**/
  452. return false;
  453. }
  454. /**/
  455. else if ($recaptchaResponse.length && !$recaptchaResponse.val ())
  456. {
  457. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Security Code missing. Please try again.", "s2member-front", "s2member")); ?>');
  458. /**/
  459. return false;
  460. }
  461. }
  462. /**/
  463. $(submissionButton).attr (disabled), ws_plugin__s2member_animateProcessing($(submissionButton)), $(couponApplyButton).attr (disabled);
  464. /**/
  465. return true;
  466. });
  467. }
  468. /**/
  469. else if (($coForm = $('form#s2member-pro-authnet-checkout-form')).length === 1)
  470. {
  471. var handleCouponIssues, handleTaxIssues, taxMayApply = true, calculateTax, cTaxDelay, cTaxTimeout, cTaxReq, cTaxLocation, handlePasswordIssues, handleBillingMethod, handleExistingUsers, couponSection = 'div#s2member-pro-authnet-checkout-form-coupon-section', couponApplyButton = couponSection + ' input#s2member-pro-authnet-checkout-coupon-apply', registrationSection = 'div#s2member-pro-authnet-checkout-form-registration-section', customFieldsSection = 'div#s2member-pro-authnet-checkout-form-custom-fields-section', billingMethodSection = 'div#s2member-pro-authnet-checkout-form-billing-method-section', cardType = billingMethodSection + ' input[name="s2member_pro_authnet_checkout\[card_type\]"]', billingAddressSection = 'div#s2member-pro-authnet-checkout-form-billing-address-section', $ajaxTaxDiv = $(billingAddressSection + ' > div#s2member-pro-authnet-checkout-form-ajax-tax-div'), captchaSection = 'div#s2member-pro-authnet-checkout-form-captcha-section', submissionSection = 'div#s2member-pro-authnet-checkout-form-submission-section', submissionNonceVerification = submissionSection + ' input#s2member-pro-authnet-checkout-nonce', submissionButton = submissionSection + ' input#s2member-pro-authnet-checkout-submit';
  472. /**/
  473. ws_plugin__s2member_animateProcessing($(submissionButton), 'reset'), $(submissionButton).removeAttr ('disabled'), $(couponApplyButton).removeAttr ('disabled');
  474. /**/
  475. (handleCouponIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  476. {
  477. if ($(submissionSection + ' input#s2member-pro-authnet-checkout-coupons-not-required-or-not-possible').length)
  478. {
  479. $(couponSection).hide /* Not accepting Coupons on this particular form. */ ();
  480. }
  481. else /* This is turned off by default for smoother loading. ( via: display:none ). */
  482. $(couponSection).show /* OK. So we need to display this now. */ ();
  483. }) ();
  484. /**/
  485. (handleTaxIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  486. {
  487. if ($(submissionSection + ' input#s2member-pro-authnet-checkout-tax-not-required-or-not-possible').length)
  488. {
  489. $ajaxTaxDiv.hide (), taxMayApply = /* Tax does NOT even apply. */ false;
  490. }
  491. }) ();
  492. /**/
  493. (calculateTax = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  494. {
  495. if (taxMayApply && !(eventTrigger && eventTrigger.interval && document.activeElement.id === 's2member-pro-authnet-checkout-country'))
  496. {
  497. var attr = $(submissionSection + ' input#s2member-pro-authnet-checkout-attr').val ();
  498. var state = $.trim ($(billingAddressSection + ' input#s2member-pro-authnet-checkout-state').val ());
  499. var country = $(billingAddressSection + ' select#s2member-pro-authnet-checkout-country').val ();
  500. var zip = $.trim ($(billingAddressSection + ' input#s2member-pro-authnet-checkout-zip').val ());
  501. var /* Three part location. */ thisTaxLocation = state + '|' + country + '|' + zip;
  502. /**/
  503. if (state && country && zip && thisTaxLocation && (!cTaxLocation || cTaxLocation !== thisTaxLocation) && (cTaxLocation = thisTaxLocation))
  504. {
  505. (cTaxReq) ? /* Abort. */ cTaxReq.abort () : null, /* Clear. */ clearTimeout(cTaxTimeout), cTaxTimeout = null;
  506. /**/
  507. $ajaxTaxDiv.html ('<div><img src="<?php echo $vars["i"]; ?>/ajax-loader.gif" alt="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (_x ("Calculating Sales Tax...", "s2member-front", "s2member"))); ?>" /> <?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("calculating sales tax...", "s2member-front", "s2member")); ?></div>');
  508. /**/
  509. cTaxTimeout = setTimeout( /* Create a new cTaxTimeout with a one second delay. */function()
  510. {
  511. cTaxReq = $.post ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (admin_url ("/admin-ajax.php")); ?>', {'action': 'ws_plugin__s2member_pro_authnet_ajax_tax', 'ws_plugin__s2member_pro_authnet_ajax_tax': '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (c_ws_plugin__s2member_utils_encryption::encrypt ("ws-plugin--s2member-pro-authnet-ajax-tax")); ?>', 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[attr]': attr, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[state]': state, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[country]': country, 'ws_plugin__s2member_pro_authnet_ajax_tax_vars[zip]': zip}, function(response, textStatus)
  512. {
  513. clearTimeout /* Clear cTaxTimeout. */(cTaxTimeout), cTaxTimeout = null;
  514. /**/
  515. try /* Try/catch here. jQuery will sometimes return a successful response in IE, whenever the connection is aborted with a null response. */
  516. {
  517. /* 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. */
  518. $ajaxTaxDiv.html ('<div>' + $.sprintf ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("<strong>Sales Tax%s:</strong> %s<br /><strong>— Total%s:</strong> %s", "s2member-front", "s2member")); ?>', ((response.trial) ? ' ' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Today", "s2member-front", "s2member")); ?>' : ''), ((response.tax_per) ? '<em>' + response.tax_per + '</em> ( ' + response.cur_symbol + '' + response.tax + ' )' : response.cur_symbol + '' + response.tax), ((response.trial) ? ' ' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Today", "s2member-front", "s2member")); ?>' : ''), response.cur_symbol + '' + response.total) + '</div>');
  519. }
  520. catch (e) {}
  521. /**/
  522. }, 'json');
  523. /**/
  524. }, ((eventTrigger && eventTrigger.keyCode) ? 1000 : 100));
  525. }
  526. /**/
  527. else if (!state || !country || !zip || !thisTaxLocation)
  528. $ajaxTaxDiv.html (''), cTaxLocation = null;
  529. }
  530. }) ();
  531. /**/
  532. cTaxDelay = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  533. {
  534. setTimeout( /* Trigger event handler with a brief delay. */function()
  535. {
  536. calculateTax(eventTrigger);
  537. }, 10); /* Brief delay. */
  538. }
  539. /**/
  540. $(billingAddressSection + ' input#s2member-pro-authnet-checkout-state').bind ('keyup blur', calculateTax).bind ('cut paste', cTaxDelay);
  541. $(billingAddressSection + ' input#s2member-pro-authnet-checkout-zip').bind ('keyup blur', calculateTax).bind ('cut paste', cTaxDelay);
  542. $(billingAddressSection + ' select#s2member-pro-authnet-checkout-country').bind ('change', calculateTax);
  543. /**/
  544. setInterval( /* Helps with things like Google's Autofill feature. */function()
  545. {
  546. calculateTax /* Identify as interval trigger. */({interval: true});
  547. }, 1000);
  548. /**/
  549. (handlePasswordIssues = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  550. {
  551. if ($(submissionSection + ' input#s2member-pro-authnet-checkout-password-not-required-or-not-possible').length)
  552. {
  553. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-password-div').hide ();
  554. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-password-div :input').attr (ariaFalseDis);
  555. }
  556. }) ();
  557. /**/
  558. (handleExistingUsers = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  559. {
  560. if /* If User/Member is already logged in. */ (S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
  561. {
  562. $(registrationSection + ' input#s2member-pro-authnet-checkout-first-name').each (function()
  563. {
  564. var $this = $(this), val = $this.val ();
  565. (!val) ? $this.val (S2MEMBER_CURRENT_USER_FIRST_NAME) : null;
  566. });
  567. /**/
  568. $(registrationSection + ' input#s2member-pro-authnet-checkout-last-name').each (function()
  569. {
  570. var $this = $(this), val = $this.val ();
  571. (!val) ? $this.val (S2MEMBER_CURRENT_USER_LAST_NAME) : null;
  572. });
  573. /**/
  574. $(registrationSection + ' input#s2member-pro-authnet-checkout-email').val (S2MEMBER_CURRENT_USER_EMAIL).attr (ariaFalseDis);
  575. $(registrationSection + ' input#s2member-pro-authnet-checkout-username').val (S2MEMBER_CURRENT_USER_LOGIN).attr (ariaFalseDis);
  576. /**/
  577. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-password-div').hide ();
  578. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-password-div :input').attr (ariaFalseDis);
  579. /**/
  580. if ($.trim ($(registrationSection + ' > div#s2member-pro-authnet-checkout-form-registration-section-title').html ()) === '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Create Profile", "s2member-front", "s2member")); ?>')
  581. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-registration-section-title').html ('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Your Profile", "s2member-front", "s2member")); ?>');
  582. /**/
  583. $(customFieldsSection).hide (), $(customFieldsSection + ' :input').attr (ariaFalseDis);
  584. }
  585. }) ();
  586. /**/
  587. (handleBillingMethod = /* eventTrigger is passed by jQuery for DOM events. */ function(eventTrigger)
  588. {
  589. var billingMethod = /* Billing Method. */ $(cardType + ':checked').val ();
  590. /**/
  591. if ($.inArray (billingMethod, ['Visa', 'MasterCard', 'Amex', 'Discover']) !== -1)
  592. {
  593. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div').show ();
  594. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaTrue);
  595. /**/
  596. $(billingMethodSection + ' > div#s2member-pro-authnet-checkout-form-card-start-date-issue-number-div').hide ();
  597. $(billingMethodSection + ' > div#s2member-pro-authnet-checkout-form-card-start-date-issue-number-div :input').attr (ariaFalse);
  598. /**/
  599. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div').show ();
  600. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaTrue);
  601. /**/
  602. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  603. /**/
  604. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-checkout-card-number').focus () : null;
  605. }
  606. else if ($.inArray (billingMethod, ['Maestro', 'Solo']) !== -1)
  607. {
  608. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div').show ();
  609. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaTrue);
  610. /**/
  611. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div').show ();
  612. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaTrue);
  613. /**/
  614. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  615. /**/
  616. $(billingAddressSection).show (), (eventTrigger) ? $(billingMethodSection + ' input#s2member-pro-authnet-checkout-card-number').focus () : null;
  617. }
  618. else if /* Else there was no Billing Method supplied. */ (!billingMethod)
  619. {
  620. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div').hide ();
  621. $(billingMethodSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaFalse);
  622. /**/
  623. $(billingMethodSection + ' > div#s2member-pro-authnet-checkout-form-card-type-div').show ();
  624. $(billingMethodSection + ' > div#s2member-pro-authnet-checkout-form-card-type-div :input').attr (ariaTrue);
  625. /**/
  626. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div').hide ();
  627. $(billingAddressSection + ' > div.s2member-pro-authnet-checkout-form-div :input').attr (ariaFalse);
  628. /**/
  629. (!taxMayApply) ? /* Tax does NOT even apply. */ $ajaxTaxDiv.hide () : null;
  630. /**/
  631. $(billingAddressSection).hide (), (eventTrigger) ? $(submissionSection + ' input#s2member-pro-authnet-checkout-submit').focus () : null;
  632. }
  633. }) ();
  634. /**/
  635. $(cardType).click (handleBillingMethod).change (handleBillingMethod);
  636. /**/
  637. $(couponApplyButton).click ( /* Only applying coupon. */function()
  638. {
  639. $(submissionNonceVerification).val ('apply-coupon'), $coForm.submit ();
  640. });
  641. /**/
  642. $(registrationSection + ' > div#s2member-pro-authnet-checkout-form-password-div :input').keyup (function()
  643. {
  644. ws_plugin__s2member_passwordStrength($(registrationSection + ' input#s2member-pro-authnet-checkout-username'), $(registrationSection + ' input#s2member-pro-authnet-checkout-password1'), $(registrationSection + ' input#s2member-pro-authnet-checkout-password2'), $(registrationSection + ' div#s2member-pro-authnet-checkout-form-password-strength'));
  645. });
  646. /**/
  647. $coForm.submit ( /* Form validation. */function()
  648. {
  649. if ($(submissionNonceVerification).val () !== 'apply-coupon')
  650. {
  651. var context = this, label = '', error = '', errors = '';
  652. /**/
  653. var $recaptchaResponse = $(captchaSection + ' input#recaptcha_response_field');
  654. /**/
  655. var $password1 = $(registrationSection + ' input#s2member-pro-authnet-checkout-password1[aria-required="true"]');
  656. var $password2 = $(registrationSection + ' input#s2member-pro-authnet-checkout-password2');
  657. /**/
  658. if (!$(cardType + ':checked').val ())
  659. {
  660. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Please choose a Billing Method.", "s2member-front", "s2member")); ?>');
  661. /**/
  662. return false;
  663. }
  664. /**/
  665. $(':input', context).each ( /* Go through them all together. */function()
  666. {
  667. var id = /* Remove numeric suffixes. */ $.trim ($(this).attr ('id')).replace (/-[0-9]+$/g, '');
  668. /**/
  669. if (id && (label = $.trim ($('label[for="' + id + '"]', context).first ().children ('span').first ().text ().replace (/[\r\n\t]+/g, ' '))))
  670. {
  671. if (error = ws_plugin__s2member_validationErrors(label, this, context))
  672. errors += /* Collect errors. */ error + '\n\n';
  673. }
  674. });
  675. /**/
  676. if (errors = $.trim (errors))
  677. {
  678. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + errors);
  679. /**/
  680. return false;
  681. }
  682. /**/
  683. else if ($password1.length && $.trim ($password1.val ()) !== $.trim ($password2.val ()))
  684. {
  685. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Passwords do not match up. Please try again.", "s2member-front", "s2member")); ?>');
  686. /**/
  687. return false;
  688. }
  689. /**/
  690. else if /* Enforce minimum length requirement here. */ ($password1.length && $.trim ($password1.val ()).length < 6)
  691. {
  692. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Password MUST be at least 6 characters. Please try again.", "s2member-front", "s2member")); ?>');
  693. /**/
  694. return false;
  695. }
  696. /**/
  697. else if ($recaptchaResponse.length && !$recaptchaResponse.val ())
  698. {
  699. alert('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("— Oops, you missed something: —", "s2member-front", "s2member")); ?>' + '\n\n' + '<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Security Code missing. Please try again.", "s2member-front", "s2member")); ?>');
  700. /**/
  701. return false;
  702. }
  703. }
  704. /**/
  705. $(submissionButton).attr (disabled), ws_plugin__s2member_animateProcessing($(submissionButton)), $(couponApplyButton).attr (disabled);
  706. /**/
  707. return true;
  708. });
  709. }
  710. /**/
  711. (jumpToResponses = /* Jump to form responses. Make sure Customers see messages. */ function()
  712. {
  713. $('div#s2member-pro-authnet-form-response').each (function()
  714. {
  715. var offset = $(this).offset ();
  716. window.scrollTo (0, offset.top - 100);
  717. });
  718. }) ();
  719. });

s2member-pro\includes\separates\gateways\authnet\authnet.js

Source Code Documentation