Example #1
0
        public IHttpActionResult paymentOrderDetails(dynamic data)
        {
            string           serialized_data = token_gen.Authorize_aesdecrpty(data);
            rbkPaymentsModel rootobj         = JsonConvert.DeserializeObject <rbkPaymentsModel>(serialized_data);

            return(Ok(rbkPaymentsHelper.paymentOrderDetails(rootobj)));
        }
Example #2
0
        public static dynamic orderDetails(rbkPaymentsModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                var input = new
                {
                    id = obj.orderId
                };
                string input_data             = JsonConvert.SerializeObject(input);
                string url                    = "https://hub.rbk.apagros.ap.gov.in/v1/gew/orderDetails";
                string response               = POST_RequestAsync(url, input_data);
                orderDerailsRespModel rootobj = JsonConvert.DeserializeObject <orderDerailsRespModel>(response);

                if (rootobj.Status == 200)
                {
                    resProcModel objRes = new resProcModel();
                    objRes.type  = "8";                    //update
                    objRes.txnId = obj.orderId;
                    DataTable dt1 = resProc(objRes);
                    objdata.status       = true;
                    objdata.result       = rootobj.Data;
                    objdata.OrderDetails = dt1;
                }
                else
                {
                    objdata.status = false;
                    objdata.result = rootobj.Message;
                }
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }
Example #3
0
        public static dynamic paymentOrderDetails(rbkPaymentsModel 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
                {
                    id = obj.orderId
                };
                string   input_data = JsonConvert.SerializeObject(input);
                decModel decData    = JsonConvert.DeserializeObject <decModel>(decrypted_text);
                decData.PS_TXN_ID = decData.PS_TXN_ID;                //DateTime.Now.ToString("yyyymmddhhmmssfff");
                string url      = "https://hub.rbk.apagros.ap.gov.in/v1/gew/orderDetails";
                string response = POST_RequestAsync(url, input_data);
                orderDerailsRespModel rootobj = JsonConvert.DeserializeObject <orderDerailsRespModel>(response);

                if (rootobj.Status == 200)
                {
                    resProcModel objRes = new resProcModel();
                    objRes.type          = "7";
                    objRes.txnId         = decData.PS_TXN_ID;
                    objRes.orderId       = obj.orderId;
                    objRes.deptId        = "11";
                    objRes.statusCode    = rootobj.Status.ToString();
                    objRes.remarks       = rootobj.Message;
                    objRes.serviceId     = "110102601";
                    objRes.amount        = rootobj.Data.Amount.ToString();
                    objRes.serviceCharge = "0";                     //rootobj.Data.Amount.ToString();
                    objRes.totalAmount   = (0 + rootobj.Data.Amount).ToString();

                    DataTable dt = resProc(objRes);
                    if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1")
                    {
                        rootobj.Data.gswsTxnId = decData.PS_TXN_ID;
                        objdata.status         = true;
                        objdata.result         = rootobj.Data;
                    }
                    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.Message;
                }
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }