예제 #1
0
        //汇付模拟发起的请求,没有携带用户的cookie,造成邀请丢失,邀请关系逻辑迁移至注册成功
        /// <summary>
        /// 注册成功汇付返回通知
        /// </summary>
        /// <returns></returns>
        public ActionResult Succ_Registered()
        {
            int            it        = -10000;
            string         username  = "";
            string         useremail = "";
            ReUserRegister m         = new ReUserRegister();

            m.CmdId     = DNTRequest.GetString("CmdId");
            m.RespCode  = DNTRequest.GetString("RespCode");
            m.RespDesc  = DNTRequest.GetString("RespDesc");
            m.MerCustId = DNTRequest.GetString("MerCustId");
            m.UsrId     = DNTRequest.GetString("UsrId");
            m.UsrCustId = DNTRequest.GetString("UsrCustId");
            m.BgRetUrl  = DNTRequest.GetString("BgRetUrl");
            m.TrxId     = DNTRequest.GetString("TrxId");
            m.RetUrl    = DNTRequest.GetString("RetUrl");
            m.MerPriv   = DNTRequest.GetString("MerPriv");
            m.IdType    = DNTRequest.GetString("IdType");
            m.IdNo      = DNTRequest.GetString("IdNo");
            m.UsrMp     = DNTRequest.GetString("UsrMp");
            useremail   = DNTRequest.GetString("UsrEmail");
            m.UsrEmail  = useremail;
            username    = HttpUtility.UrlDecode(DNTRequest.GetString("UsrName"));
            m.UsrName   = username;
            m.ChkValue  = DNTRequest.GetString("ChkValue");
            string        log    = "注册开户返回报文:" + FastJSON.toJOSN(m);
            StringBuilder chkVal = new StringBuilder();

            chkVal.Append(m.CmdId);
            chkVal.Append(m.RespCode);
            chkVal.Append(m.MerCustId);
            chkVal.Append(m.UsrId);
            chkVal.Append(m.UsrCustId);
            chkVal.Append(m.BgRetUrl);
            chkVal.Append(m.TrxId);
            chkVal.Append(m.RetUrl);
            chkVal.Append(m.MerPriv);
            string chkv = chkVal.ToString();
            //私钥文件的位置(这里是放在了站点的根目录下)
            string merKeyFile = AppDomain.CurrentDomain.BaseDirectory + Utils.GetPgPubk();
            int    ret        = DllInterop.VeriSignMsg(merKeyFile, chkv, chkv.Length, m.ChkValue);

            log += ";ret:" + ret;
            if (ret == 0)
            {
                B_member_table ob = new B_member_table();
                M_member_table pm = new M_member_table();
                if (m.RespCode == "000")
                {
                    //为避免重复调用,增加缓存校验
                    string cachename = "UserRegister" + m.TrxId;
                    if (Utils.GeTThirdCache(cachename) == 0)
                    {
                        Utils.SetThirdCache(cachename);
                        M_bonus_account_water mbaw = new M_bonus_account_water();
                        B_bonus_account_water bbaw = new B_bonus_account_water();
                        B_usercenter          b    = new B_usercenter();
                        it   = b.Succ_Reg(m);
                        log += ";汇付开户成功后进行用户数据更新返回:" + it;
                        if (it > 0)
                        {
                            pm = ob.GetModel(Utils.GetUserSplit(m.UsrId));
                            ViewBag.registerid = pm.registerid;

                            //新人注册奖励
                            ActFacade act = new ActFacade();
                            log += ";注册ID:" + pm.registerid;
                            act.SendBonusAfterRegister(pm.registerid, EnumCommon.E_hx_ActivityTable.E_ActTargetPlatform.web);
                        }
                        else
                        {
                            /*第三方成功,本地服务器操作失败*/
                        }
                    }
                }
            }
            else
            {
                log += "验签不成功";
                /*验签不成功*/
            }
            LogInfo.WriteLog(log);
            return(View(m));
        }