Example #1
0
 public static DataTable resProc(resProcModel obj)
 {
     try
     {
         OracleCommand cmd = new OracleCommand();
         cmd.InitialLONGFetchSize = 1000;
         cmd.CommandType          = CommandType.StoredProcedure;
         cmd.CommandText          = "GSWS_APSEEDS_CORP_RESP_PROC";        //"GSWS_RBK_IN_RESPONSE_PROC";
         cmd.Parameters.Add("P_TYPE", OracleDbType.Varchar2).Value                    = obj.type;
         cmd.Parameters.Add("P_TRANSACTION_ID", OracleDbType.Varchar2).Value          = obj.txnId;
         cmd.Parameters.Add("P_DEPT_TRANS_ID", OracleDbType.Varchar2).Value           = obj.orderId;
         cmd.Parameters.Add("P_DEPT_ID", OracleDbType.Varchar2).Value                 = obj.deptId;
         cmd.Parameters.Add("P_STATUS_CODE", OracleDbType.Varchar2).Value             = obj.statusCode;
         cmd.Parameters.Add("P_REMARKS", OracleDbType.Varchar2).Value                 = obj.remarks;
         cmd.Parameters.Add("P_SERVICE_ID", OracleDbType.Varchar2).Value              = obj.serviceId;
         cmd.Parameters.Add("P_AMOUNT", OracleDbType.Varchar2).Value                  = obj.amount;
         cmd.Parameters.Add("P_SERVICE_CHARGE", OracleDbType.Varchar2).Value          = obj.serviceCharge;
         cmd.Parameters.Add("P_TOTAL_AMOUNT", OracleDbType.Varchar2).Value            = obj.totalAmount;
         cmd.Parameters.Add("P_IS_PAYMENT_SUCCESS", OracleDbType.Varchar2).Value      = obj.isPaymentSuccess;
         cmd.Parameters.Add("P_IS_PAYMENT_REVERSAL", OracleDbType.Varchar2).Value     = obj.isPaymentReversal;
         cmd.Parameters.Add("P_IS_PAY_REV_SUCCESS", OracleDbType.Varchar2).Value      = obj.isPaymentRevSuccess;
         cmd.Parameters.Add("P_IS_TXNID_CANCEL_SUCCESS", OracleDbType.Varchar2).Value = obj.isTxnCancelSuccess;
         cmd.Parameters.Add("p_cur", OracleDbType.RefCursor).Direction                = ParameterDirection.Output;
         DataTable dtstatus = _Hel.GetProdgswsDataAdapter(cmd);
         return(dtstatus);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public static bool GSWSResTxnCancel(string orderId, string txnId, string type, string isPaymentReversal = null, string isPaymentRevSuccess = null, string isTxnRevSeccess = null)
 {
     try
     {
         resProcModel obj = new resProcModel();
         obj.txnId             = txnId;
         obj.type              = type;
         obj.orderId           = orderId;
         obj.isPaymentReversal = isPaymentReversal;
         DataTable dt = resProc(obj);
         if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1")
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Example #3
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 #4
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);
        }
Example #5
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);
        }
Example #6
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);
        }