示例#1
0
        protected void btnSearchTransaction_Click(object sender, EventArgs e)
        {
            if ((Session["merchant_type"] != null) && (Session["merchant_type"].ToString() != ""))
            {
                merchant_type = Session["merchant_type"].ToString();
            }

            string MerchantReference = "";

                MerchantReference = txt_trans.Text.Trim();

                lt_ri = ret.getChargeBackReportItemByMerchantRefD(MerchantReference);

            Session["grand_tot_cnt"] = lt_ri.Count;
            if (lt_ri.Count > 0)
            {
                lt_ri[0].isw_amt = Math.Round(Convert.ToDouble(lt_ri[0].isw_amt), 2).ToString();
                tm_cnt = lt_ri.Count;
                Session["tm_cnt"] = tm_cnt;
                foreach (XObjs.ReportItem item in lt_ri)
                {
                    if (item.item_code.Contains("T"))
                    {
                        lt_pw = t.getStageByClientIDAcc(item.newtransID);
                        if (lt_pw.Count > 0)
                        {
                            SortedList<string, string> x = c_as.showTmStatus(lt_pw[0].status, lt_pw[0].data_status);
                            status = x["status"];
                            data_status = x["data_status"];
                        }
                    }
                    else if (item.item_code.Contains("P"))
                    {
                        lt_pw = t.getPtStageByClientIDAcc(item.newtransID);
                        if (lt_pw.Count > 0)
                        {
                            SortedList<string, string> x = c_as.showPtStatus(lt_pw[0].status, lt_pw[0].data_status);
                            status = x["status"];
                            data_status = x["data_status"];
                        }
                    }
                    //else if (item.item_code.Contains("D"))
                    //{
                    //    lt_pw = t.getDsStageByClientIDAcc(item.newtransID);
                    //    if (lt_pw.Count > 0)
                    //    {
                    //if (lt_pw.Count > 0)
                    //{
                    //    SortedList<string, string> x = c_as.showPtStatus(lt_pw[0].status, lt_pw[0].data_status);
                    //    status = x["status"];
                    //    data_status = x["data_status"];
                    //}
                    //    }
                    //}
                    item.total_amt = Convert.ToString((int)(Convert.ToDouble(item.init_amt) + Convert.ToDouble(item.isw_amt)));
                    grand_tot_amt += Convert.ToInt32(item.total_amt);
                    item.office_status = status +" Office";
                    item.data_status = "";
                    item.payment_status = "";
                    item.init_amt = string.Format("{0:n}", Convert.ToInt32(item.init_amt));
                    item.isw_amt = string.Format("{0:n}", Convert.ToDouble(item.isw_amt));
                    item.tech_amt = string.Format("{0:n}", Convert.ToInt32(item.tech_amt));
                    item.total_amt = string.Format("{0:n}", Convert.ToInt32(item.total_amt) + Convert.ToDouble(item.isw_amt));

                    isw_fields = ret.getISWtransactionByTransactionID(item.transID);
                    twall = ret.getTwalletByTransID(item.transID);
                    isw_fields.TransactionDate = isw_fields.TransactionDate.Substring(0, 11).Trim();
                    string xgt = twall.xgt;
                    c_app = ret.getApplicantByID(twall.applicantID);

                }
                Session["lt_ri"] = lt_ri;
                gvTm.DataSource = lt_ri;
                gvTm.DataBind();
                new_grand_tot_amt = string.Format("{0:n}", grand_tot_amt);
                Session["new_grand_tot_amt"] = new_grand_tot_amt;
                show_details_grid = 0;
                show_details_grid_wingman = 0;
                show_inv = 0;
            }
            else
            {
                show_inv = 1;
            }
        }
示例#2
0
文件: pay_his.cs 项目: ozotony/payx
        protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "TmDetailsClick")
            {
                GridViewRow namingContainer = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int rowIndex = namingContainer.RowIndex;
                string transID = e.CommandArgument.ToString();
                Session["transID"] = transID;
                twall = ret.getTwalletByTransID(transID);

                if (twall.xid != null)
                {
                    isw_fields = ret.getISWtransactionByTransactionID(transID);
                    isw_fields.TransactionDate = isw_fields.TransactionDate.Substring(0, 11).Trim();
                    string xgt = twall.xgt;
                    lt_fdets = ret.getFee_detailsByTwalletID(twall.xid);
                    c_app = ret.getApplicantByID(twall.applicantID);
                    Session["c_app"] = c_app;
                    Session["AgentType"] = twall.xmembertype;
                    Session["transID"] = transID;
                    Session["memberID"] = adminID;
                    Session["transDate"] = twall.xreg_date;
                    if (twall.xmembertype == "Agent")
                    {
                        c_reg = ret.getRegistrationByID(twall.xmemberID);
                        fullname = c_reg.Firstname + " " + c_reg.Surname;
                        coy_name = c_reg.CompanyName;
                        cust_id = c_reg.Sys_ID;
                        email = c_reg.Email;
                        mobile = c_reg.PhoneNumber;
                        Session["coy_name"] = coy_name;
                        Session["fullname"] = fullname;
                        Session["email"] = email;
                        Session["mobile"] = mobile;
                        Session["c_addy"] = c_reg.CompanyAddress;
                    }
                    else
                    {
                        c_sub = ret.getSubAgentByID(twall.xmemberID);
                        fullname = c_sub.Firstname + " " + c_sub.Surname;
                        email = c_sub.Email;
                        mobile = c_sub.Telephone;
                        if (c_sub.xid != null)
                        {
                            c_sub_reg = ret.getRegistrationByID(c_sub.RegistrationID);
                            coy_name = c_sub_reg.CompanyName;
                            cust_id = c_sub_reg.Sys_ID + "_" + c_sub.AssignID;
                        }
                    }
                    c_ai.code = cust_id;
                    c_ai.xname = fullname;
                    c_ai.xemail = email;
                    c_ai.xmobile = mobile;

                    Session["c_ai"] = c_ai;

                    if (xgt == "xpay_bk")
                    {
                        Session["payment_type"] = "Bank";
                        c_banker = ret.getBankerByID(ret.getPwalletByID(twall.xbankerID).xmemberID);
                        Session["bank_xname"] = c_banker.xname;
                        Session["bank_bankname"] = c_banker.bankname;
                        Session["bank_xposition"] = c_banker.xposition;
                        Session["bank_street"] = ret.getAddressByID(c_banker.addressID).street;
                        Session["bank_telephone"] = ret.getAddressByID(c_banker.addressID).telephone1;
                        Session["bank_email"] = ret.getAddressByID(c_banker.addressID).email1;
                    }
                    else if (xgt == "xpay_isw")
                    {
                        Session["payment_type"] = "Online (Inter Switch)";
                    }
                    else
                    {
                        Session["payment_type"] = "Online";
                    }
                    show_inv = 1;
                    if (Session["tm_cnt"] != null)
                    {
                        tm_cnt = Convert.ToInt32(Session["tm_cnt"]);
                    }
                    show_details_grid = 1;
                }
            }
        }
示例#3
0
文件: index.cs 项目: ozotony/payx
        protected void Page_Load(object sender, EventArgs e)
        {
            kkx = null;

            if ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != ""))
            {
                adminID = Session["pwalletID"].ToString();
            }
            else
            {
                Response.Redirect(ConfigurationManager.AppSettings["agent_home"]);
            }
            if (Session["fullname"] != null)
            {
                fullname = Session["fullname"].ToString();
            }
            if (Session["email"] != null)
            {
                email = Session["email"].ToString();
            }
            if (Session["mobile"] != null)
            {
                mobile = Session["mobile"].ToString();
            }
            if (Session["cust_id"] != null)
            {
                cust_id = Session["cust_id"].ToString();
            }
            xstring = new StringBuilder();
            product_id = ConfigurationManager.AppSettings["pd_product_id"];
            mackey = ConfigurationManager.AppSettings["pd_mackey"];
            check_trans_page = ConfigurationManager.AppSettings["pd_get_trans_json_page"];
            if ((Request.Form["txnRef"] != null) && (Request.Form["txnRef"] != ""))
            {
                txnref = Request.Form["txnRef"].ToString();
                Session["transID"] = txnref;
            }
            if ((Request.Form["payRef"] != null) && (Request.Form["payRef"] != ""))
            {
                payRef = Request.Form["payRef"].ToString();
            }
            if ((Request.Form["retRef"] != null) && (Request.Form["retRef"] != ""))
            {
                retRef = Request.Form["retRef"].ToString();
            }
            if ((Request.Form["cardNum"] != null) && (Request.Form["cardNum"] != ""))
            {
                cardNum = Request.Form["cardNum"].ToString();
            }
            if ((Request.Form["apprAmt"] != null) && (Request.Form["apprAmt"] != ""))
            {
                apprAmt = Request.Form["apprAmt"].ToString();
            }
            if ((Request.Form["resp"] != null) && (Request.Form["resp"] != ""))
            {
                resp = Request.Form["resp"].ToString();
            }
            if ((Request.Form["desc"] != null) && (Request.Form["desc"] != ""))
            {
                desc = Request.Form["desc"].ToString();
            }
            if (!IsPostBack)
            {
                Session["vitem_code"] = null;
                c_twall = ret.getTwalletByTransIDAdminID(txnref, adminID);
                c_app = ret.getApplicantByID(c_twall.applicantID);
                isw_fields = ret.getISWtransactionByTransactionID(txnref.Trim());
                if (c_twall.xid != null)
                {
                    Session["c_twall"] = c_twall;
                    lt_fdets = ret.getFee_detailsByTwalletID(c_twall.xid);
                    if (lt_fdets.Count > 0)
                    {
                        Session["lt_fdets"] = lt_fdets;
                    }
                    lt_hwall = ret.getHwalletByTransID(txnref);
                    int num = 1;
                    int num2 = 0;
                    XObjs.Registration  c_reg2 = (XObjs.Registration)Session["c_reg"];
                 vid = c_reg2.xid;
                    foreach (XObjs.Hwallet hwallet in lt_hwall)
                    {
                        XObjs.PaymentReciept item = new XObjs.PaymentReciept();
                        XObjs.Fee_list _list = new XObjs.Fee_list();
                        XObjs.Fee_details _details = new XObjs.Fee_details();
                        _details = ret.getFee_detailsByID(hwallet.fee_detailsID);
                        _list = ret.getFee_listByID(_details.fee_listID);
                        item.sn = num.ToString();
                        item.item_code = _list.item_code;

                        if (item.item_code == "AA1")
                        {

                            Session["vitem_code"] = "AA1";
                        }
                        item.item_desc = _list.xdesc;
                        item.init_amt = string.Format("{0:n}", Convert.ToInt32(_details.init_amt));
                        item.tech_amt = string.Format("{0:n}", Convert.ToInt32(_details.tech_amt));
                        item.qty = string.Format("{0:n}", 1);
                        int num3 = Convert.ToInt32(_details.init_amt) + Convert.ToInt32(_details.tech_amt);
                        item.tot_amount = string.Format("{0:n}", num3);
                        item.transID = hwallet.transID + "-" + hwallet.fee_detailsID + "-" + hwallet.xid;
                        num2 += num3;
                        Session["amt"] = num2;
                        total_amt = string.Format("{0:n}", num2 + Math.Round(Convert.ToDouble(isw_fields.isw_conv_fee), 2));
                        Session["total_amt"] = total_amt;
                        lt_pr.Add(item);
                        num++;
                    }
                }
                xstring.AppendLine("Transaction reference= " + txnref + " Payment reference= " + payRef + " Switching Bank Reference number= " + retRef + " card No= " + cardNum + " apprAmt= " + apprAmt);
                inputString = product_id.Trim() + txnref.Trim() + mackey.Trim();
                string headerValue = hash_value.GetGetSHA512String(inputString);

                isr = tx.myRedirect(check_trans_page.Trim() + "?productid=" + product_id.Trim() + "&transactionreference=" + txnref.Trim() + "&amount=" + isw_fields.amount.Trim(), "Hash", headerValue.Trim());

                if (((isr.ResponseCode != "") && (isr.ResponseCode != null)) && (isr.ResponseCode == "00"))
                {
                    err_desc = eh.getErrorDesc(isr.ResponseCode);
                    if (((err_desc != "") && (err_desc != null)) && (err_desc != "NA"))
                    {
                        isr.ResponseDescription = err_desc;
                    }
                    xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + isr.Amount + "\r\n CardNumber: " + isr.CardNumber + "\r\n MerchantReference: " + isr.MerchantReference + "\r\n PaymentReference: " + isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + isr.LeadBankCbnCode + "\r\n TransactionDate: " + isr.TransactionDate + "\r\n ResponseCode: " + isr.ResponseCode + "\r\n ResponseDescription: " + isr.ResponseDescription + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc);
                    if (txnref != "")
                    {
                        if (Directory.Exists(Server.MapPath("~/") + "InterLogs/"))
                        {
                        docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt";
                        succ = x.WriteToFile(xstring.ToString(), docpath);
                        }
                    }

                    else
                    {
                        if (Directory.Exists(Server.MapPath("~/") + "InterLogs/"))
                        {
                            docpath = Server.MapPath("~/") + "InterLogs/xxx.txt";
                            succ = x.WriteToFile(xstring.ToString(), docpath);
                        }
                    }
                    succ = reg.updateInterSwitchRecords(txnref, payRef, retRef, isr.ResponseCode, isr.TransactionDate, isr.MerchantReference, isr.ResponseDescription,isr.PaymentReference);

                    if (isr.ResponseCode == "00" && (isr.PaymentReference!=null ||isr.PaymentReference!="") )
                    {
                        xpay_status = "1";
                    }
                    else
                    {
                        xpay_status = "3";
                    }
                    reg.updateTwalletPaymentStatus(txnref.Trim(), xpay_status.Trim());
                    if (succ != 0)
                    {
                        if (Session["vitem_code"] != null)
                        {

                            vitem_code = Convert.ToString(Session["vitem_code"]);
                            Retriever kp = new Retriever();
                           // int vmax = kp.getMaxSysId();
                           // vmax=vmax+1;
                           // String vsys_id = "CLD/RA/0" + vmax;

                            Registration dd = new Registration();
                           // dd.updateRegistrationSysID(vid, vsys_id);
                            dd.updateRegistrationSysID2(vid, "Paid");

                       XObjs.Registration ds=kp.getRegistrationByID(vid);
                       sendemail(ds);

                           // Session["cust_id"] = vsys_id;
                            if (Session["cust_id"] != null) {
                            cust_id = Session["cust_id"].ToString();

                            }

                        }

                        if (Session["onlineid"] != null)
                        {
                            Registration dd = new Registration();

                            string dpp = Convert.ToString(Session["onlineid"]);
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(dpp);
                            dd.updateTransID2(dpp.Trim(), txnref.Trim());

                            dd.updateHwallet2(txnref.Trim(), "Used");

                        }

                        if (Session["onlineid2"] != null)
                        {
                            Registration dd = new Registration();
                            string dpp = Convert.ToString(Session["onlineid2"]);
                            dd.updateTransID3(dpp, txnref.Trim());
                            dd.updateHwallet2(txnref.Trim(), "Used");

                        }

                        if (Session["onlineid3"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid3"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Name";

                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);

                        }

                        if (Session["onlineid4"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid4"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Address";

                            dd.updateHwallet2(txnref.Trim(), "Used");

                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid5"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid5"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Agent";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid6"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid6"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Rectification";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid7"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid7"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Assignment";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid8"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid8"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Assignment2";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid9"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid9"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "Renewal";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);
                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid10"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid10"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "TradeMarkAmendment";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);

                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        if (Session["onlineid12"] != null)
                        {
                            Registration dd = new Registration();
                            xname.Value = "Success";
                            xname2.Value = Convert.ToString(Session["onlineid12"]);
                            vamount.Value = isr.Amount;
                            vtransactionid.Value = isr.MerchantReference;
                            vtype.Value = "RegisteredUser";
                            dd.updateHwallet2(txnref.Trim(), "Used");
                            Retriever dp = new Retriever();
                            kkx = dp.getMarkInfo(xname2.Value);

                            //Registration dd = new Registration();
                            //string dpp = Convert.ToString(Session["onlineid2"]);
                            //dd.updateTransID3(dpp, txnref.Trim());

                        }

                        sendAlertHtml();
                    }
                }
                else if (((isr.ResponseCode != "") && (isr.ResponseCode != null)) && (isr.ResponseCode != "00"))
                {
                    err_desc = eh.getErrorDesc(isr.ResponseCode);
                    if (((err_desc != "") && (err_desc != null)) && (err_desc != "NA"))
                    {
                        isr.ResponseDescription = err_desc;
                    }
                    xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + isr.Amount + "\r\n CardNumber: " + isr.CardNumber + "\r\n MerchantReference: " + isr.MerchantReference + "\r\n PaymentReference: " + isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + isr.LeadBankCbnCode + "\r\n TransactionDate: " + isr.TransactionDate + "\r\n ResponseCode: " + isr.ResponseCode + "\r\n ResponseDescription: " + isr.ResponseDescription + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc);
                    if (txnref != "")
                    {
                        docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt";
                        succ = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    else
                    {
                        docpath = Server.MapPath("~/") + "InterLogs/xxx.txt";
                        succ = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    succ = reg.updateInterSwitchRecords(txnref, payRef, retRef, isr.ResponseCode, isr.TransactionDate, isr.MerchantReference, isr.ResponseDescription,isr.PaymentReference);
                    if (isr.ResponseCode == "00" && (isr.PaymentReference != null || isr.PaymentReference != ""))
                    {
                        xpay_status = "1";
                    }
                    else
                    {
                        xpay_status = "3";
                    }
                    reg.updateTwalletPaymentStatus(txnref.Trim(), xpay_status.Trim());
                    if (succ != 0)
                    {
                        sendUnsuccAlertHtml();
                    }
                }
                else if ((isr.ResponseCode == "") || (isr.ResponseCode == null))
                {
                    string str2 = "None";
                    string str3 = "None";
                    xstring.AppendLine("Sent Amount: " + isw_fields.amount + "\r\n Product ID: " + product_id + "\r\n Hash: " + headerValue + "\r\n Amount: None\r\n CardNumber: None\r\n MerchantReference: None\r\n PaymentReference: None\r\n RetrievalReferenceNumber: None\r\n LeadBankCbnCode: None\r\n TransactionDate: None\r\n ResponseCode: " + str2 + "\r\n ResponseDescription: " + str3 + "\r\n Json Page: " + check_trans_page + "\r\n Form Response: " + resp + "\r\n Form Description: " + desc);
                    if (txnref != "")
                    {
                        docpath = Server.MapPath("~/") + "InterLogs/" + txnref + ".txt";
                        succ = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    else
                    {
                        docpath = Server.MapPath("~/") + "InterLogs/xxx.txt";
                        succ = x.WriteToFile(xstring.ToString(), docpath);
                    }
                    xpay_status = "3";
                    reg.updateTwalletPaymentStatus(txnref, xpay_status);
                    if (desc == "")
                    {
                        isr.ResponseDescription = "Transaction Pending";
                    }
                    else
                    {
                        isr.ResponseDescription = desc;
                    }
                    if (resp == "")
                    {
                        isr.ResponseCode = "XXXX";
                    }
                    else
                    {
                        isr.ResponseCode = resp;
                    }
                    sendUnsuccAlertHtml();
                }
            }
        }
示例#4
0
文件: indext.cs 项目: ozotony/payx
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != ""))
     {
         this.adminID = this.Session["pwalletID"].ToString();
     }
     else
     {
         base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]);
     }
     if (this.Session["fullname"] != null)
     {
         this.fullname = this.Session["fullname"].ToString();
     }
     if (this.Session["email"] != null)
     {
         this.email = this.Session["email"].ToString();
     }
     if (this.Session["mobile"] != null)
     {
         this.mobile = this.Session["mobile"].ToString();
     }
     this.xstring = new StringBuilder();
     this.product_id = ConfigurationManager.AppSettings["pd_product_id_test"];
     this.mackey = ConfigurationManager.AppSettings["pd_mackey_test"];
     this.check_trans_page = ConfigurationManager.AppSettings["pd_get_trans_json_page_test"];
     if ((base.Request.QueryString["txnRef"] != null) && (base.Request.QueryString["txnRef"] != ""))
     {
         this.txnref = base.Request.QueryString["txnRef"].ToString();
         this.Session["transID"] = this.txnref;
     }
     if ((base.Request.QueryString["payRef"] != null) && (base.Request.QueryString["payRef"] != ""))
     {
         this.payRef = base.Request.QueryString["payRef"].ToString();
     }
     if ((base.Request.QueryString["retRef"] != null) && (base.Request.QueryString["retRef"] != ""))
     {
         this.retRef = base.Request.QueryString["retRef"].ToString();
     }
     if ((base.Request.QueryString["cardNum"] != null) && (base.Request.QueryString["cardNum"] != ""))
     {
         this.cardNum = base.Request.QueryString["cardNum"].ToString();
     }
     if ((base.Request.QueryString["apprAmt"] != null) && (base.Request.QueryString["apprAmt"] != ""))
     {
         this.apprAmt = base.Request.QueryString["apprAmt"].ToString();
     }
     if ((base.Request.QueryString["resp"] != null) && (base.Request.QueryString["resp"] != ""))
     {
         this.resp = base.Request.QueryString["resp"].ToString();
     }
     if ((base.Request.QueryString["desc"] != null) && (base.Request.QueryString["desc"] != ""))
     {
         this.desc = base.Request.QueryString["desc"].ToString();
     }
     if (!base.IsPostBack)
     {
         this.c_twall = this.ret.getTwalletByTransIDAdminID(this.txnref, this.adminID);
         this.c_app = this.ret.getApplicantByID(this.c_twall.applicantID);
         if (this.c_twall.xid != null)
         {
             this.Session["c_twall"] = this.c_twall;
             this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.c_twall.xid);
             if (this.lt_fdets.Count > 0)
             {
                 this.Session["lt_fdets"] = this.lt_fdets;
             }
             this.lt_hwall = this.ret.getHwalletByTransID(this.txnref);
             int num = 1;
             int num2 = 0;
             foreach (XObjs.Hwallet hwallet in this.lt_hwall)
             {
                 XObjs.PaymentReciept item = new XObjs.PaymentReciept();
                 XObjs.Fee_list _list = new XObjs.Fee_list();
                 XObjs.Fee_details _details = new XObjs.Fee_details();
                 _details = this.ret.getFee_detailsByID(hwallet.fee_detailsID);
                 _list = this.ret.getFee_listByID(_details.fee_listID);
                 item.sn = num.ToString();
                 item.item_code = _list.item_code;
                 item.item_desc = _list.xdesc;
                 item.init_amt = string.Format("{0:n}", Convert.ToInt32(_details.init_amt));
                 item.tech_amt = string.Format("{0:n}", Convert.ToInt32(_details.tech_amt));
                 item.qty = string.Format("{0:n}", Convert.ToInt32(_details.xqty));
                 item.tot_amount = string.Format("{0:n}", Convert.ToInt32(_details.tot_amt));
                 item.transID = hwallet.transID + "-" + hwallet.fee_detailsID + "-" + hwallet.xid;
                 num2 += Convert.ToInt32(_details.tot_amt);
                 this.Session["amt"] = num2;
                 this.total_amt = string.Format("{0:n}", num2);
                 this.Session["total_amt"] = this.total_amt;
                 this.lt_pr.Add(item);
                 num++;
             }
         }
         this.isw_fields = this.ret.getISWtransactionByTransactionID(this.txnref);
         this.xstring.AppendLine("Transaction reference= " + this.txnref + " Payment reference= " + this.payRef + " Switching Bank Reference number= " + this.retRef + " card No= " + this.cardNum + " apprAmt= " + this.apprAmt);
         this.inputString = this.product_id + this.txnref + this.mackey;
         string headerValue = this.hash_value.GetGetSHA512String(this.inputString);
         this.isr = this.tx.myRedirect(this.check_trans_page + "?productid=" + this.product_id + "&transactionreference=" + this.txnref + "&amount=" + this.isw_fields.amount, "Hash", headerValue);
         if ((this.isr.ResponseCode != "") && (this.isr.ResponseCode != null))
         {
             this.err_desc = this.eh.getErrorDesc(this.isr.ResponseCode);
             if (((this.err_desc != "") && (this.err_desc != null)) && (this.err_desc != "NA"))
             {
                 this.isr.ResponseDescription = this.err_desc;
             }
             this.xstring.AppendLine("Sent Amount: " + this.isw_fields.amount + "\r\n Product ID: " + this.product_id + "\r\n Hash: " + headerValue + "\r\n Amount: " + this.isr.Amount + "\r\n CardNumber: " + this.isr.CardNumber + "\r\n MerchantReference: " + this.isr.MerchantReference + "\r\n PaymentReference: " + this.isr.PaymentReference + "\r\n RetrievalReferenceNumber: " + this.isr.RetrievalReferenceNumber + "\r\n LeadBankCbnCode: " + this.isr.LeadBankCbnCode + "\r\n TransactionDate: " + this.isr.TransactionDate + "\r\n ResponseCode: " + this.isr.ResponseCode + "\r\n ResponseDescription: " + this.isr.ResponseDescription + "\r\n Json Page: " + this.check_trans_page + "\r\n Form Response: " + this.resp + "\r\n Form Description: " + this.desc);
             if (this.txnref != "")
             {
                 this.docpath = base.Server.MapPath("~/") + "InterLogs/" + this.txnref + ".txt";
                 this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath);
             }
             else
             {
                 this.docpath = base.Server.MapPath("~/") + "InterLogs/xxx.txt";
                 this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath);
             }
             this.succ = this.reg.updateInterSwitchRecords(this.txnref, this.payRef, this.retRef, this.isr.ResponseCode, this.isr.TransactionDate, this.isr.MerchantReference, this.isr.ResponseDescription,isr.PaymentReference);
             if (this.isr.ResponseCode == "00")
             {
                 this.xpay_status = "1";
             }
             else
             {
                 this.xpay_status = "3";
             }
             if (this.succ != 0)
             {
                 this.sendAlertHtml();
             }
         }
         else
         {
             string str2 = "None";
             string str3 = "None";
             this.xstring.AppendLine("Sent Amount: " + this.isw_fields.amount + "\r\n Product ID: " + this.product_id + "\r\n Hash: " + headerValue + "\r\n Amount: None\r\n CardNumber: None\r\n MerchantReference: None\r\n PaymentReference: None\r\n RetrievalReferenceNumber: None\r\n LeadBankCbnCode: None\r\n TransactionDate: None\r\n ResponseCode: " + str2 + "\r\n ResponseDescription: " + str3 + "\r\n Json Page: " + this.check_trans_page + "\r\n Form Response: " + this.resp + "\r\n Form Description: " + this.desc);
             if (this.txnref != "")
             {
                 this.docpath = base.Server.MapPath("~/") + "InterLogs/" + this.txnref + ".txt";
                 this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath);
             }
             else
             {
                 this.docpath = base.Server.MapPath("~/") + "InterLogs/xxx.txt";
                 this.succ = this.x.WriteToFile(this.xstring.ToString(), this.docpath);
             }
             this.xpay_status = "3";
             if (this.desc == "")
             {
                 this.isr.ResponseDescription = "Transaction Pending";
             }
             else
             {
                 this.isr.ResponseDescription = this.desc;
             }
             if (this.resp == "")
             {
                 this.isr.ResponseCode = "XXXX";
             }
             else
             {
                 this.isr.ResponseCode = this.resp;
             }
             this.sendAlertHtml();
         }
     }
 }
示例#5
0
文件: Retriever.cs 项目: ozotony/payx
 public List<XObjs.Twallet> getValidatedTwalletByMemberID(string xmemberID, string transID)
 {
     List<XObjs.Twallet> list = new List<XObjs.Twallet>();
     SqlConnection connection = new SqlConnection(hf.ConnectXpay());
     SqlCommand command = new SqlCommand("SELECT * from twallet where xmemberID='" + xmemberID + "'  AND transID='" + transID + "' ", connection);
     connection.Open(); command.CommandTimeout = 0;
     SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
     while (reader.Read())
     {
         XObjs.Twallet item = new XObjs.Twallet {
             xid = reader["xid"].ToString(),
             transID = reader["transID"].ToString(),
             xmemberID = reader["xmemberID"].ToString(),
             xpay_status = reader["xpay_status"].ToString(),
             xgt = reader["xgt"].ToString(),
             ref_no = reader["ref_no"].ToString(),
             xbankerID = reader["xbankerID"].ToString(),
             applicantID = reader["applicantID"].ToString(),
             xreg_date = reader["xreg_date"].ToString(),
             xsync = reader["xsync"].ToString(),
             xvisible = reader["xvisible"].ToString()
         };
         list.Add(item);
     }
     reader.Close();
     return list;
 }
示例#6
0
文件: Retriever.cs 项目: ozotony/payx
 public XObjs.Twallet getTwalletByTransIDAdminID(string transID, string xmemberID)
 {
     XObjs.Twallet twallet = new XObjs.Twallet();
     SqlConnection connection = new SqlConnection(hf.ConnectXpay());
     SqlCommand command = new SqlCommand("SELECT * from twallet where (transID='" + transID + "') AND  (xmemberID='" + xmemberID + "') ", connection);
     connection.Open();command.CommandTimeout = 0;
     SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
     while (reader.Read())
     {
         twallet.xid = reader["xid"].ToString();
         twallet.transID = reader["transID"].ToString();
         twallet.xmemberID = reader["xmemberID"].ToString();
         twallet.xmembertype = reader["xmembertype"].ToString();
         twallet.xpay_status = reader["xpay_status"].ToString();
         twallet.xgt = reader["xgt"].ToString();
         twallet.ref_no = reader["ref_no"].ToString();
         twallet.xbankerID = reader["xbankerID"].ToString();
         twallet.applicantID = reader["applicantID"].ToString();
         twallet.xreg_date = reader["xreg_date"].ToString();
         twallet.xsync = reader["xsync"].ToString();
         twallet.xvisible = reader["xvisible"].ToString();
     }
     reader.Close();
     return twallet;
 }