private bool InquiryTransaction(string reference_number, string res_num) { ir.shaparak.bpm.PaymentGatewayImplService bmService = new PaymentGatewayImplService(); string strStatCode = bmService.bpInquiryRequest(_mellatBankPaymentSettings.TerminalId, _mellatBankPaymentSettings.Username, _mellatBankPaymentSettings.Password, Convert.ToInt64(res_num), Convert.ToInt64(res_num), Convert.ToInt64(reference_number)); if (strStatCode.Trim() == "0") { // transaction verified return(true); } else { return(false); } }
public void InquiryRequest(long saleReferenceId) { try { string Result = behPardakhtWebService.bpInquiryRequest(TerminalID, UserName, Password, OrderID, OrderID, saleReferenceId); foreach (ResCode resCode in System.Enum.GetValues(typeof(ResCode))) { if (Helper.GetInt(Result) == (int)resCode && resCode != (int)ResCode.TransactionWasSuccessful) { throw new Exception(Language.GetString(resCode.ToString())); } } SettleRequest(saleReferenceId); } catch { ReversalRequest(saleReferenceId); } }
private string bpInqiryRequest(long saleOrderId, long saleReferenceId, string refId, long userId) { userId = 0;//این باید طبق قوانین به پرداخت صفر باشد! string response1 = "", response2 = ""; long payId = 0; PaymentGatewayImplService bpService = new PaymentGatewayImplService(); try { //برداشت وجه از حساب response1 = bpService.bpInquiryRequest(OtherId, behpardakht_username, behpardakht_password, payId, saleOrderId, saleReferenceId); } catch { return("-999");//خطای سیستمی } if (response1 == "0" || response1 == "43") { response2 = bpSettleRequest(saleOrderId, saleReferenceId, refId, userId); return(response2); } else if (string.IsNullOrEmpty(response1)) { return("-901");//وصضعیت نامشخص } else { return(response1); } }
public string PaymentStatusInquery(Int64 orderID, out int result) { result = -1; var pay = GetPaymentInfoByOrderID(orderID); PaymentGatewayImplService bpService = new PaymentGatewayImplService(); string resultInquery = ""; resultInquery = bpService.bpInquiryRequest(Int64.Parse(System.Configuration.ConfigurationManager.AppSettings["Mellat_TerminalId"]), System.Configuration.ConfigurationManager.AppSettings["UserName"], System.Configuration.ConfigurationManager.AppSettings["UserPassword"], pay.OrderId, pay.OrderId, pay.TraceNumber); string resultText = ""; if (Business.Common.CommonBusiness.IsNumeric(resultInquery)) { result = Convert.ToInt32(resultInquery); switch (result) { case 0: resultText = "تراكنش با موفقيت انجام شد"; break; case 11: resultText = "ﺷﻤﺎﺭﻩ ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ "; break; case 12: resultText = "ﻣﻮﺟﻮﺩﻱ ﻛﺎﻓﻲ ﻧﻴﺴﺖ "; break; case 13: resultText = "ﺭﻣﺰ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ "; break; case 14: resultText = "ﺗﻌﺪﺍﺩ ﺩﻓﻌﺎﺕ ﻭﺍﺭﺩ ﻛﺮﺩﻥ ﺭﻣﺰ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ "; break; case 15: resultText = "ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 16: resultText = "ﺩﻓﻌﺎﺕ ﺑﺮﺩﺍﺷﺖ ﻭﺟﻪ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ"; break; case 17: resultText = "ﻛﺎﺭﺑﺮ ﺍﺯ ﺍﻧﺠﺎﻡ ﺗﺮﺍﻛﻨﺶ ﻣﻨﺼﺮﻑ ﺷﺪﻩ ﺍﺳﺖ "; break; case 18: resultText = "ﺗﺎﺭﻳﺦ ﺍﻧﻘﻀﺎﻱ ﻛﺎﺭﺕ ﮔﺬﺷﺘﻪ ﺍﺳﺖ"; break; case 19: resultText = "ﻣﺒﻠﻎ ﺑﺮﺩﺍﺷﺖ ﻭﺟﻪ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ"; break; case 111: resultText = "ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 112: resultText = "ﺧﻄﺎﻱ ﺳﻮﻳﻴﭻ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ "; break; case 113: resultText = "ﭘﺎﺳﺨﻲ ﺍﺯ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ ﺩﺭﻳﺎﻓﺖ ﻧﺸﺪ"; break; case 114: resultText = "ﺩﺍﺭﻧﺪﻩ ﻛﺎﺭﺕ ﻣﺠﺎﺯ ﺑﻪ ﺍﻧﺠﺎﻡ ﺍﻳﻦ ﺗﺮﺍﻛﻨﺶ ﻧﻴﺴﺖ"; break; case 21: resultText = "ﭘﺬﻳﺮﻧﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 23: resultText = "ﺧﻄﺎﻱ ﺍﻣﻨﻴﺘﻲ ﺭﺥ ﺩﺍﺩﻩ ﺍﺳﺖ"; break; case 24: resultText = "ﺍﻃﻼﻋﺎﺕ ﻛﺎﺭﺑﺮﻱ ﭘﺬﻳﺮﻧﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 25: resultText = "ﻣﺒﻠﻎ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 31: resultText = "ﭘﺎﺳﺦ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ "; break; case 32: resultText = "ﻓﺮﻣﺖ ﺍﻃﻼﻋﺎﺕ ﻭﺍﺭﺩ ﺷﺪﻩ ﺻﺤﻴﺢ ﻧﻤﻲ ﺑﺎﺷﺪ"; break; case 33: resultText = "ﺣﺴﺎﺏ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 34: resultText = "ﺧﻄﺎﻱ ﺳﻴﺴﺘﻤﻲ"; break; case 35: resultText = "ﺗﺎﺭﻳﺦ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 36: resultText = "ﺷﻤﺎﺭﻩ ﺩﺭﺧﻮﺍﺳﺖ ﺗﻜﺮﺍﺭﻱ ﺍﺳﺖ "; break; case 42: resultText = "ﻳﺎﻓﺖ ﻧﺸﺪ Sale ﺗﺮﺍﻛﻨﺶ "; break; case 43: resultText = " ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ Verify ﻗﺒﻼ ﺩﺭﺧﻮﺍﺳﺖ "; break; case 44: resultText = " ﻳﺎﻓﺖ ﻧﺸﺪ Verfiy ﺩﺭﺧﻮﺍﺳﺖ "; break; case 45: resultText = " ﺷﺪﻩ ﺍﺳﺖ Settle ﺗﺮﺍﻛﻨﺶ "; break; case 46: resultText = " ﻧﺸﺪﻩ ﺍﺳﺖ Settle ﺗﺮﺍﻛﻨﺶ "; break; case 47: resultText = "ﻳﺎﻓﺖ ﻧﺸﺪ Settle ﺗﺮﺍﻛﻨﺶ "; break; case 48: resultText = " ﺷﺪﻩ ﺍﺳﺖ Reverse ﺗﺮﺍﻛﻨﺶ "; break; case 49: resultText = "ﻳﺎﻓﺖ ﻧﺸﺪ Refund ﺗﺮﺍﻛﻨﺶ "; break; case 412: resultText = "ﺷﻨﺎﺳﻪ ﻗﺒﺾ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ"; break; case 413: resultText = "ﺷﻨﺎﺳﻪ ﭘﺮﺩﺍﺧﺖ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ"; break; case 414: resultText = "ﺳﺎﺯﻣﺎﻥ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻗﺒﺾ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 415: resultText = "ﺯﻣﺎﻥ ﺟﻠﺴﻪ ﻛﺎﺭﻱ ﺑﻪ ﭘﺎﻳﺎﻥ ﺭﺳﻴﺪﻩ ﺍﺳﺖ"; break; case 416: resultText = " ﺧﻄﺎ ﺩﺭ ﺛﺒﺖ ﺍﻃﻼﻋﺎﺕ"; break; case 417: resultText = "ﺷﻨﺎﺳﻪ ﭘﺮﺩﺍﺧﺖ ﻛﻨﻨﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 418: resultText = "ﺍﺷﻜﺎﻝ ﺩﺭ ﺗﻌﺮﻳﻒ ﺍﻃﻼﻋﺎﺕ ﻣﺸﺘﺮﻱ"; break; case 419: resultText = "ﺗﻌﺪﺍﺩ ﺩﻓﻌﺎﺕ ﻭﺭﻭﺩ ﺍﻃﻼﻋﺎﺕ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﮔﺬﺷﺘﻪ ﺍﺳﺖ"; break; case 421: resultText = "ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ IP"; break; case 51: resultText = "ﺗﺮﺍﻛﻨﺶ ﺗﻜﺮﺍﺭﻱ ﺍﺳﺖ "; break; case 54: resultText = "ﺗﺮﺍﻛﻨﺶ ﻣﺮﺟﻊ ﻣﻮﺟﻮﺩ ﻧﻴﺴﺖ"; break; case 55: resultText = "ﺗﺮﺍﻛﻨﺶ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case 61: resultText = "ﺧﻄﺎ ﺩﺭ ﻭﺍﺭﻳﺰ"; break; } } return(resultText); }
protected void grd_Payment_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "estelam") { DataTable dt = new DataTable(); PaymentDTO pay = new PaymentDTO(); pay = Pb.GetPaymentInfoByOrderID(long.Parse(e.CommandArgument.ToString())); PaymentGatewayImplService bpService = new PaymentGatewayImplService(); string result = bpService.bpInquiryRequest(Int64.Parse(Mellat_TerminalId), Mellat_UserName, Mellat_UserPassword, pay.OrderId, pay.OrderId, pay.TraceNumber); switch (result) { case "0": lbl_Estelam.Text = "تراكنش با موفقيت انجام شد"; break; case "11": lbl_Estelam.Text = "ﺷﻤﺎﺭﻩ ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ "; break; case "12": lbl_Estelam.Text = "ﻣﻮﺟﻮﺩﻱ ﻛﺎﻓﻲ ﻧﻴﺴﺖ "; break; case "13": lbl_Estelam.Text = "ﺭﻣﺰ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ "; break; case "14": lbl_Estelam.Text = "ﺗﻌﺪﺍﺩ ﺩﻓﻌﺎﺕ ﻭﺍﺭﺩ ﻛﺮﺩﻥ ﺭﻣﺰ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ "; break; case "15": lbl_Estelam.Text = "ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "16": lbl_Estelam.Text = "ﺩﻓﻌﺎﺕ ﺑﺮﺩﺍﺷﺖ ﻭﺟﻪ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ"; break; case "17": lbl_Estelam.Text = "ﻛﺎﺭﺑﺮ ﺍﺯ ﺍﻧﺠﺎﻡ ﺗﺮﺍﻛﻨﺶ ﻣﻨﺼﺮﻑ ﺷﺪﻩ ﺍﺳﺖ "; break; case "18": lbl_Estelam.Text = "ﺗﺎﺭﻳﺦ ﺍﻧﻘﻀﺎﻱ ﻛﺎﺭﺕ ﮔﺬﺷﺘﻪ ﺍﺳﺖ"; break; case "19": lbl_Estelam.Text = "ﻣﺒﻠﻎ ﺑﺮﺩﺍﺷﺖ ﻭﺟﻪ ﺑﻴﺶ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﺍﺳﺖ"; break; case "111": lbl_Estelam.Text = "ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "112": lbl_Estelam.Text = "ﺧﻄﺎﻱ ﺳﻮﻳﻴﭻ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ "; break; case "113": lbl_Estelam.Text = "ﭘﺎﺳﺨﻲ ﺍﺯ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻛﺎﺭﺕ ﺩﺭﻳﺎﻓﺖ ﻧﺸﺪ"; break; case "114": lbl_Estelam.Text = "ﺩﺍﺭﻧﺪﻩ ﻛﺎﺭﺕ ﻣﺠﺎﺯ ﺑﻪ ﺍﻧﺠﺎﻡ ﺍﻳﻦ ﺗﺮﺍﻛﻨﺶ ﻧﻴﺴﺖ"; break; case "21": lbl_Estelam.Text = "ﭘﺬﻳﺮﻧﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "23": lbl_Estelam.Text = "ﺧﻄﺎﻱ ﺍﻣﻨﻴﺘﻲ ﺭﺥ ﺩﺍﺩﻩ ﺍﺳﺖ"; break; case "24": lbl_Estelam.Text = "ﺍﻃﻼﻋﺎﺕ ﻛﺎﺭﺑﺮﻱ ﭘﺬﻳﺮﻧﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "25": lbl_Estelam.Text = "ﻣﺒﻠﻎ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "31": lbl_Estelam.Text = "ﭘﺎﺳﺦ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ "; break; case "32": lbl_Estelam.Text = "ﻓﺮﻣﺖ ﺍﻃﻼﻋﺎﺕ ﻭﺍﺭﺩ ﺷﺪﻩ ﺻﺤﻴﺢ ﻧﻤﻲ ﺑﺎﺷﺪ"; break; case "33": lbl_Estelam.Text = "ﺣﺴﺎﺏ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "34": lbl_Estelam.Text = "ﺧﻄﺎﻱ ﺳﻴﺴﺘﻤﻲ"; break; case "35": lbl_Estelam.Text = "ﺗﺎﺭﻳﺦ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "41": lbl_Estelam.Text = "ﺷﻤﺎﺭﻩ ﺩﺭﺧﻮﺍﺳﺖ ﺗﻜﺮﺍﺭﻱ ﺍﺳﺖ "; break; case "42": lbl_Estelam.Text = "ﻳﺎﻓﺖ ﻧﺸﺪ Sale ﺗﺮﺍﻛﻨﺶ "; break; case "43": lbl_Estelam.Text = " ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ Verify ﻗﺒﻼ ﺩﺭﺧﻮﺍﺳﺖ "; break; case "44": lbl_Estelam.Text = " ﻳﺎﻓﺖ ﻧﺸﺪ Verfiy ﺩﺭﺧﻮﺍﺳﺖ "; break; case "45": lbl_Estelam.Text = " ﺷﺪﻩ ﺍﺳﺖ Settle ﺗﺮﺍﻛﻨﺶ "; break; case "46": lbl_Estelam.Text = " ﻧﺸﺪﻩ ﺍﺳﺖ Settle ﺗﺮﺍﻛﻨﺶ "; break; case "47": lbl_Estelam.Text = "ﻳﺎﻓﺖ ﻧﺸﺪ Settle ﺗﺮﺍﻛﻨﺶ "; break; case "48": lbl_Estelam.Text = " ﺷﺪﻩ ﺍﺳﺖ Reverse ﺗﺮﺍﻛﻨﺶ "; break; case "49": lbl_Estelam.Text = "ﻳﺎﻓﺖ ﻧﺸﺪ Refund ﺗﺮﺍﻛﻨﺶ "; break; case "412": lbl_Estelam.Text = "ﺷﻨﺎﺳﻪ ﻗﺒﺾ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ"; break; case "413": lbl_Estelam.Text = "ﺷﻨﺎﺳﻪ ﭘﺮﺩﺍﺧﺖ ﻧﺎﺩﺭﺳﺖ ﺍﺳﺖ"; break; case "414": lbl_Estelam.Text = "ﺳﺎﺯﻣﺎﻥ ﺻﺎﺩﺭ ﻛﻨﻨﺪﻩ ﻗﺒﺾ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "415": lbl_Estelam.Text = "ﺯﻣﺎﻥ ﺟﻠﺴﻪ ﻛﺎﺭﻱ ﺑﻪ ﭘﺎﻳﺎﻥ ﺭﺳﻴﺪﻩ ﺍﺳﺖ"; break; case "416": lbl_Estelam.Text = " ﺧﻄﺎ ﺩﺭ ﺛﺒﺖ ﺍﻃﻼﻋﺎﺕ"; break; case "417": lbl_Estelam.Text = "ﺷﻨﺎﺳﻪ ﭘﺮﺩﺍﺧﺖ ﻛﻨﻨﺪﻩ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "418": lbl_Estelam.Text = "ﺍﺷﻜﺎﻝ ﺩﺭ ﺗﻌﺮﻳﻒ ﺍﻃﻼﻋﺎﺕ ﻣﺸﺘﺮﻱ"; break; case "419": lbl_Estelam.Text = "ﺗﻌﺪﺍﺩ ﺩﻓﻌﺎﺕ ﻭﺭﻭﺩ ﺍﻃﻼﻋﺎﺕ ﺍﺯ ﺣﺪ ﻣﺠﺎﺯ ﮔﺬﺷﺘﻪ ﺍﺳﺖ"; break; case "421": lbl_Estelam.Text = "ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ IP"; break; case "51": lbl_Estelam.Text = "ﺗﺮﺍﻛﻨﺶ ﺗﻜﺮﺍﺭﻱ ﺍﺳﺖ "; break; case "54": lbl_Estelam.Text = "ﺗﺮﺍﻛﻨﺶ ﻣﺮﺟﻊ ﻣﻮﺟﻮﺩ ﻧﻴﺴﺖ"; break; case "55": lbl_Estelam.Text = "ﺗﺮﺍﻛﻨﺶ ﻧﺎﻣﻌﺘﺒﺮ ﺍﺳﺖ"; break; case "61": lbl_Estelam.Text = "ﺧﻄﺎ ﺩﺭ ﻭﺍﺭﻳﺰ"; break; default: break; } } }