public IHttpActionResult recieptData(dynamic data) { string serialized_data = token_gen.Authorize_aesdecrpty(data); recieptModel rootobj = JsonConvert.DeserializeObject <recieptModel>(serialized_data); return(Ok(seedsPaymentHelper.recieptData(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); }