Exemple #1
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);
        }
Exemple #2
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);
        }
Exemple #3
0
        public static dynamic recieptData(recieptModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                string          serialized_data = 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 = 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 = resProc(objRes);
                            if (dt1 != null && dt1.Rows.Count > 0)
                            {
                                var input = new
                                {
                                    id            = objResp.APPLICATIONNO,
                                    transactionId = objResp.GSWSREFNO
                                };
                                string          input_data = JsonConvert.SerializeObject(input);
                                string          url        = "https://hub.nukkadshops.com/v1/gew/updateTransaction";
                                string          response   = POST_RequestAsync(url, input_data);
                                rbkPayRespModel rootobj    = JsonConvert.DeserializeObject <rbkPayRespModel>(response);
                                if (rootobj.status == 200)
                                {
                                    var Innerinput = new
                                    {
                                        id = objResp.APPLICATIONNO
                                    };
                                    input_data = JsonConvert.SerializeObject(Innerinput);
                                    url        = "https://hub.nukkadshops.com/v1/gew/orderDetails";
                                    response   = POST_RequestAsync(url, input_data);
                                    orderDerailsRespModel rootobj1 = JsonConvert.DeserializeObject <orderDerailsRespModel>(response);
                                    if (rootobj1.Status == 200)
                                    {
                                        //call wallet table and resp table and txn cancel servie
                                        objdata.status        = true;
                                        objdata.rbkDetails    = rootobj1.Data;
                                        objdata.walletDetails = objResp;
                                        objdata.orderDetails  = dt1;
                                    }
                                    else
                                    {
                                        //Auto Reconcile Module
                                        walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO);
                                        objdata.status = false;
                                        objdata.result = "Failed Make Payment Please try again !!!";
                                    }
                                }
                                else
                                {
                                    //Auto Reconcile Module
                                    walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO);
                                    objdata.status = false;
                                    objdata.result = "Failed Make Payment Please try again !!!";
                                }
                            }
                            else
                            {
                                //Auto Reconcile Module
                                walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO);
                                objdata.status = false;
                                objdata.result = "Failed Make Payment Please try again !!!";
                            }
                        }
                        else
                        {
                            //Auto Reconcile Module
                            walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO);
                            objdata.status = false;
                            objdata.result = "Failed Make Payment Please try again !!!";
                        }
                    }
                    catch (Exception ex1)
                    {
                        //Auto Reconcile Module
                        walletAutoReconcile(objResp.APPLICATIONNO, objResp.GSWSREFNO);
                        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);
        }
Exemple #4
0
        public static dynamic PaymentDone_Update(walletProcModel obj1)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                var input = new
                {
                    id            = obj1.APPLICATIONNO,
                    transactionId = obj1.GSWSREFNO
                };
                string input_data = JsonConvert.SerializeObject(input);
                string url        = "https://hub.rbk.apagros.ap.gov.in/v1/gew/updateTransaction";                          //"https://hub.nukkadshops.com/v1/gew/updateTransaction";
                string response   = POST_RequestAsync(url, input_data);
                string mappath1   = HttpContext.Current.Server.MapPath("RBKPaymentUpdationLogs");
                Task   WriteTask1 = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath1, response));

                rbkPayRespModel rootobj = JsonConvert.DeserializeObject <rbkPayRespModel>(response);
                if (rootobj.status == 200)
                {
                    resProcModel objRes = new resProcModel();
                    objRes.type             = "9";         //update
                    objRes.txnId            = obj1.GSWSREFNO;
                    objRes.orderId          = obj1.APPLICATIONNO;
                    objRes.isPaymentSuccess = "1";
                    DataTable dt1 = resProc(objRes);

                    if (dt1 != null && dt1.Rows.Count > 0 && dt1.Rows[0]["STATUS"].ToString() == "1")
                    {
                        var Innerinput = new
                        {
                            id = obj1.APPLICATIONNO
                        };
                        input_data = JsonConvert.SerializeObject(Innerinput);
                        url        = "https://hub.rbk.apagros.ap.gov.in/v1/gew/orderDetails";
                        response   = POST_RequestAsync(url, input_data);
                        orderDerailsRespModel rootobj1 = JsonConvert.DeserializeObject <orderDerailsRespModel>(response);
                        if (rootobj1.Status == 200)
                        {
                            //call wallet table and resp table and txn cancel servie
                            objdata.status        = true;
                            objdata.rbkDetails    = rootobj1.Data;
                            objdata.walletDetails = obj1;
                            objdata.orderDetails  = dt1;
                        }
                        else
                        {
                            //Auto Reconcile Module
                            walletAutoReconcile(obj1.APPLICATIONNO, obj1.GSWSREFNO);
                            objdata.status = false;
                            objdata.result = "Failed Make Payment Please try again !!!";
                        }
                    }
                    else
                    {
                        //Auto Reconcile Module
                        walletAutoReconcile(obj1.APPLICATIONNO, obj1.GSWSREFNO);
                        objdata.status = false;
                        objdata.result = rootobj.message.ToString();
                    }
                }
                else
                {
                    resProcModel objRes = new resProcModel();
                    objRes.type             = "9";         //update
                    objRes.txnId            = obj1.GSWSREFNO;
                    objRes.orderId          = obj1.APPLICATIONNO;
                    objRes.isPaymentSuccess = "2";
                    //DataTable dt1 = resProc(objRes);
                    //Auto Reconcile Module
                    walletAutoReconcile(obj1.APPLICATIONNO, obj1.GSWSREFNO);
                    objdata.status = false;
                    objdata.result = "Failed Make Payment Please try again !!!";
                }
            }
            catch (Exception ex)
            {
                string mappath2   = HttpContext.Current.Server.MapPath("MakePaymentExceptionLogs");
                Task   WriteTask2 = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath2, "Error from Paymentdone Update:" + ex.Message.ToString() + JsonConvert.SerializeObject(obj1)));
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }