GenericScripts = {FaxFunnelErrorMessageResponse: function(data) { if (data.Errors[0].Field != null && data.Errors[0].Field.indexOf('customer.payment_method') == 0) { //billing problem //what type of billing error? try { $.each(data.Errors, function (index, result) { if (result.Field.indexOf('customer.payment_method.account_number') == 0) { $('.container-creditcard-number').addClass('has-error'); } else if (result.Field.indexOf('customer.payment_method.card_verification_code') == 0) { $('.container-creditcard-cvv').addClass('has-error'); } else if (result.Field.indexOf('customer.payment_method.card_expiration_month') == 0) { $('.container-creditcard-exp').addClass('has-error'); } }); } catch (e) { //TODO:log error } global.showErrorMessage(Messages.Get(MessagesType.BillingErrorMessage, language)); } else if (data.Errors[0].ErrorCode != null && data.Errors[0].ErrorCode.indexOf('DUPLICATED_EMAIL') == 0) { global.showErrorMessage(Messages.Get(MessagesType.DuplicateEmailBilling, language)); $(window).scrollTop($(".has-error").offset()); } else if (data.Errors[0].ErrorCode != null && (data.Errors[0].Field != null && data.Errors[0].Field.indexOf('customer.address.postal_code') == 0)) { global.showErrorMessage(Messages.Get(MessagesType.PostalCode, language)); $(window).scrollTop($(".has-error").offset()); } else if (data.Errors[0].ErrorCode != null && data.Errors[0].ErrorCode.indexOf('reCaptchaValidationError') == 0) { if (grecaptcha != undefined) { grecaptcha.reset(); } global.showErrorMessage(data.Errors[0].DeveloperMessage); $(window).scrollTop($(".has-error").offset()); } else if (data.Errors[0].ErrorCode != null && data.Errors[0].ErrorCode.indexOf('BotAttack') == 0) { global.disableButton(); global.redirect('/'); } else if (data.Errors[0].ErrorCode != null && data.Errors[0].ErrorCode.indexOf('DID_NOT_AVAILABLE') == 0) { eFaxEU.showSessionModal(); } else { global.showErrorMessage(Messages.Get(MessagesType.GeneralErrorMessage, language)); } }};