using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebhookZunify.Controllers
{
    public class ZunifyController : Controller
    {
        // GET: Zunify/TransactionID
        public JsonResult TransactionID(Guid id)
        {
            bool scresult = false;
            string dbresult = "null";
            try
            {
                EKONO.LN.Logica logica = new EKONO.LN.Logica();
                string s_chargecode = id.ToString();
                string transactionid = logica.Get_ZunifyTranID(s_chargecode);
                if (String.IsNullOrEmpty(transactionid))
                {
                    scresult = false;
                    dbresult = "Not TransactionID";
                }
                else
                {
                    scresult = true;
                    dbresult = transactionid;
                }
            }
            catch (Exception e)
            {
                scresult = false;
                dbresult = e.Message;
            }

            return new JsonResult()
            {
                Data = new { success = scresult , data = dbresult },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };

        }

       


    }
}
