public void VerifyUpdatePinPin(UserAccount user, string pin)
        {
            SecurityVerify.Verify(new PinVerifier(), SystemPlatform.FiiiPay, user.Id.ToString(), user.Pin, pin);

            var model = new UpdatePinVerify
            {
                PinVerified = true
            };

            SecurityVerify.SetModel(new CustomVerifier("UpdatePin"), SystemPlatform.FiiiPay, user.Id.ToString(), model);
        }
        //public List<UserSecretES> ListAllSecretKeys()
        //{
        //    return new MerchantAccountDAC().ListAllSecretKeys();
        //}

        //public GetListByCodeListOM GetListByCodeList(string codes)
        //{
        //    var codeInfoList = new TokenAgent().GetMerchantIntoListByCodes(codes, false);
        //    var idList = codeInfoList.Select(a => a.MerchantId).ToList();
        //    var merchantAccountList = new MerchantAccountDAC().GetListByIdList(idList).Where(e => e.POSId != null).ToList();
        //    var profileList = GetMerchanstProfileInfo(merchantAccountList);

        //    var list = new List<GetListByCodeListOMItem>();
        //    foreach (var merchantAccount in merchantAccountList)
        //    {
        //        var profile = profileList.FirstOrDefault(e => e.MerchantId == merchantAccount.Id);
        //        var codeInfo = codeInfoList.FirstOrDefault(b => b.MerchantId == merchantAccount.Id);
        //        list.Add(new GetListByCodeListOMItem
        //        {
        //            Id = merchantAccount.Id.ToString(),
        //            MerchantAccount = GetMasked(merchantAccount.Username),
        //            MerchantName = merchantAccount.MerchantName,
        //            IconUrl = merchantAccount.Photo,
        //            IsAllowAcceptPayment = merchantAccount.IsAllowAcceptPayment,
        //            IsVerified = profile?.Status == VerifyStatus.Certified,
        //            RandomCode = codeInfo?.MerchantCode
        //        });
        //    }

        //    return new GetListByCodeListOM
        //    {
        //        List = list
        //    };
        //}

        //private List<MerchantVerifyStatusOM> GetMerchanstProfileInfo(List<MerchantAccount> list)
        //{
        //    var groupIdDic = list.GroupBy(e => e.CountryId).ToDictionary(e => e.Key, e => e.Select(a => a.Id).ToList());

        //    var resultList = new List<MerchantVerifyStatusOM>();

        //    foreach (var kv in groupIdDic)
        //    {
        //        var result = new MerchantProfileAgent().GetVerifyStatusListByIds(kv.Key, kv.Value);
        //        if (result != null)
        //        {
        //            resultList.AddRange(result);
        //        }
        //    }
        //    return resultList;
        //}

        //private string GetMasked(string str)
        //{
        //    if (string.IsNullOrEmpty(str))
        //    {
        //        return "";
        //    }

        //    return str[0] + "*****" + str.Substring(Math.Max(0, str.Length - 4));
        //}

        //public void SettingPIN(Guid merchantAccountId, string pin)
        //{
        //    MerchantAccountDAC dac = new MerchantAccountDAC();

        //    var account = dac.GetById(merchantAccountId);
        //    if (account == null)
        //        return;
        //    if (!string.IsNullOrEmpty(account.PIN))
        //        return;

        //    dac.SettingPinById(merchantAccountId, PasswordHasher.HashPassword(pin));
        //}

        //public bool VerifyBusinessLicense(Guid accountId, string token, string businessLicense)
        //{
        //    SecurityVerification sv = new SecurityVerification(SystemPlatform.FiiiPOS);
        //    Dictionary<string, string> dic = sv.VerifyTokenWithExts<Dictionary<string, string>>(token, SecurityMethod.CellphoneCode, false);

        //    var agent = new MerchantProfileAgent();
        //    var profile = agent.GetMerchantProfile(accountId);

        //    if (profile?.VerifyStatus != VerifyStatus.Certified)
        //        return false;

        //    var result = profile.LicenseNo == businessLicense;

        //    if (result)
        //    {
        //        dic["BusinessLicense"] = businessLicense;
        //        sv.UpdateTokenExts(SecurityMethod.CellphoneCode, token, dic);
        //    }

        //    return result;
        //}

        //public MerchantAccount GetMerchantAccountByIdOrCode(Guid? merchantId, string code)
        //{
        //    if (!merchantId.HasValue)
        //    {
        //        merchantId = new TokenAgent().GetMerchantIntoByCode(code)?.MerchantId;
        //    }

        //    return merchantId.HasValue ? new MerchantAccountDAC().GetById(merchantId.Value) : null;
        //}


        public void VerifyModifyPINPIN(Guid accountId, string pin)
        {
            MerchantAccount merchant = new MerchantAccountDAC().GetById(accountId);

            if (merchant == null)
            {
                throw new CommonException(ReasonCode.ACCOUNT_NOT_EXISTS, Resources.用户不存在);
            }
            SecurityVerify.Verify(new PinVerifier(), SystemPlatform.FiiiPOS, accountId.ToString(), merchant.PIN, pin);

            var model = new UpdatePinVerify
            {
                PinVerified = true
            };

            SecurityVerify.SetModel(new CustomVerifier("ModifyPIN"), SystemPlatform.FiiiPOS, accountId.ToString(), model);
        }