Example #1
0
 public ActionResult WalletReceipt()
 {
     try
     {
         Classes.Paytv.Receipt Receipt = new Classes.Paytv.Receipt();
         string RefNum = Request.QueryString["RefNum"];
         if (RefNum == null)
         {
             return(RedirectToAction("BuyAirtime", "Airtime"));
         }
         if (RefNum != null)
         {
             TempData["ErrMsg"] = "Transaction successful ! Thank You";
             var CusTransac = _dr.GetRecord(RefNum);
             Receipt.CustomerID     = CusTransac.CustomerID;
             Receipt.Amount         = Convert.ToDouble(CusTransac.Amount);
             TempData["Amount"]     = Receipt.Amount;
             Receipt.customerName   = CusTransac.CustomerName;
             Receipt.Phone          = CusTransac.CustomerPhone;
             Receipt.transactionlNo = CusTransac.ReferenceNumber;
             Receipt.Service        = CusTransac.ServiceDetails;
             Receipt.ErrorMsg       = TempData["ErrMsg"].ToString();
         }
         return(View(Receipt));
     }
     catch (Exception ex)
     {
         WebLog.Log(ex.Message.ToString());
         return(null);
     }
 }
Example #2
0
 public ActionResult GetPaymentResponse()
 {
     try
     {
         string RefNum = Request.QueryString["trxRef"];
         WebLog.Log("0");
         ProcessResponse();
         WebLog.Log("4");
         Classes.Paytv.Receipt Receipt = new Classes.Paytv.Receipt();
         dynamic RecieptObj            = new JObject();
         if (TempData["ErrMsg"] != null)
         {
             Receipt.ErrorMsg = TempData["ErrMsg"].ToString();
             WebLog.Log("5" + Receipt.ErrorMsg);
         }
         //string RefNum = Request.QueryString["trxRef"];
         Receipt.ErrorMsg = TempData["ErrMsg"].ToString();
         WebLog.Log("6" + Receipt.ErrorMsg);
         var RecieptVal = _dr.GetCustReceipt(RefNum);
         WebLog.Log("7" + RecieptVal);
         Receipt.CustomerID = RecieptVal[0];
         WebLog.Log("8" + Receipt.CustomerID);
         // Receipt.Amount = Convert.ToDouble(RecieptVal[3]);
         Receipt.Amount = 0;
         WebLog.Log("9" + Receipt.Amount);
         Receipt.ServiceCharge = Convert.ToDouble(RecieptVal[2]);
         WebLog.Log("Receipt.ServiceCharge" + Receipt.ServiceCharge);
         // Receipt.ServiceCharge = Convert.ToDouble("0");
         Receipt.CustomerName = RecieptVal[1];
         WebLog.Log("Receipt.CustomerName" + Receipt.CustomerName);
         Receipt.Phone = RecieptVal[5];
         WebLog.Log("Receipt.Phone" + Receipt.Phone);
         Receipt.ReferenceNumber = RecieptVal[6];
         WebLog.Log("Receipt.refrence" + Receipt.ReferenceNumber);
         Receipt.ServiceDetails = RecieptVal[7];
         WebLog.Log("Receipt.ServiceDetails" + Receipt.ServiceDetails);
         string Discoid = RecieptVal[8];
         WebLog.Log("Discoid" + Discoid);
         string img         = LoadImage(Discoid);
         string imgName     = getDiscoName(Discoid);
         Double TotalAmount = Convert.ToDouble(Receipt.ServiceCharge + Receipt.Amount);
         TempData["Amount"]     = TotalAmount;
         TempData["message"]    = img;
         TempData["BillerName"] = imgName;
         return(View(Receipt));
     }
     catch (Exception ex)
     {
         WebLog.Log(ex.Message.ToString());
         return(null);
     }
 }
Example #3
0
        public ActionResult GetPaymentResponse()
        {
            try
            {
                ProcessResponse();
                Classes.Paytv.Receipt Receipt = new Classes.Paytv.Receipt();
                dynamic RecieptObj            = new JObject();
                if (TempData["ErrMsg"] != null)
                {
                    TempData["ErrMsg"] = "transaction Not Succesfull. Please Contact Our Customer Care Representative ";
                }
                string RefNum = Request.QueryString["trxRef"];

                var RecieptVal = _dr.GetCustReceipt(RefNum);

                Receipt.CustomerID      = RecieptVal[0];
                Receipt.Amount          = Convert.ToDouble(RecieptVal[3]);
                Receipt.ServiceCharge   = Convert.ToDouble(RecieptVal[2]);
                Receipt.CustomerName    = RecieptVal[1];
                Receipt.Phone           = RecieptVal[5];
                Receipt.ReferenceNumber = RecieptVal[6];
                Receipt.ServiceDetails  = RecieptVal[7];
                string Discoid     = RecieptVal[8];
                string img         = LoadImage(Discoid);
                string imgName     = getDiscoName(Discoid);
                Double TotalAmount = Convert.ToDouble(Receipt.ServiceCharge + Receipt.Amount);
                TempData["Amount"]     = TotalAmount;
                TempData["message"]    = img;
                TempData["BillerName"] = imgName;
                // I Added This One

                string Biller = "6";
                TempData["message"]    = LoadImage(Biller);
                TempData["BillerName"] = getDiscoName(Biller);
                return(View(Receipt));
            }
            catch (Exception ex)
            {
                WebLog.Log(ex.Message.ToString());
                return(null);
            }
        }