(function() { var paymentBox = new IATSPaymentBox(); paymentBox.installJavaScript('https://www.iatspayments.com/PaymentBox/js/iats_Calendar_us.js?v=170614'); paymentBox.installStyleSheet('https://www.iatspayments.com/PaymentBox/css/tcal.css?v=170614&cb=46663'); paymentBox.installJavaScriptAuraBox(decodeURIComponent('https://www.iatspayments.com/PaymentBox/IATSPaymentBoxCore.aspx?PID=PA68D88A7E59634F1A&Version=NA&cb=46663') + GetClientParameters()); paymentBox.installJavaScript('https://www.google.com/recaptcha/api.js?render=6LfN34AsAAAAALrWY1qTu7GgptB5umAUATL3JKB1'); })(); function IATSPaymentBox() { this.installJavaScript = InstallJavaScript; this.installStyleSheet = InstallStyleSheet; this.installJavaScriptAuraBox = InstallJavaScriptAuraBox; this.startScript = StartScript; } function InstallJavaScript(scriptURL) { var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); var caller = this; script.type= 'text/javascript'; script.onreadystatechange= function () { if (this.readyState == 'complete' || this.readyState == 'loaded') caller.startScript(); } script.onload= this.startScript; script.src= scriptURL; head.appendChild(script); } function InstallJavaScriptAuraBox(scriptURL) { var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); var caller = this; script.type= 'text/javascript'; script.src= scriptURL; head.appendChild(script); } function InstallStyleSheet(styleSheetLink) { var theStyleSheet; var head= document.getElementsByTagName('head')[0]; var linksarray = document.getElementsByTagName("link"); for ( var i in linksarray) { if (linksarray[i].href === styleSheetLink) { return; } } theStyleSheet = document.createElement('link'); theStyleSheet.setAttribute('type', 'text/css'); theStyleSheet.setAttribute('href', styleSheetLink); theStyleSheet.setAttribute('rel', 'stylesheet'); head.appendChild(theStyleSheet); theStyleSheet = null; }; function StartScript() { } function initRecaptchaV3() { if (typeof grecaptcha !== 'undefined' && theIATSPaymentBoxCore && theIATSPaymentBoxCore.enableCAPTCHA == "1") { grecaptcha.ready(function() { // Generate token on page load for initial form submission grecaptcha.execute('', {action: 'page_load'}) .then(function(token) { // Store token for later use if (!document.getElementById('g-recaptcha-response-v3')) { var input = document.createElement('input'); input.type = 'hidden'; input.id = 'g-recaptcha-response-v3'; input.name = 'g-recaptcha-response-v3'; input.value = token; document.body.appendChild(input); } else { document.getElementById('g-recaptcha-response-v3').value = token; } }); }); } } function executeRecaptchaV3ForSubmit(callback) { if (typeof grecaptcha !== 'undefined' && theIATSPaymentBoxCore && theIATSPaymentBoxCore.enableCAPTCHA == "1") { grecaptcha.ready(function() { grecaptcha.execute('', {action: 'payment_submit'}) .then(function(token) { // Update token if (document.getElementById('g-recaptcha-response-v3')) { document.getElementById('g-recaptcha-response-v3').value = token; } // Call the callback to continue processing if (callback) callback(); }); }); } else { // No CAPTCHA or not ready, continue anyway if (callback) callback(); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initRecaptchaV3); } else { setTimeout(initRecaptchaV3, 1000); } function GetClientParameters() { var ClientParameters = ""; var dest = window.location.href; if (dest.indexOf('?')>=0) { dest = dest.substring(dest.indexOf('?')+1); ClientParameters = "&ClientParameters=" + encodeURIComponent(dest); } return ClientParameters; } function IsScriptLoaded(scr) { var scripts = document.getElementsByTagName('script'); for (var i = scripts.length; i--;) { if (scripts[i].src.indexOf(scr) !== -1) return true; } return false; }