Ejemplo n.º 1
0
        public bool AddMerchant(MerchantProfile profile)
        {
            var server = ProfileFactory.GetByCountryId(profile.Country);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                return(dac.Insert(profile));
            }
        }
Ejemplo n.º 2
0
        public int GetCountByIdentityDocNo(Guid merchantId, string IdentityDocNo)
        {
            MerchantAccountDAC accountDAC = new MerchantAccountDAC();
            var account = accountDAC.GetById(merchantId);

            var server = ProfileFactory.GetByCountryId(account.CountryId);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC merchantProfileDAC = new MerchantProfileRPC(server);

                return(merchantProfileDAC.GetCountByIdentityDocNo(IdentityDocNo));
            }
        }
Ejemplo n.º 3
0
        public bool RemoveMerchantById(MerchantProfile profile)
        {
            if (profile.Country == 0)
            {
                throw new Exception("必须设置Profile的国家字段");
            }
            var server = ProfileFactory.GetByCountryId(profile.Country);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                return(dac.Delete(profile));
            }
        }
Ejemplo n.º 4
0
        public bool ModifyIdentity(MerchantProfile profile)
        {
            MerchantAccountDAC accountDAC = new MerchantAccountDAC();
            var account = accountDAC.GetById(profile.MerchantId);

            if (account == null)
            {
                return(false);
            }
            var server = ProfileFactory.GetByCountryId(account.CountryId);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                return(dac.ModifyIdentity(profile));
            }
        }
Ejemplo n.º 5
0
 public bool UpdateCellphone(MerchantProfile profile)
 {
     try
     {
         var server = ProfileFactory.GetByCountryId(profile.Country);
         if (server == null)
         {
             throw new InvalidProfileServiceException();
         }
         else
         {
             MerchantProfileRPC merchantProfileDAC = new MerchantProfileRPC(server);
             //赋值
             return(merchantProfileDAC.UpdateCellphone(profile));
         }
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 商家Web版修改认证信息
        /// </summary>
        /// <param name="merchantId"></param>
        /// <param name="companyName"></param>
        /// <param name="licenseNo"></param>
        /// <param name="businessLicense"></param>
        /// <returns></returns>
        public bool UpdateMerchantLicense(Guid merchantId, string companyName, string licenseNo, Guid businessLicense)
        {
            MerchantAccountDAC accountDAC = new MerchantAccountDAC();
            var account = accountDAC.GetById(merchantId);

            if (account == null)
            {
                return(false);
            }
            var server = ProfileFactory.GetByCountryId(account.CountryId);

            if (server == null)
            {
                MerchantProfileDAC dac = new MerchantProfileDAC();
                return(dac.UpdateMerchantLicense(merchantId, companyName, licenseNo, businessLicense));
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                return(dac.UpdateMerchantLicense(merchantId, companyName, licenseNo, businessLicense));
            }
        }
Ejemplo n.º 7
0
        public List <MerchantVerifyStatusOM> GetVerifyStatusListByIds(int countryId, List <Guid> ids)
        {
            List <MerchantVerifyStatusOM> result    = null;
            List <MerchantProfile>        merchants = null;
            var server = ProfileFactory.GetByCountryId(countryId);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                merchants = dac.GetListByIds(ids);
            }
            result = merchants.Select(p => new MerchantVerifyStatusOM
            {
                MerchantId = p.MerchantId,
                Status     = p.L2VerifyStatus
            }).ToList();
            return(result);
        }
Ejemplo n.º 8
0
        public bool UpdateL2VerifyStatus(Guid id, VerifyStatus verifyStatus, string remark)
        {
            bool result = false;
            MerchantAccountDAC merchantAccountDAC = new MerchantAccountDAC();
            var merchantAccount = merchantAccountDAC.GetById(id);

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

            if (router == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(router);
                result = dac.UpdateL2VerifyStatus(id, verifyStatus, remark);
            }
            return(result);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
        public List <MerchantProfile> GetMerchantVerifyListForL1(string cellphone, int countryId, int?status, string orderByFiled, bool isDesc, int pageSize, int index, out int totalCount)
        {
            if (string.IsNullOrEmpty(orderByFiled))
            {
                throw new Exception("orderByFiled 不能为空");
            }
            List <MerchantProfile> result = null;

            totalCount = 0;
            var server = ProfileFactory.GetByCountryId(countryId);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }
            else
            {
                MerchantProfileRPC dac = new MerchantProfileRPC(server);
                result = dac.GetMerchantVerifyListL1(cellphone, countryId, status, orderByFiled, isDesc, pageSize, index, out totalCount);
            }

            return(result);
        }
Ejemplo n.º 11
0
        public bool UpdateAddress(Guid merchantId, Address address)
        {
            try
            {
                MerchantAccountDAC accountDAC = new MerchantAccountDAC();
                var account = accountDAC.GetById(merchantId);

                var server = ProfileFactory.GetByCountryId(account.CountryId);
                if (server == null)
                {
                    throw new InvalidProfileServiceException();
                }
                else
                {
                    MerchantProfileRPC merchantProfileDAC = new MerchantProfileRPC(server);
                    //赋值
                    return(merchantProfileDAC.UpdateAddress(address));
                }
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 12
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);
        }