public IHttpActionResult makePayment(dynamic data) { string serialized_data = token_gen.Authorize_aesdecrpty(data); walletProcModel rootobj = JsonConvert.DeserializeObject <walletProcModel>(serialized_data); return(Ok(seedsPaymentHelper.makePayment(rootobj))); }
public static dynamic recieptData(recieptModel obj) { dynamic objdata = new ExpandoObject(); try { string serialized_data = rbkPaymentsHelper.decryptString(obj.encryptedString); walletRespModel objResp = JsonConvert.DeserializeObject <walletRespModel>(serialized_data); if (objResp.ERRORCODE == "101") { try { walletProcModel walletObj = new walletProcModel(); walletObj.type = "2"; walletObj.walletTxnId = objResp.WALLETREFNO; walletObj.paymentStatus = "1"; walletObj.APPLICATIONNO = objResp.APPLICATIONNO; walletObj.GSWSREFNO = objResp.GSWSREFNO; DataTable dt = rbkPaymentsHelper.walletProc(walletObj); if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1") { resProcModel objRes = new resProcModel(); objRes.type = "5"; objRes.txnId = objResp.GSWSREFNO; DataTable dt1 = rbkPaymentsHelper.resProc(objRes); if (dt1 != null && dt1.Rows.Count > 0) { obj.secId = "11190157"; var input = new { vscode = obj.secId, otpid = objResp.APPLICATIONNO, transactionid = objResp.GSWSREFNO, receiptid = "123", amounttobepaid = (float.Parse(objResp.serviceAmt, CultureInfo.InvariantCulture.NumberFormat) + float.Parse(objResp.userCharges, CultureInfo.InvariantCulture.NumberFormat)).ToString(), paystatus = "1" }; var mualinput = new { deptId = "1101", deptName = "Agriculture", serviceName = "updatePaymentStatus", serviceType = "REST", method = "POST", simulatorFlag = "false", application = "GWS", username = "******", data = input }; string input_data = JsonConvert.SerializeObject(mualinput); // string url = "https://eseed.ap.gov.in/eseed/RestFul/VSServices/updatePaymentStatus"; string url = ConfigurationManager.AppSettings["AgricultureApiBaseAddress"].ToString() + "Agriculture/v1/api/v1/agriculture"; string response = POST_RequestAsync(url, input_data); orderDetailesRespModel rootobj = JsonConvert.DeserializeObject <orderDetailesRespModel>(response); if (rootobj.response.status == "1") { var input1 = new { vscode = "11190157", otpid = objResp.APPLICATIONNO }; var mualinput1 = new { deptId = "1101", deptName = "Agriculture", serviceName = "ReceivePayment", serviceType = "REST", method = "POST", simulatorFlag = "false", application = "GWS", username = "******", data = input1 }; input_data = JsonConvert.SerializeObject(mualinput1); // url = "https://eseed.ap.gov.in/eseed/RestFul/VSServices/ReceivePayment"; response = POST_RequestAsync(url, input_data); orderDetailesRespModel rootobj1 = JsonConvert.DeserializeObject <orderDetailesRespModel>(response); if (rootobj1.response.status == "2") { //call wallet table and resp table and txn cancel servie otpid = objResp.APPLICATIONNO objdata.status = true; objdata.seedDetails = rootobj1.response; objdata.walletDetails = objResp; objdata.orderDetails = dt1; } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } catch (Exception ex1) { objdata.status = false; objdata.result = ex1.Message.ToString(); } } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } catch (Exception ex) { objdata.status = false; objdata.result = ex.Message.ToString(); } return(objdata); }
public static dynamic makePayment(walletProcModel obj) { dynamic objdata = new ExpandoObject(); try { var input = new { vscode = obj.GSWSCODE, otpid = obj.APPLICATIONNO, transactionid = obj.GSWSREFNO, receiptid = "123", amounttobepaid = (float.Parse(obj.serviceCharge, CultureInfo.InvariantCulture.NumberFormat) + float.Parse("0", CultureInfo.InvariantCulture.NumberFormat)).ToString(), paystatus = "1" }; var mualinput = new { deptId = "1101", deptName = "Agriculture", serviceName = "updatePaymentStatus", serviceType = "REST", method = "POST", simulatorFlag = "false", application = "GWS", username = "******", data = input }; string input_data = JsonConvert.SerializeObject(mualinput); // string url = "https://eseed.ap.gov.in/eseed/RestFul/VSServices/updatePaymentStatus"; string url = ConfigurationManager.AppSettings["AgricultureApiBaseAddress"].ToString() + "Agriculture/v1/api/v1/agriculture"; string response = POST_RequestAsync(url, input_data); string mappath1 = HttpContext.Current.Server.MapPath("SeedsPaymentUpdationLogs"); Task WriteTask1 = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath1, response)); orderDetailesRespModel rootobj = JsonConvert.DeserializeObject <orderDetailesRespModel>(response); resProcModel objRes = new resProcModel(); objRes.type = "6"; objRes.txnId = obj.GSWSREFNO; objRes.orderId = obj.APPLICATIONNO; if (rootobj.response.status == "1") { objRes.isPaymentSuccess = "1"; } //else //{ // objRes.isPaymentSuccess = "0"; //} DataTable dt = resProc(objRes); if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["STATUS"].ToString() == "1" && rootobj.response.status == "1") { objdata.status = true; objdata.result = dt; } else { objdata.status = false; objdata.result = "Failed Make Payment Please try again !!!"; } } catch (Exception ex) { objdata.status = false; objdata.result = ex.Message.ToString(); } return(objdata); }