Exemplo n.º 1
0
        public ActionResult PurchaseResults(string mydata)
        {
            var nvc = HttpUtility.ParseQueryString(mydata);
            var paymentResponseContaner = new dsiPDCXListener.Models.PaymentResponseContainer();

            var config = new dsiPDCXListener.Infrastructure.ConfigHelper();

            var configData = new dsiPDCXListener.Models.ConfigurationData();

            configData.MerchantAddress    = config.MerchantAddress;
            configData.MerchantCity       = config.MerchantCity;
            configData.MerchantName       = config.MerchantName;
            configData.MerchantPostalCode = config.MerchantPostalCode;
            configData.MerchantState      = config.MerchantState;
            configData.PostURL            = HttpContext.Application["PostURL"].ToString();
            configData.TranDeviceID       = HttpContext.Application["TranDeviceID"].ToString();
            configData.ComPort            = HttpContext.Application["ComPort"].ToString();
            configData.SecureDevice       = HttpContext.Application["SecureDevice"].ToString();
            configData.MerchantID         = HttpContext.Application["MerchantID"].ToString();


            var paymentResponseData = new dsiPDCXListener.Models.PaymentResponseData();

            paymentResponseData.AcctNo         = nvc["AcctNo"];
            paymentResponseData.AuthCode       = nvc["AuthCode"];
            paymentResponseData.Authorize      = nvc["Authorize"];
            paymentResponseData.CaptureStatus  = nvc["CaptureStatus"];
            paymentResponseData.CardType       = nvc["CardType"];
            paymentResponseData.CmdStatus      = nvc["CmdStatus"];
            paymentResponseData.DSIXReturnCode = nvc["DSIXReturnCode"];
            paymentResponseData.InvoiceNo      = nvc["InvoiceNo"];
            paymentResponseData.MerchantID     = nvc["MerchantID"];
            paymentResponseData.Purchase       = nvc["Purchase"];
            paymentResponseData.RecordNo       = nvc["RecordNo"];
            paymentResponseData.RefNo          = nvc["RefNo"];
            paymentResponseData.ResponseOrigin = nvc["ResponseOrigin"];
            paymentResponseData.TextResponse   = nvc["TextResponse"];
            paymentResponseData.TranCode       = nvc["TranCode"];

            paymentResponseContaner.PaymentResponseData = paymentResponseData;
            paymentResponseContaner.ConfigurationData   = configData;

            ViewBag.Message = paymentResponseData.CmdStatus;

            return(View(paymentResponseContaner));
        }
        public ActionResult Pizza()
        {
            ViewBag.Message = "Pizza";

            var config = new dsiPDCXListener.Infrastructure.ConfigHelper();

            var configData = new dsiPDCXListener.Models.ConfigurationData();
            configData.MerchantAddress = config.MerchantAddress;
            configData.MerchantCity = config.MerchantCity;            
            configData.MerchantName = config.MerchantName;
            configData.MerchantPostalCode = config.MerchantPostalCode;
            configData.MerchantState = config.MerchantState;
            configData.PostURL = HttpContext.Application["PostURL"].ToString();
            configData.PostURLMethod = HttpContext.Application["PostURLMethod"].ToString();
            configData.ComPort = HttpContext.Application["ComPort"].ToString();
            configData.SecureDevice = HttpContext.Application["SecureDevice"].ToString();
            configData.MerchantID = HttpContext.Application["MerchantID"].ToString();

            configData.IncludeAlerts = HttpContext.Application["IncludeAlerts"].ToString();

            if (configData.PostURLMethod == "method1")
            {
                configData.PrintReceiptMessage = config.PrintReceiptMessageMethod1;
                configData.PrintPoleDisplayMessage = config.PrintPoleDisplayMessageMethod1;
                configData.CashDrawerMessage = config.CashDrawerMessageMethod1;
                configData.SaleMessage = config.SaleMessageMethod1;
                configData.ContentType = config.ContentTypeMethod1;

                configData.TranDeviceID = (HttpContext.Application["TranDeviceID"].ToString().Length == 0) ? string.Empty : "<TranDeviceID>" + HttpContext.Application["TranDeviceID"].ToString() + "</TranDeviceID>";

                if ((bool)(HttpContext.Application["IncludeRecordNoAndFrequency"]))
                {
                    configData.IncludeRecordNoAndFrequency = config.RecordNoFrequencyMethod1;
                }
                else
                {
                    configData.IncludeRecordNoAndFrequency = string.Empty;
                }

            }
            else
            {
                configData.PrintReceiptMessage = config.PrintReceiptMessageMethod4;
                configData.PrintPoleDisplayMessage = config.PrintPoleDisplayMessageMethod4;
                configData.CashDrawerMessage = config.CashDrawerMessageMethod4;
                configData.SaleMessage = config.SaleMessageMethod4;
                configData.ContentType = config.ContentTypeMethod4;

                configData.TranDeviceID = (HttpContext.Application["TranDeviceID"].ToString().Length == 0) ? string.Empty : "TranDeviceID=" + HttpContext.Application["TranDeviceID"].ToString() + "&";

                if ((bool)(HttpContext.Application["IncludeRecordNoAndFrequency"]))
                {
                    configData.IncludeRecordNoAndFrequency = config.RecordNoFrequencyMethod4;
                }
                else
                {
                    configData.IncludeRecordNoAndFrequency = string.Empty;
                }

            }
 
            return View(configData);
        }
        public ActionResult PurchaseResults(string mydata)
        {
            var nvc = HttpUtility.ParseQueryString(mydata);
            var paymentResponseContaner = new dsiPDCXListener.Models.PaymentResponseContainer();

            var config = new dsiPDCXListener.Infrastructure.ConfigHelper();

            var configData = new dsiPDCXListener.Models.ConfigurationData();
            configData.MerchantAddress = config.MerchantAddress;
            configData.MerchantCity = config.MerchantCity;
            configData.MerchantName = config.MerchantName;
            configData.MerchantPostalCode = config.MerchantPostalCode;
            configData.MerchantState = config.MerchantState;
            configData.PostURL = HttpContext.Application["PostURL"].ToString();
            configData.TranDeviceID = HttpContext.Application["TranDeviceID"].ToString();
            configData.ComPort = HttpContext.Application["ComPort"].ToString();
            configData.SecureDevice = HttpContext.Application["SecureDevice"].ToString();
            configData.MerchantID = HttpContext.Application["MerchantID"].ToString();


            var paymentResponseData = new dsiPDCXListener.Models.PaymentResponseData();
            paymentResponseData.AcctNo = nvc["AcctNo"];
            paymentResponseData.AuthCode = nvc["AuthCode"];
            paymentResponseData.Authorize = nvc["Authorize"];
            paymentResponseData.CaptureStatus = nvc["CaptureStatus"];
            paymentResponseData.CardType = nvc["CardType"];
            paymentResponseData.CmdStatus = nvc["CmdStatus"];
            paymentResponseData.DSIXReturnCode = nvc["DSIXReturnCode"];
            paymentResponseData.InvoiceNo = nvc["InvoiceNo"];
            paymentResponseData.MerchantID = nvc["MerchantID"];
            paymentResponseData.Purchase = nvc["Purchase"];
            paymentResponseData.RecordNo = nvc["RecordNo"];
            paymentResponseData.RefNo = nvc["RefNo"];
            paymentResponseData.ResponseOrigin = nvc["ResponseOrigin"];
            paymentResponseData.TextResponse = nvc["TextResponse"];
            paymentResponseData.TranCode = nvc["TranCode"];

            paymentResponseContaner.PaymentResponseData = paymentResponseData;
            paymentResponseContaner.ConfigurationData = configData;

            ViewBag.Message = paymentResponseData.CmdStatus;

            return View(paymentResponseContaner);
        }
Exemplo n.º 4
0
        public ActionResult Pizza()
        {
            ViewBag.Message = "Pizza";

            var config = new dsiPDCXListener.Infrastructure.ConfigHelper();

            var configData = new dsiPDCXListener.Models.ConfigurationData();

            configData.MerchantAddress    = config.MerchantAddress;
            configData.MerchantCity       = config.MerchantCity;
            configData.MerchantName       = config.MerchantName;
            configData.MerchantPostalCode = config.MerchantPostalCode;
            configData.MerchantState      = config.MerchantState;
            configData.PostURL            = HttpContext.Application["PostURL"].ToString();
            configData.PostURLMethod      = HttpContext.Application["PostURLMethod"].ToString();
            configData.ComPort            = HttpContext.Application["ComPort"].ToString();
            configData.SecureDevice       = HttpContext.Application["SecureDevice"].ToString();
            configData.MerchantID         = HttpContext.Application["MerchantID"].ToString();

            configData.IncludeAlerts = HttpContext.Application["IncludeAlerts"].ToString();

            if (configData.PostURLMethod == "method1")
            {
                configData.PrintReceiptMessage     = config.PrintReceiptMessageMethod1;
                configData.PrintPoleDisplayMessage = config.PrintPoleDisplayMessageMethod1;
                configData.CashDrawerMessage       = config.CashDrawerMessageMethod1;
                configData.SaleMessage             = config.SaleMessageMethod1;
                configData.ContentType             = config.ContentTypeMethod1;

                configData.TranDeviceID = (HttpContext.Application["TranDeviceID"].ToString().Length == 0) ? string.Empty : "<TranDeviceID>" + HttpContext.Application["TranDeviceID"].ToString() + "</TranDeviceID>";

                if ((bool)(HttpContext.Application["IncludeRecordNoAndFrequency"]))
                {
                    configData.IncludeRecordNoAndFrequency = config.RecordNoFrequencyMethod1;
                }
                else
                {
                    configData.IncludeRecordNoAndFrequency = string.Empty;
                }
            }
            else
            {
                configData.PrintReceiptMessage     = config.PrintReceiptMessageMethod4;
                configData.PrintPoleDisplayMessage = config.PrintPoleDisplayMessageMethod4;
                configData.CashDrawerMessage       = config.CashDrawerMessageMethod4;
                configData.SaleMessage             = config.SaleMessageMethod4;
                configData.ContentType             = config.ContentTypeMethod4;

                configData.TranDeviceID = (HttpContext.Application["TranDeviceID"].ToString().Length == 0) ? string.Empty : "TranDeviceID=" + HttpContext.Application["TranDeviceID"].ToString() + "&";

                if ((bool)(HttpContext.Application["IncludeRecordNoAndFrequency"]))
                {
                    configData.IncludeRecordNoAndFrequency = config.RecordNoFrequencyMethod4;
                }
                else
                {
                    configData.IncludeRecordNoAndFrequency = string.Empty;
                }
            }

            return(View(configData));
        }