public void PayRequest(string OrderID, string Price) { //try //{ string PayDateTextBox = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0'); string PayTimeTextBox = DateTime.Now.Hour.ToString().PadLeft(2, '0') + DateTime.Now.Minute.ToString().PadLeft(2, '0') + DateTime.Now.Second.ToString().PadLeft(2, '0'); string result; BypassCertificateError(); MashadCarpet2017.ir.shaparak.bpm.PaymentGatewayImplService bpService = new MashadCarpet2017.ir.shaparak.bpm.PaymentGatewayImplService(); // MashadCarpet2017.ir.bankmellat.bpm.pgwstest.PaymentGatewayImplService bpService = new MashadCarpet2017.ir.bankmellat.bpm.pgwstest.PaymentGatewayImplService(); Int64 newprice = returnPurePrice(Price); Int64 od = Int64.Parse(OrderID); result = bpService.bpPayRequest(Int64.Parse(TerminalId), UserName, UserPassword, od, newprice, PayDateTextBox, PayTimeTextBox, null, "http://www.mashadcarpet.com/callback.aspx", 0); String[] resultArray = result.Split(','); if (resultArray[0] == "0") { ClientScript.RegisterStartupScript(typeof(Page), "ClientScript", "<script language='javascript' type='text/javascript'> postRefId('" + resultArray[1] + "');</script> ", false); } else { int ResCode = Convert.ToInt32(resultArray[0]); Guid GOrderID = ConvertUniqeIDToRealOrderID(OrderID); InsertIntoPaymentLogs(GOrderID, ResCode, ""); pnlError.Visible = true; lblResCode.Text = ResCode.ToString(); } //} //catch (Exception exp) //{ // pnlError.Visible = true; //} }
public void PayRequest(string OrderID, string Price) { try { string PayDateTextBox = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0'); string PayTimeTextBox = DateTime.Now.Hour.ToString().PadLeft(2, '0') + DateTime.Now.Minute.ToString().PadLeft(2, '0') + DateTime.Now.Second.ToString().PadLeft(2, '0'); string result; BypassCertificateError(); MashadCarpet2017.ir.shaparak.bpm.PaymentGatewayImplService bpService = new MashadCarpet2017.ir.shaparak.bpm.PaymentGatewayImplService(); result = bpService.bpPayRequest(Int64.Parse(TerminalId), UserName, UserPassword, Int64.Parse(OrderID), Int64.Parse(Price), PayDateTextBox, PayTimeTextBox, null, "http://www.mashadcarpet.com/callback.aspx", 0); Label1.Text = result; //lblPayOutput.Visible = true; //lblPayOutput.Text = result; String[] resultArray = result.Split(','); if (resultArray[0] == "0") { ClientScript.RegisterStartupScript(typeof(Page), "ClientScript", "<script language='javascript' type='text/javascript'> postRefId('" + resultArray[1] + "');</script> ", false); } else { int ResCode = Convert.ToInt32(resultArray[0]); Guid GOrderID = new Guid(OrderID); InsertIntoPaymentLogs(resultArray[1], GOrderID, ResCode, ""); } } catch (Exception exp) { } }