コード例 #1
0
ファイル: AirtimeController.cs プロジェクト: Paelyt/Payorboro
        public ActionResult Checkout(string Biller, Paytv.PaytvObj paytv)
        {
            try
            {
                string user = LoggedInuser.LoggedInUser();

                if (user != null)
                {
                    Classes.Paytv.PaytvObj paytvs = new Paytv.PaytvObj();
                    string RefNum = Request.QueryString["RefNum"];
                    // RefNum = "payvice01137f85-e105-4839-936f-b14f53";
                    if (RefNum == null)
                    {
                        return(RedirectToAction("BuyAirtime", "Airtime"));
                    }
                    if (RefNum != null)
                    {
                        // if am here;
                        // var CusTransac = _dr.GetCustTransac(RefNum);
                        var CusTransac = _dr.GetRecord(RefNum);

                        // I Added This on 14/May/2019

                        ViewBag.Wallet = GetWalletBalance((int)CusTransac.Customer_FK);

                        // I Added This 27/Nov/2018
                        //paytvs.Phone = _dr.GetPhone(RefNum);
                        paytvs.Amount         = Convert.ToString(CusTransac.Amount);
                        paytvs.CustomerID     = CusTransac.CustomerID;
                        paytvs.Service        = CusTransac.ServiceDetails;
                        paytvs.ConvFee        = Convert.ToString(CusTransac.ServiceCharge);
                        paytvs.transactionlNo = CusTransac.ReferenceNumber;
                        paytvs.customerName   = CusTransac.CustomerName;
                        paytvs.Bouquet        = CusTransac.ServiceDetails;
                        paytvs.paymentType    = _dr.GetCustomerpaytype(RefNum);
                        string DiscoId = Convert.ToString(CusTransac.Merchant_FK);
                        paytvs.paymentType = _dr.GetCustomerpaytype(RefNum);
                        double Amount = Convert.ToDouble(paytvs.Amount);

                        /*  paytvs.Amount = "50";
                         * paytvs.CustomerID = "08077755537";
                         * paytvs.Service = "GLOVTV";
                         * paytvs.ConvFee = "20";
                         * paytvs.transactionlNo = "VTU122a39b7-202c-444e-92ad-967a6986";
                         * paytvs.customerName = "08077755537";
                         * paytvs.Bouquet = "GLOVTU";
                         * paytvs.paymentType = 1;
                         * string DiscoId = "1";
                         * paytvs.paymentType = 1;
                         * double Amount = Convert.ToDouble(paytvs.Amount);
                         */
                        //  string DiscoId = Convert.ToString(CusTransac.Merchant_FK);
                        if (Amount >= 50)
                        {
                            paytvs.ConvFee       = ConfigurationManager.AppSettings["NoConvFee"];
                            TempData["TotalAmt"] = Convert.ToDecimal(paytvs.ConvFee) + Convert.ToDecimal(paytvs.Amount);
                        }

                        return(View(paytvs));
                    }

                    paytv  = (Classes.Paytv.PaytvObj)ViewBag.PaytvObj;
                    paytvs = (Classes.Paytv.PaytvObj)TempData["PaytvObj"];
                    Biller = paytvs.BillerName;
                }
                return(View());
            }
            catch (Exception ex)
            {
                WebLog.Log(ex.Message.ToString());
                return(null);
            }
        }