Ejemplo n.º 1
0
        public void PushTransferOut(long id)
        {
            var  transfer  = new UserTransferDAC().GetTransfer(id);
            Guid accountId = transfer.FromUserAccountId;

            var regId = RedisHelper.StringGet($"FiiiPay:Notice:UserId:{accountId}");

            var    lang        = RedisHelper.StringGet(REDIS_LANGUAGE_DBINDEX, $"FiiiPay:Language:{accountId}") ?? "en";
            string titleKey    = "TransferOutTitle";
            string subTitleKey = "TransferOutSubTitle";

            if (!(_resourcePropertyNames.Contains(titleKey) && _resourcePropertyNames.Contains(subTitleKey)))
            {
                throw new Exception("没有找到资源");
            }
            var title    = ResourceHelper.FiiiPay.GetFormatResource(titleKey, new CultureInfo(lang), transfer.CoinCode);
            var subTitle = ResourceHelper.FiiiPay.GetResource(subTitleKey, new CultureInfo(lang));

            List <string> regIdList = new List <string> {
                regId
            };

            string noticeId = "";

            MessagesComponent.AddMessage(accountId, UserType.User, id.ToString(), FiiiPayPushType.TYPE_USER_TRANSFER_OUT, titleKey, subTitleKey, transfer.CoinCode, title, subTitle, out noticeId);

            RegPush(FiiiPayPushType.TYPE_USER_TRANSFER_OUT, regIdList, id, title, subTitle, noticeId);
            LogHelper.Info($"--------{lang}------{title}----------{subTitle}");
        }
Ejemplo n.º 2
0
        public void PushTransferInto(long id)
        {
            var  transfer  = new UserTransferDAC().GetTransfer(id);
            Guid accountId = transfer.ToUserAccountId;

            //TODO:
            //var profile = new UserProfileAgent().GetUserProfile(transfer.FromUserAccountId);
            //string showFullname = (string.IsNullOrEmpty(profile.FirstName) ? "" : "* ") + profile.LastName;
            var regId = RedisHelper.StringGet($"FiiiPay:Notice:UserId:{accountId}");

            var    lang        = RedisHelper.StringGet(REDIS_LANGUAGE_DBINDEX, $"FiiiPay:Language:{accountId}") ?? "en";
            string titleKey    = "TransferIntoTitle";
            string subTitleKey = "TransferIntoSubTitle";

            if (!(_resourcePropertyNames.Contains(titleKey) && _resourcePropertyNames.Contains(subTitleKey)))
            {
                throw new Exception("没有找到资源");
            }
            var title    = ResourceHelper.FiiiPay.GetFormatResource(titleKey, new CultureInfo(lang), transfer.CoinCode);
            var subTitle = ResourceHelper.FiiiPay.GetFormatResource(subTitleKey, new CultureInfo(lang), "***");

            List <string> regIdList = new List <string> {
                regId
            };

            string noticeId = "";

            MessagesComponent.AddMessage(accountId, UserType.User, id.ToString(), FiiiPayPushType.TYPE_USER_TRANSFER_INTO, titleKey, subTitleKey, transfer.CoinCode, title, subTitle, out noticeId);

            RegPush(FiiiPayPushType.TYPE_USER_TRANSFER_INTO, regIdList, id, title, subTitle, noticeId);
            LogHelper.Info($"--------{lang}------{title}----------{subTitle}");
        }
Ejemplo n.º 3
0
        public TransferDetailOM Detail(Guid accountId, long transferId)
        {
            var    transfer      = new UserTransferDAC().GetTransfer(transferId);
            Guid   showAccountId = Guid.Empty;
            string transferType  = "";

            if (accountId == transfer.FromUserAccountId)
            {
                transferType  = Resources.TransferOut;
                showAccountId = transfer.ToUserAccountId;
            }
            else if (accountId == transfer.ToUserAccountId)
            {
                transferType  = Resources.TransferInto;
                showAccountId = transfer.FromUserAccountId;
            }

            UserProfile profile        = new UserProfileAgent().GetUserProfile(showAccountId);
            var         account        = new UserAccountDAC().GetById(showAccountId);
            var         country        = new CountryComponent().GetById(profile.Country.Value);
            var         cryptoCurrency = new CryptocurrencyDAC().GetById(transfer.CoinId);

            return(new TransferDetailOM
            {
                Status = (TransactionStatus)transfer.Status,
                StatusStr = Resources.OrderCompleted,
                TradeType = Resources.Transfer,
                TransferType = transferType,
                CoinCode = transfer.CoinCode,
                Amount = transfer.Amount.ToString(cryptoCurrency.DecimalPlace),
                AccountName = country.PhoneCode + " *******" + account.Cellphone.Substring(Math.Max(0, account.Cellphone.Length - 4)),
                Fullname = profile == null ? "" : ((string.IsNullOrEmpty(profile.FirstName) ? "" : "* ") + profile.LastName),
                Timestamp = transfer.Timestamp.ToUnixTime().ToString(),
                OrderNo = transfer.OrderNo
            });
        }