public ActionResult ValidateVatNumber(string sEcho, string countryCode, string VATNumber)
{
JsonResult result;
try
{
var service = GeneralHelper.GetPublicOrderService(this.HttpContext.ApplicationInstance.Context);
VatNumberValidationResultType valResult = service.ValidateVatNumber(countryCode, VATNumber);
var dataToReturn = new { sEcho, validationResult = valResult.ToString().ToLower(), error = string.Empty, success = true };
result = Json(dataToReturn, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
OrderPageLogger.LogOrderPageException(ex);
var dataToReturn = new
{
sEcho,
validationResult = string.Empty,
error = this.LocalResource("Select", "VATValidationResultNotValidated"), // ex.Message,
success = false
};
result = Json(dataToReturn, JsonRequestBehavior.AllowGet);
}
return result;
}