diff --git a/js/authorizenetwebform.js b/js/authorizenetwebform.js index 662cf864b62e8745c1735ecbe8a435a0a1dfa4b4..5d32431038ab8dd029a823478b7e2939df2f9f48 100644 --- a/js/authorizenetwebform.js +++ b/js/authorizenetwebform.js @@ -42,7 +42,11 @@ secureData.authData = authData; - Accept.dispatchData(secureData, 'responseHandler'); + // @todo remove this stupid delay when AuthNet gets their act together. + // https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/58879/page/2 + setTimeout(function() { + Accept.dispatchData(secureData, 'responseHandler'); + }, Drupal.settings.authorizeNetWebform.delay); // Prevent the webform from submitting now. @see last line. e.preventDefault(); @@ -126,12 +130,8 @@ } } - // @todo remove this stupid delay when AuthNet gets their act together. - // https://community.developer.authorize.net/t5/Integration-and-Testing/E00114-Invalid-OTS-Token/td-p/58879/page/2 - setTimeout(function() { - // Submit the webform when done. - $(context).find("[data-authnet-form]").submit(); - }, Drupal.settings.authorizeNetWebform.delay); + // Submit the webform when done. + $(context).find("[data-authnet-form]").submit(); } });