コード例 #1
0
ファイル: OrderComponent.cs プロジェクト: BryceStory/BS.FPApp
        private string GetUserMastMaskedCellphone(Guid userAccountId)
        {
            var user    = new UserAccountDAC().GetById(userAccountId);
            var country = new CountryComponent().GetById(user.CountryId);

            return(CellphoneExtension.GetMaskedCellphone(country.PhoneCode, user.Cellphone));
        }
コード例 #2
0
        public MerchantAccountDTO GetMerchantInfoById(Guid accountId)
        {
            MerchantAccount account = new MerchantAccountDAC().GetById(accountId);
            MerchantProfile profile = new MerchantProfileAgent().GetMerchantProfile(accountId);

            //LogHelper.Info("GetMerchantInfoById " + accountId);

            var    token  = Generate(account.SecretKey, account.RegistrationDate);
            string key    = string.Format(RedisKeys.FiiiPOS_APP_BroadcastNo, token);
            var    result = RedisHelper.StringGet(FiiiPOSTokenDbIndex, key);

            if (string.IsNullOrWhiteSpace(result))
            {
                RedisHelper.StringSet(FiiiPOSTokenDbIndex, key, accountId.ToString());
            }

            bool isMiningEnabled = false;

            if (account.POSId.HasValue)
            {
                POS pos = new POSDAC().GetById(account.POSId.Value);
                isMiningEnabled = pos?.IsMiningEnabled ?? false;
            }

            return(new MerchantAccountDTO
            {
                Id = account.Id,
                Cellphone = CellphoneExtension.GetMaskedCellphone(account.PhoneCode, account.Cellphone),
                Username = account.Username,
                MerchantName = account.MerchantName,
                Status = account.Status,
                Email = account.Email,
                CountryId = account.CountryId,
                IsAllowWithdrawal = account.IsAllowWithdrawal,
                IsAllowAcceptPayment = account.IsAllowAcceptPayment,
                FiatCurrency = account.FiatCurrency,
                Receivables_Tier = account.Receivables_Tier,
                Markup = account.Markup,
                ValidationFlag = account.ValidationFlag,
                Lv1VerifyStatus = profile.L1VerifyStatus,
                Type = account.WithdrawalFeeType,
                IsMiningEnabled = isMiningEnabled,
                BroadcastNo = token
            });
        }