示例#1
0
        public static dynamic OrderDetails(seedPaymentModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                var input = new
                {
                    vscode = "11190157",
                    otpid  = obj.orderId
                };
                var mualinput = new
                {
                    deptId        = "1101",
                    deptName      = "Agriculture",
                    serviceName   = "ReceivePayment",
                    serviceType   = "REST",
                    method        = "POST",
                    simulatorFlag = "false",
                    application   = "GWS",
                    username      = "******",
                    data          = input
                };
                string input_data = JsonConvert.SerializeObject(mualinput);
                string url        = ConfigurationManager.AppSettings["AgricultureApiBaseAddress"].ToString() + "Agriculture/v1/api/v1/agriculture";
                //string url = "https://eseed.ap.gov.in/eseed/RestFul/VSServices/ReceivePayment";
                string response = POST_RequestAsync(url, input_data);
                orderDetailesRespModel rootobj = JsonConvert.DeserializeObject <orderDetailesRespModel>(response);

                if (rootobj.response.status == "1" || rootobj.response.status == "2")
                {
                    resProcModel objres = new resProcModel();
                    objres.type      = "5";
                    objres.txnId     = obj.orderId;
                    objdata.status   = true;
                    objdata.result   = rootobj.response;
                    objdata.DataList = resProc(objres);
                    objdata.Pflag    = rootobj.response.status;
                }
                else
                {
                    objdata.status = false;
                    objdata.result = rootobj.response.msg;
                }
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }
示例#2
0
        public IHttpActionResult paymentOrderDetails(dynamic data)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                string           serialized_data = token_gen.Authorize_aesdecrpty(data);
                seedPaymentModel rootobj         = JsonConvert.DeserializeObject <seedPaymentModel>(serialized_data);
                return(Ok(seedsPaymentHelper.paymentOrderDetails(rootobj)));
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(Ok(objdata));
        }
示例#3
0
        public static dynamic paymentOrderDetails(seedPaymentModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                obj.encrypted_data = obj.encrypted_data.Replace(" ", "+");
                string decrypted_text = EncryptDecryptAlgoritham.DecryptStringAES(obj.encrypted_data, "3fee5395f01bee349feed65629bd442a", obj.iv);
                var    input          = new
                {
                    vscode = "11190157",
                    otpid  = obj.orderId
                };
                var mualinput = new
                {
                    deptId        = "1234",
                    deptName      = "Agriculture",
                    serviceName   = "ReceivePayment",
                    serviceType   = "REST",
                    method        = "POST",
                    simulatorFlag = "false",
                    application   = "GWS",
                    username      = "******",
                    data          = input
                };

                string   input_data = JsonConvert.SerializeObject(mualinput);
                decModel decData    = JsonConvert.DeserializeObject <decModel>(decrypted_text);
                //   decData.PS_TXN_ID = DateTime.Now.ToString("yyyymmddhhmmssfff");
                string url = ConfigurationManager.AppSettings["AgricultureApiBaseAddress"].ToString() + "Agriculture/v1/api/v1/agriculture";
                // string url = "https://eseed.ap.gov.in/eseed/RestFul/VSServices/ReceivePayment";
                string response = POST_RequestAsync(url, input_data);
                orderDetailesRespModel rootobj = JsonConvert.DeserializeObject <orderDetailesRespModel>(response);

                if (rootobj.response.status == "1" || rootobj.response.status == "2")
                {
                    resProcModel objRes = new resProcModel();
                    objRes.type          = "1";
                    objRes.txnId         = decData.PS_TXN_ID;
                    objRes.orderId       = obj.orderId;
                    objRes.deptId        = "11";
                    objRes.statusCode    = rootobj.response.status.ToString();
                    objRes.remarks       = rootobj.response.msg;
                    objRes.serviceId     = "1101025";
                    objRes.userCharge    = rootobj.response.amountTobePaid.ToString();
                    objRes.serviceCharge = "0";
                    objRes.totalAmount   = (float.Parse(objRes.userCharge, CultureInfo.InvariantCulture.NumberFormat) + float.Parse(objRes.serviceCharge, CultureInfo.InvariantCulture.NumberFormat)).ToString();

                    DataTable dt = resProc(objRes);
                    if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1")
                    {
                        rootobj.response.gswsTxnId = decData.PS_TXN_ID;
                        objdata.status             = true;
                        objdata.result             = rootobj.response;
                    }
                    else if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "2")
                    {
                        objdata.status = false;
                        objdata.result = "These transaction id is already used please login and try again !!!";
                    }
                    else
                    {
                        objdata.status = false;
                        objdata.result = "Failed to Fetch Record";
                    }
                }
                else
                {
                    objdata.status = false;
                    objdata.result = rootobj.response.msg;
                }
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }