Exemplo n.º 1
0
        /// <summary>
        /// 获得商家Profile信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public MerchantProfile GetMerchantProfile(Guid id)
        {
            MerchantAccountDAC merchantAccountDAC = new MerchantAccountDAC();
            var merchantAccount = merchantAccountDAC.GetById(id);

            if (merchantAccount == null)
            {
                return(null);//查无此人
            }
            var             router  = ProfileFactory.GetByCountryId(merchantAccount.CountryId);
            MerchantProfile profile = null;

            if (router == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(router);
                profile = dac.GetById(id);
            }
            return(profile);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得MerchantProfile+Account信息体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public MerchantProfileSet GetMerchantProfileSet(Guid id)
        {
            MerchantProfileSet profileSet = new MerchantProfileSet();
            //使用Id查询本库的基本信息
            MerchantAccountDAC merchantAccountDAC = new MerchantAccountDAC();
            var merchantAccount = merchantAccountDAC.GetById(id);

            if (merchantAccount == null)
            {
                return(null);//查无此人
            }
            //赋值
            profileSet.Id           = merchantAccount.Id;
            profileSet.Cellphone    = merchantAccount.Cellphone;
            profileSet.Username     = merchantAccount.Username;
            profileSet.MerchantName = merchantAccount.MerchantName;
            //profileSet.IsVerified = merchantAccount.IsVerified;
            profileSet.POSId = merchantAccount.POSId;
            //profileSet.BeaconId = merchantAccount.BeaconId;
            profileSet.Email            = merchantAccount.Email;
            profileSet.IsVerifiedEmail  = merchantAccount.IsVerifiedEmail;
            profileSet.CountryId        = merchantAccount.CountryId;
            profileSet.RegistrationDate = merchantAccount.RegistrationDate;
            profileSet.Photo            = merchantAccount.Photo;
            profileSet.PIN                  = merchantAccount.PIN;
            profileSet.SecretKey            = merchantAccount.SecretKey;
            profileSet.IsAllowWithdrawal    = merchantAccount.IsAllowWithdrawal;
            profileSet.IsAllowAcceptPayment = merchantAccount.IsAllowAcceptPayment;
            profileSet.FiatCurrency         = merchantAccount.FiatCurrency;
            profileSet.AuthSecretKey        = merchantAccount.AuthSecretKey;
            profileSet.ValidationFlag       = merchantAccount.ValidationFlag;

            //使用基本信息中的国别匹配kyc服务器的位置
            if (merchantAccount.POSId.HasValue)
            {
                POS pos = new POSDAC().GetById(merchantAccount.POSId.Value);
                if (pos != null)
                {
                    profileSet.SN = pos.Sn;
                }
            }
            var             server          = ProfileFactory.GetByCountryId(merchantAccount.CountryId);
            MerchantProfile merchantProfile = null;

            if (server == null)
            {
                //查询HK数据库
                MerchantProfileDAC merchantProfileDAC = new MerchantProfileDAC();
                //赋值
                merchantProfile = merchantProfileDAC.GetById(id);
            }
            else
            {
                MerchantProfileRPC merchantProfileDAC = new MerchantProfileRPC(server);
                //赋值
                merchantProfile = merchantProfileDAC.GetById(id);
            }
            if (merchantProfile != null)
            {
                profileSet.Address1             = merchantProfile.Address1;
                profileSet.Address2             = merchantProfile.Address2;
                profileSet.City                 = merchantProfile.City;
                profileSet.L1VerifyStatus       = merchantProfile.L1VerifyStatus;
                profileSet.L2VerifyStatus       = merchantProfile.L2VerifyStatus;
                profileSet.Postcode             = merchantProfile.Postcode;
                profileSet.Country              = merchantProfile.Country;
                profileSet.BusinessLicenseImage = merchantProfile.BusinessLicenseImage;
                profileSet.LicenseNo            = merchantProfile.LicenseNo;
                profileSet.CompanyName          = merchantProfile.CompanyName;
                profileSet.IdentityDocNo        = merchantProfile.IdentityDocNo;
                profileSet.IdentityDocType      = merchantProfile.IdentityDocType;
                profileSet.FirstName            = merchantProfile.FirstName;
                profileSet.LastName             = merchantProfile.LastName;
                profileSet.BackIdentityImage    = merchantProfile.BackIdentityImage;
                profileSet.FrontIdentityImage   = merchantProfile.FrontIdentityImage;
                profileSet.HandHoldWithCard     = merchantProfile.HandHoldWithCard;
            }

            return(profileSet);
        }