public static dynamic pensionAppSub(pensionAppSubModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                if (obj.pensionType == "3" && string.IsNullOrEmpty(obj.disabilityId))
                {
                    objdata.status = false;
                    objdata.result = "Please Enter SADAREM ID";
                    return(objdata);
                }

                obj.encrypted_data = obj.encrypted_data.Replace(" ", "+");
                string   decrypted_text = EncryptDecryptAlgoritham.DecryptStringAES(obj.encrypted_data, "3fee5395f01bee349feed65629bd442a", obj.iv);
                decModel decData        = JsonConvert.DeserializeObject <decModel>(decrypted_text);

                tokenModel objToken = new tokenModel();
                objToken.username   = "******";
                objToken.password   = "******";
                objToken.wdsLoginId = decData.USERNAME;

                string tokenResponse = string.Empty;
                try
                {
                    tokenResponse = POST_RequestAsync(tokenrUrl, JsonConvert.SerializeObject(objToken));
                }
                catch (Exception ex)
                {
                    objdata.status = false;
                    objdata.result = "RESPONSE FROM PENSION DEPT : " + ex.Message.ToString();
                    return(objdata);
                }

                tokenResponseModel tokenRespObj = JsonConvert.DeserializeObject <tokenResponseModel>(tokenResponse);
                if (string.IsNullOrEmpty(tokenRespObj.Token))
                {
                    objdata.status = false;
                    objdata.result = "No Response from pension department token service !!!, Please try after some time";
                    return(objdata);
                }

                obj.loginId       = decData.USERNAME;
                obj.userName      = "******";
                obj.password      = "******";
                obj.token         = tokenRespObj.Token;
                obj.transactionId = decData.PS_TXN_ID;
                obj.systemIp      = HttpContext.Current.Request.UserHostAddress;

                string subResponse = string.Empty;
                try
                {
                    subResponse = POST_RequestAsync_sub(subrUrl, obj);
                }
                catch (Exception ex)
                {
                    objdata.status = false;
                    objdata.result = "RESPONSE FROM PENSION DEPT : " + ex.Message.ToString();
                    return(objdata);
                }
                subRespModel subResp = JsonConvert.DeserializeObject <subRespModel>(subResponse);

                if (subResp.Response != null && subResp.Response.status_Code == "101")
                {
                    transactionModel objTrans = new transactionModel();
                    objTrans.TYPE        = "2";
                    objTrans.TXN_ID      = decData.PS_TXN_ID;
                    objTrans.DEPT_ID     = "31";
                    objTrans.DEPT_TXN_ID = subResp.Response.BenTransId;
                    objTrans.BEN_ID      = obj.aadharNumber;
                    objTrans.STATUS_CODE = subResp.Response.status_Code;
                    objTrans.REMARKS     = subResp.Response.remarks;

                    transactionHelper transHel = new transactionHelper();
                    DataTable         dt       = transHel.transactionInsertion(objTrans);
                    if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1")
                    {
                        objdata.status = true;
                        objdata.result = subResp.Response.remarks + ", YOUR Grievance ID IS : " + subResp.Response.BenTransId;
                    }
                    else
                    {
                        objdata.status = false;
                        objdata.result = "Failed to submit Details, Please try again !!!";
                    }
                }
                else
                {
                    objdata.status = false;
                    objdata.result = "RESPONSE FROM PENSION DEPT : " + subResp.Response.remarks;
                }
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }
示例#2
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);
        }