Esempio n. 1
0
        public void ModifyCellphone(Guid accountId, string cellphone)
        {
            var dac     = new MerchantAccountDAC();
            var account = dac.GetById(accountId);

            SecurityVerify.Verify <ModifyCellphoneVerify>(new CustomVerifier("ModifyCellphone"), SystemPlatform.FiiiPOS, account.Id.ToString(), (model) =>
            {
                return(model.PinVerified && model.NewCellphoneVerified && model.CombinedVerified);
            });

            if (account.Cellphone == cellphone)
            {
                throw new CommonException(10000, Resources.新手机号码不能与原来的一致);
            }

            //修改手机号
            dac.UpdateCellphone(accountId, cellphone);

            var agent   = new MerchantProfileAgent();
            var profile = new MerchantProfile
            {
                MerchantId = accountId,
                Cellphone  = cellphone,
                Country    = account.CountryId
            };

            agent.UpdateCellphone(profile);
        }
Esempio n. 2
0
        public void ModifyCellphone(Guid accountId, string cellphone, string smsToken, string token, string gToken)
        {
            //
            var dac     = new MerchantAccountDAC();
            var account = dac.GetById(accountId);

            if (account.Cellphone == cellphone)
            {
                throw new CommonException(ReasonCode.FiiiPosReasonCode.CELLPHONE_MUST_BE_DIFFERENT, "新手机号码不能与原来的一致");
            }

            //验证短信码
            SecurityVerification sv = new SecurityVerification(SystemPlatform.FiiiPOS);

            sv.VerifyToken(accountId, smsToken, SecurityMethod.CellphoneCode);

            //验证pin码
            sv.VerifyToken(accountId, token, SecurityMethod.Pin);

            //验证google token 20180521
            new SecurityVerification(SystemPlatform.FiiiPOS).VerifyToken(accountId, gToken, SecurityMethod.SecurityValidate);

            //修改手机号
            dac.UpdateCellphone(accountId, cellphone);
        }