Exemplo n.º 1
0
        public void VerifyResetPinCombine(Guid accountId, string idNumber, string smsCode, string googleCode)
        {
            MerchantAccount merchant = new MerchantAccountDAC().GetById(accountId);

            if (merchant == null)
            {
                throw new CommonException(ReasonCode.ACCOUNT_NOT_EXISTS, Resources.用户不存在);
            }
            List <CombinedVerifyOption> options = new List <CombinedVerifyOption>
            {
                new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode
                },
                new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode
                }
            };
            UserSecrets userSecrets = new UserSecrets
            {
                ValidationFlag      = merchant.ValidationFlag,
                GoogleAuthSecretKey = merchant.AuthSecretKey
            };
            MerchantProfile profile = new MerchantProfileAgent().GetMerchantProfile(accountId);

            if (profile != null && profile.L1VerifyStatus == FiiiPay.Entities.Enums.VerifyStatus.Certified)
            {
                options.Add(new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.IDNumber, Code = idNumber
                });
                userSecrets.IdentityNo = profile.IdentityDocNo;
            }

            SecurityVerify.CombinedVerify(SystemPlatform.FiiiPOS, accountId.ToString(), userSecrets, options);

            var model = new ResetPinVerify {
                CombinedVerified = true
            };

            SecurityVerify.SetModel(new CustomVerifier("ResetPin"), SystemPlatform.FiiiPOS, accountId.ToString(), model);
        }
Exemplo n.º 2
0
        public void VerifyResetPinCombine(Guid accountId, string idNumber, string smsCode, string googleCode)
        {
            UserAccount user = new UserAccountDAC().GetById(accountId);
            List <CombinedVerifyOption> options = new List <CombinedVerifyOption>
            {
                new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode
                },
                new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode
                }
            };
            UserSecrets userSecrets = new UserSecrets
            {
                ValidationFlag      = user.ValidationFlag,
                GoogleAuthSecretKey = user.AuthSecretKey
            };
            UserProfile profile = new UserProfileAgent().GetUserProfile(user.Id);

            if (profile != null && profile.L1VerifyStatus == VerifyStatus.Certified)
            {
                options.Add(new CombinedVerifyOption {
                    AuthType = (byte)ValidationFlag.IDNumber, Code = idNumber
                });
                userSecrets.IdentityNo = profile.IdentityDocNo;
            }

            SecurityVerify.CombinedVerify(SystemPlatform.FiiiPay, user.Id.ToString(), userSecrets, options);

            var model = new ResetPinVerify()
            {
                CombinedVerified = true
            };

            SecurityVerify.SetModel(new CustomVerifier("ResetPin"), SystemPlatform.FiiiPay, user.Id.ToString(), model);
        }