public COM.MEMBERS.SQLReturnMessageNValue DMT_REMITTANCE(ENT.DMT_MoneyRemittance obj)
        {
            try
            {
                string[,] param =
                {
                    { "USERID",            obj.userid.ToString()              },
                    { "BENEFICIARYCODE",   obj.mt_beneficiarycode.ToString()  },
                    { "BENEFICIARYMOBILE", obj.mt_BeneficiryMobile.ToString() },
                    { "CUSTOMERMOBILE",    obj.mt_customermobile.ToString()   },
                    { "IFSCCODE",          obj.mt_ifsc.ToString()             },
                    { "ACOOUNTNO",         obj.mt_accountnumber.ToString()    },
                    { "ROUTINGTYPE",       obj.mt_routingtype.ToString()      },
                    { "BENEFICIARYNAME",   obj.mt_BeneficiaryName.ToString()  },
                    { "REMARKS",           obj.mt_remarks.ToString()          },
                    { "AMOUNT",            obj.mt_amount.ToString()           },
                    { "TRANSACTIONMODE",   obj.mt_mode.ToString()             },
                    { "RemitterId",        obj.mt_RemitterId.ToString()       },
                    { "IpAddress",         obj.mt_Ipaddress.ToString()        },
                    { "RequestNo",         obj.mt_RequestNo.ToString()        },
                    { "Response",          obj.mt_Response.ToString()         }
                };

                COM.MEMBERS.SQLReturnMessageNValue Mval = SqlHelper.ExecuteProcedureReturnMessageNValue("DMT_REMITTANCE", param);

                return(Mval);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public COM.MEMBERS.SQLReturnMessageNValue DMT_GetCharge(String Amount, Guid mainid, int userlevel)
 {
     try
     {
         string[,] param = { { "AMOUNT", Amount }, { "mainid", mainid.ToString() }, { "userlevel", userlevel.ToString() } };
         COM.MEMBERS.SQLReturnMessageNValue Mval = SqlHelper.ExecuteProcedureReturnMessageNValue("DMT_GET_CHARGE", param);
         return(Mval);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public COM.MEMBERS.SQLReturnMessageNValue DMT_VALIDATE_Transaction(String UserId, String Amount)
 {
     try
     {
         string[,] param =
         {
             { "USERID", UserId },
             { "AMOUNT", Amount }
         };
         COM.MEMBERS.SQLReturnMessageNValue Mval = SqlHelper.ExecuteProcedureReturnMessageNValue("DMT_REMITTANCE_VALID", param);
         return(Mval);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public JsonResult doRecharge(ENT.Recharge recharge)
        {
            GlobalVarible.Clear();
            try
            {
                recharge.reqvia      = "WEB";
                recharge.countrycode = "IN";
                recharge.accountref  = DateTime.Now.Ticks.ToString();
                recharge.userid      = _LoginUserId;
                recharge.ipaddress   = Request.UserHostAddress.ToString();

                // this will be provided after recharge

                recharge.requestid = string.Empty;

                COM.MEMBERS.SQLReturnMessageNValue response = new COM.MEMBERS.SQLReturnMessageNValue();

                using (BAL.Recharge objBal = new BAL.Recharge())
                {
                    response = objBal.DoRecharge(recharge, _LoginUserId, recharge.ipaddress);
                }

                string LocalID = string.Empty;

                if (response.Outval == 1)
                {
                    // manage route here to call real api for process recharge.
                    string[] REQ = response.Outmsg.Split(';');

                    // add log or response here.
                    new BAL.Log().Insert(new ENT.Log()
                    {
                        logdata         = REQ[1],
                        CreatedDateTime = DateTime.Now,
                        type            = COM.MyEnumration.LOGTYPE.DATA,
                        title           = "PORTAL-REQUEST"
                    });

                    #region WEBSMITHAPI
                    if (REQ[0].Split(':')[2].StartsWith("W"))
                    {
                        LocalID = REQ[0].Split(':')[2].StartsWith("W") ? REQ[0].Split(':')[2].Remove(0, 1) : REQ[0].Split(':')[2];
                        ProcessRecharge(recharge.numbertorecharge, recharge.operatorcode, (int)recharge.amount, LocalID, recharge.reqtype);
                    }
                    else if (REQ[0].Split(':')[2].StartsWith("X"))
                    {
                        LocalID = REQ[0].Split(':')[2].StartsWith("X") ? REQ[0].Split(':')[2].Remove(0, 2) : REQ[0].Split(':')[2];

                        ProcessINOUT(REQ[1], LocalID);
                    }
                    #endregion

                    GlobalVarible.AddMessage(REQ[0].Split(',')[0]);
                }
                else
                {
                    GlobalVarible.AddError(response.Outmsg);
                }
                return(Json(MySession.Current.MessageResult));
            }
            catch (Exception ex)
            {
                ERRORREPORTING.Report(ex, Request.Url.ToString(), _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(recharge));
                GlobalVarible.AddError(ex.Message);
                return(Json(MySession.Current.MessageResult));
            }
        }
Ejemplo n.º 5
0
        public HttpResponseMessage DoRechargeEnc(doRechargeModel data)
        {
            try
            {
                string token = _LOGINUSERID.ToString();

                if (String.IsNullOrEmpty(token))
                {
                    GlobalVarible.AddError("Unable to get token");
                    ERRORREPORTING.Report(new Exception("UNABLE TO GET TOKEN"), _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(data));
                    return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
                }

                string reqdata = ENCDESC.Decrypt(data.data, token, data.userid);

                ENT.Recharge recharge = new ENT.Recharge();

                recharge = new JavaScriptSerializer().Deserialize <ENT.Recharge>(reqdata);

                try
                {
                    ERRORREPORTING.Report(new Exception("API CALL STARTED"), _REQUESTURL, _LOGINUSERID, _ERRORKEY, reqdata);

                    recharge.reqvia      = "GPRS";
                    recharge.countrycode = "IN";
                    recharge.accountref  = DateTime.Now.Ticks.ToString();
                    recharge.userid      = _LOGINUSERID;
                    recharge.ipaddress   = HttpContext.Current.Request.UserHostAddress;

                    // this will be provided after recharge

                    recharge.requestid = string.Empty;

                    COM.MEMBERS.SQLReturnMessageNValue response = new COM.MEMBERS.SQLReturnMessageNValue();

                    using (BAL.Recharge objBal = new BAL.Recharge())
                    {
                        response = objBal.DoRecharge(recharge, _LOGINUSERID, recharge.ipaddress);
                    }

                    if (response.Outval == 1)
                    {
                        string[] REQ = response.Outmsg.Split(';');

                        // process for real recharge here.

                        GlobalVarible.AddMessage(REQ[0].Split(',')[0]);
                    }
                    else
                    {
                        GlobalVarible.AddError(response.Outmsg);
                    }
                    return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
                }
                catch (Exception ex)
                {
                    ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(recharge));
                    GlobalVarible.AddError(ex.Message);
                    return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
                }
            }
            catch (Exception ex)
            {
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(data));
                GlobalVarible.AddError(ex.Message);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }