Exemple #1
0
        public void BindMerchantAccount(BindMerchantAuthIM im, Guid merchantId)
        {
            SecurityVerify.Verify <BindGoogleAuth>(new CustomVerifier("BindGoogleAuth"), SystemPlatform.FiiiPOS, merchantId.ToString(), (model) =>
            {
                return(model.PinVerified && model.GoogleVerified && model.CombinedVerified);
            });

            var mDAC     = new MerchantAccountDAC();
            var merchant = mDAC.GetById(merchantId);

            if (merchant == null)
            {
                throw new CommonException(ReasonCode.ACCOUNT_NOT_EXISTS, Resources.用户不存在);
            }

            if (string.IsNullOrEmpty(merchant.AuthSecretKey))
            {
                var oldFlag = merchant.ValidationFlag;
                var newFlag = ValidationFlagComponent.AddValidationFlag(oldFlag, ValidationFlag.GooogleAuthenticator);
                mDAC.UpdateGoogleAuthencator(merchant.Id, im.SecretKey, newFlag);
            }
            else
            {
                mDAC.SetAuthSecretById(merchant.Id, im.SecretKey);
            }
        }