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 (base.IsPostBack) { if (this.rblOptions.SelectedValue == "isw") { if (this.Session["xispf"] != null) { this.xispf = (XObjs.InterSwitchPostFields) this.Session["xispf"]; if ((this.Session["AgentType"] != null) && (this.Session["AgentType"].ToString() != "")) { this.agentType = this.Session["AgentType"].ToString(); if (this.agentType == "Agent") { this.c_reg = (XObjs.Registration) this.Session["c_reg"]; this.xispf.cust_id = this.c_reg.Sys_ID; this.xispf.cust_id_desc = "Portal Agent"; } else { this.c_sub = (XObjs.Subagent) this.Session["c_sub"]; this.xispf.cust_id = this.c_sub.Sys_ID; this.xispf.cust_id_desc = "Portal Sub-Agent"; } } this.addIsw_succ = this.reg.addInterSwitchRecords(this.xispf); if (this.addIsw_succ > 0) { this.update_twallxgt_succ = this.reg.updateTwalletXgt(this.xispf.txn_ref, "xpay_isw", this.adminID); if (this.update_twallxgt_succ > 0) { base.Response.Redirect("./payment_detailst.aspx"); } } } else { base.Response.Redirect("../../../A/m_payt.aspx"); } } else if ((this.rblOptions.SelectedValue == "bank") && (this.Session["xispf"] != null)) { this.xispf = (XObjs.InterSwitchPostFields) this.Session["xispf"]; this.update_twallxgt_succ = this.reg.updateTwalletXgtBanker(this.xispf.txn_ref, "xpay_bk", this.adminID); if (this.update_twallxgt_succ > 0) { base.Response.Redirect("../../../A/m_invoice_bank.aspx?tx=" + this.xispf.txn_ref); } } } }
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; } }
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; } } }
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(); } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["c_app"] != null) { this.c_app = (XObjs.Applicant) this.Session["c_app"]; } 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["xispf"] != null) { this.xispf = (XObjs.InterSwitchPostFields) this.Session["xispf"]; } if ((this.Session["AgentType"] != null) && (this.Session["AgentType"].ToString() != "")) { this.agentType = this.Session["AgentType"].ToString(); if (this.agentType == "Agent") { if (this.Session["c_reg"] != null) { this.c_reg = (XObjs.Registration) this.Session["c_reg"]; this.Session["name"] = this.c_reg.Firstname + " " + this.c_reg.Surname; this.Session["coy_name"] = this.c_reg.CompanyName; this.Session["Address"] = this.c_reg.CompanyAddress; } } else { XObjs.Registration registration = new XObjs.Registration(); if (this.Session["c_sub"] != null) { this.c_sub = (XObjs.Subagent) this.Session["c_sub"]; this.Session["name"] = this.c_sub.Firstname + " " + this.c_sub.Surname; } if (this.Session["c_sub_reg"] != null) { registration = (XObjs.Registration) this.Session["c_sub_reg"]; this.Session["coy_name"] = registration.CompanyName; this.Session["Address"] = registration.CompanyAddress; } } } this.twall = this.ret.getTwalletByMemberID(this.adminID, this.xispf.txn_ref, this.agentType); this.lt_fdets = this.ret.getFee_detailsByTwalletID(this.twall[0].xid); int num = 0; int num2 = 0; if (this.lt_fdets.Count > 0) { foreach (XObjs.Fee_details _details in this.lt_fdets) { num += (Convert.ToInt32(_details.init_amt) * Convert.ToInt32(_details.xqty)) * 100; num2 += (Convert.ToInt32(_details.tech_amt) * Convert.ToInt32(_details.xqty)) * 100; } } this.refno = this.xispf.txn_ref; this.isw_conv_fee = Math.Round(Convert.ToDecimal(this.xispf.isw_conv_fee), 2).ToString(); this.total_amt = Convert.ToString(this.xispf.amount); this.amt = Convert.ToString((decimal) ((Convert.ToDecimal(this.total_amt) / 100M) - Convert.ToDecimal(this.isw_conv_fee))); this.name = this.Session["name"].ToString(); this.coy_name = this.Session["coy_name"].ToString(); this.addy = this.Session["Address"].ToString(); this.amt = string.Format("{0:n}", this.amt); this.isw_conv_fee = string.Format("{0:n}", this.isw_conv_fee); this.Session["amt"] = this.amt; this.Session["isw_conv_fee"] = this.isw_conv_fee; this.Session["total_amt"] = this.total_amt; this.Session["Refno"] = this.refno; this.Session["einao_split_amt"] = num2.ToString(); this.Session["cld_split_amt"] = num.ToString(); this.Session["hashString"] = this.xispf.hash; if (this.addy.Contains<char>(',')) { this.addy = this.addy.Replace(",", ", "); } }
protected void Page_Load(object sender, EventArgs e) { if ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != "")) { adminID =Session["pwalletID"].ToString(); } else { base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]); } if (base.IsPostBack) { if (rblOptions.SelectedValue == "isw") { if (Session["xispf"] != null) { xispf = (XObjs.InterSwitchPostFields)Session["xispf"]; if ((Session["AgentType"] != null) && (Session["AgentType"].ToString() != "")) { agentType =Session["AgentType"].ToString(); if (agentType == "Agent") { c_reg = (XObjs.Registration)Session["c_reg"]; xispf.cust_id =c_reg.Sys_ID; Session["cust_id"] =c_reg.Sys_ID; xispf.cust_id_desc = "Portal Agent"; } else { c_sub = (XObjs.Subagent)Session["c_sub"]; xispf.cust_id =c_sub.Sys_ID; Session["cust_id"] =c_sub.Sys_ID; xispf.cust_id_desc = "Portal Sub-Agent"; } } int tw_cnt = 0; Retriever ret = new Retriever(); tw_cnt = ret.getTransIDCnt(xispf.txn_ref.Trim()); // if(tw_cnt==0) // { Retriever dd = new Retriever(); int vcount3 = dd.getCountTrans(xispf.txn_ref.Trim()); if (vcount3 > 0) { return; } addIsw_succ =reg.addInterSwitchRecords(xispf); if (addIsw_succ > 0) { update_twallxgt_succ =reg.updateTwalletXgt(xispf.txn_ref, "xpay_isw",adminID); if (update_twallxgt_succ > 0) { base.Response.Redirect("./payment_detailsx.aspx"); } } // } } else { base.Response.Redirect("../../../A/m_payx.aspx"); } } else if ((rblOptions.SelectedValue == "bank") && (Session["xispf"] != null)) { xispf = (XObjs.InterSwitchPostFields)Session["xispf"]; update_twallxgt_succ =reg.updateTwalletXgtBanker(xispf.txn_ref, "xpay_bk",adminID); if (update_twallxgt_succ > 0) { base.Response.Redirect("../../../A/m_invoice_bank.aspx?tx=" +xispf.txn_ref); } } } }
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(); } } }
//public XObjs.InterSwitchPostFields getISWtransactionByTransactionID(string txnref) //{ // XObjs.InterSwitchPostFields fields = new XObjs.InterSwitchPostFields(); // SqlConnection connection = new SqlConnection(hf.ConnectXpay()); // SqlCommand command = new SqlCommand("SELECT * FROM InterSwitchPostFields WHERE txn_ref='" + txnref + "' AND InterSwitchPostFields.trans_status='00' ", connection); // connection.Open(); command.CommandTimeout = 0; // SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); // while (reader.Read()) // { // fields.xid = reader["xid"].ToString(); // fields.product_id = reader["product_id"].ToString(); // fields.amount = reader["amount"].ToString(); // fields.isw_conv_fee = reader["isw_conv_fee"].ToString(); // fields.currency = reader["currency"].ToString(); // fields.site_redirect_url = reader["site_redirect_url"].ToString(); // fields.txn_ref = reader["txn_ref"].ToString(); // fields.hash = reader["hash"].ToString(); // fields.mackey = reader["mackey"].ToString(); // fields.pay_item_id = reader["pay_item_id"].ToString(); // fields.site_name = reader["site_name"].ToString(); // fields.cust_id = reader["cust_id"].ToString(); // fields.cust_id_desc = reader["cust_id_desc"].ToString(); // fields.cust_name = reader["cust_name"].ToString(); // fields.resp_desc = reader["resp_desc"].ToString(); // fields.pay_item_name = reader["pay_item_name"].ToString(); // fields.local_date_time = reader["local_date_time"].ToString(); // fields.TransactionDate = reader["TransactionDate"].ToString(); // fields.MerchantReference = reader["MerchantReference"].ToString(); // fields.trans_status = reader["trans_status"].ToString(); // fields.pay_ref = reader["pay_ref"].ToString(); // fields.ret_ref = reader["ret_ref"].ToString(); // fields.xreg_date = reader["xreg_date"].ToString(); // fields.xvisible = reader["xvisible"].ToString(); // fields.xsync = reader["xsync"].ToString(); // } // reader.Close(); // return fields; //} public XObjs.InterSwitchPostFields getISWtransactionByTransactionID(string txnref) { XObjs.InterSwitchPostFields fields = new XObjs.InterSwitchPostFields(); SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("SELECT * FROM InterSwitchPostFields WHERE txn_ref='" + txnref + "' order by xid desc ", connection); connection.Open(); command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { fields.xid = reader["xid"].ToString(); fields.product_id = reader["product_id"].ToString(); fields.amount = reader["amount"].ToString(); fields.isw_conv_fee = reader["isw_conv_fee"].ToString(); fields.currency = reader["currency"].ToString(); fields.site_redirect_url = reader["site_redirect_url"].ToString(); fields.txn_ref = reader["txn_ref"].ToString(); fields.hash = reader["hash"].ToString(); fields.mackey = reader["mackey"].ToString(); fields.pay_item_id = reader["pay_item_id"].ToString(); fields.site_name = reader["site_name"].ToString(); fields.cust_id = reader["cust_id"].ToString(); fields.cust_id_desc = reader["cust_id_desc"].ToString(); fields.cust_name = reader["cust_name"].ToString(); fields.resp_desc = reader["resp_desc"].ToString(); fields.pay_item_name = reader["pay_item_name"].ToString(); fields.local_date_time = reader["local_date_time"].ToString(); fields.TransactionDate = reader["TransactionDate"].ToString(); fields.MerchantReference = reader["MerchantReference"].ToString(); fields.trans_status = reader["trans_status"].ToString(); fields.pay_ref = reader["pay_ref"].ToString(); fields.ret_ref = reader["ret_ref"].ToString(); fields.xreg_date = reader["xreg_date"].ToString(); fields.xvisible = reader["xvisible"].ToString(); fields.xsync = reader["xsync"].ToString(); } reader.Close(); return fields; }
public List<XObjs.InterSwitchPostFields> getISWtransactionBadRecords(string vtrans_id) { // string cmd_string = "SELECT * FROM InterSwitchPostFields WHERE xreg_date >'2014-09-15' and trans_status='20031' "; string cmd_string = "SELECT * FROM InterSwitchPostFields WHERE txn_ref= '" + vtrans_id + "' "; List<XObjs.InterSwitchPostFields> fields = new List<XObjs.InterSwitchPostFields>(); SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand(cmd_string, connection); connection.Open(); command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { XObjs.InterSwitchPostFields x = new XObjs.InterSwitchPostFields(); x.xid = reader["xid"].ToString(); x.product_id = reader["product_id"].ToString(); x.amount = (Convert.ToDecimal(reader["amount"])/100).ToString(); x.vamount=reader["amount"].ToString(); x.isw_conv_fee = reader["isw_conv_fee"].ToString(); x.currency = reader["currency"].ToString(); x.site_redirect_url = reader["site_redirect_url"].ToString(); x.txn_ref = reader["txn_ref"].ToString(); x.hash = reader["hash"].ToString(); x.mackey = reader["mackey"].ToString(); x.pay_item_id = reader["pay_item_id"].ToString(); x.site_name = reader["site_name"].ToString(); x.cust_id = reader["cust_id"].ToString(); x.cust_id_desc = reader["cust_id_desc"].ToString(); x.cust_name = reader["cust_name"].ToString(); x.resp_desc = reader["resp_desc"].ToString(); x.pay_item_name = reader["pay_item_name"].ToString(); x.local_date_time = reader["local_date_time"].ToString(); x.TransactionDate = reader["TransactionDate"].ToString(); x.MerchantReference = reader["MerchantReference"].ToString(); x.trans_status = reader["trans_status"].ToString(); x.pay_ref = reader["pay_ref"].ToString(); x.ret_ref = reader["ret_ref"].ToString(); x.xreg_date = reader["xreg_date"].ToString(); x.xvisible = reader["xvisible"].ToString(); x.xsync = reader["xsync"].ToString(); fields.Add(x); } reader.Close(); return fields; }