Exemplo n.º 1
0
        public IEnumerable <BPiaoBaoTPos.Domain.Models.PosAssignLog> GetPosAssignLogs(string code, string key, string posNo)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "DistributionLog", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("POSNumber", posNo);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <PosAssignLog> list = new List <PosAssignLog>();
            var rows = JArray.FromObject(result.result.rows);

            foreach (var item in rows)
            {
                PosAssignLog poslog = new PosAssignLog()
                {
                    Content     = item.Content,
                    Operater    = item.OperationUser,
                    OperateTime = item.CreateDate
                };
                list.Add(poslog);
            }
            return(list);
        }
Exemplo n.º 2
0
        public CashCompanyInfo AddCompany(string code, string key, CashCompanyInfo cashcpyinfo)
        {
            var ch         = new CashbagHelper(_webUrlBusinesst + "AddCompany", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "CompanyName", cashcpyinfo.CpyName },
                { "ContactUser", cashcpyinfo.Contact },
                { "province", cashcpyinfo.Province },
                { "city", cashcpyinfo.City },
                { "Address", cashcpyinfo.Address },
                { "ClientAccount", cashcpyinfo.ClientAccount },
                { "Moblie", cashcpyinfo.Moblie },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            var cpyinfo = new CashCompanyInfo
            {
                Token      = result.result.Token,
                PayAccount = result.result.PayAccount
            };

            return(cpyinfo);
        }
Exemplo n.º 3
0
        public RepayInfo GetRepayInfo(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrlBusinesst + "CreditAccounts", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            var rinfo = new RepayInfo
            {
                CreditAmount     = result.result.CreditAmount ?? 0,
                AvailableAmount  = result.result.AvailableAmount ?? 0,
                LateAmount       = result.result.LateAmount ?? 0,
                OweRentMoney     = result.result.OweRentMoney ?? 0,
                ShouldRepayMoney = result.result.ShouldRepayMoney ?? 0
            };

            return(rinfo);
        }
Exemplo n.º 4
0
        public IEnumerable <BankInfo> GetBankListInfo(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrlbank + "GetBankList", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            var list = new List <BankInfo>();
            var rows = JArray.FromObject(result.result.rows);

            foreach (var row in rows)
            {
                list.Add(new BankInfo {
                    Code = row.Code, Name = row.Name, ImageUri = row.ImageUri
                });
            }
            return(list);
        }
Exemplo n.º 5
0
        public void AddBusinessman(string code, string key, string OperationUser, BPiaoBaoTPos.Domain.Models.BusinessmanInfo businessmanInfo)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "Create", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("CompanyName", businessmanInfo.BusinessmanName);
            dictionary.Add("Address", businessmanInfo.Address);
            dictionary.Add("ContactUser", businessmanInfo.LinkMan);
            dictionary.Add("Moblie", businessmanInfo.LinkPhone);
            dictionary.Add("Phone", businessmanInfo.LinkTel);
            dictionary.Add("AccountName", businessmanInfo.Bank.Cardholder);
            dictionary.Add("BankCardNumber", businessmanInfo.Bank.CardNo);
            dictionary.Add("BankAddress", businessmanInfo.Bank.Address.Subbranch);
            dictionary.Add("BankName", businessmanInfo.Bank.BankName);
            dictionary.Add("BankProvince", businessmanInfo.Bank.Address.Province);
            dictionary.Add("BankCity", businessmanInfo.Bank.Address.City);
            dictionary.Add("POSRate", businessmanInfo.PosRate.ToString());
            dictionary.Add("OperationUser", OperationUser);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
        }
Exemplo n.º 6
0
        public void AssignPos(string code, string key, string OperationUser, string Id, string[] posNoList)
        {
            string posNo = string.Empty;

            for (int i = 0; i < posNoList.Length; i++)
            {
                posNo += posNoList[i] + ",";
            }
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "Distribution", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("MerchantID", Id);
            dictionary.Add("POSNumbers", posNo.TrimEnd(','));
            dictionary.Add("OperationUser", OperationUser);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
        }
Exemplo n.º 7
0
        public BPiaoBaoTPos.Domain.Models.AccountStat GetAccountStat(string code, string key)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "GetFirstPageInfo", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            var account = new AccountStat()
            {
                BusinessmanCount = result.result.CompanyCount,
                HistoryGain      = result.result.HisAmount,
                PosCount         = result.result.POSCount,
                YesterdayGain    = result.result.YesterdayAmount,
                AssignPosCount   = result.result.AssignPosCount,
                UnAssignPosCount = result.result.UnAssignPosCount
            };

            return(account);
        }
Exemplo n.º 8
0
        public IEnumerable <BPiaoBaoTPos.Domain.Models.TradeStat> GainStat(string code, string key, DateTime startTime, DateTime endTime)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "IncomeStatistics", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("StartDate", startTime.ToString("yyyyMMddHHmmss"));
            dictionary.Add("EndDate", endTime.ToString("yyyyMMddHHmmss"));
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <TradeStat> list = new List <TradeStat>();
            var rows = JArray.FromObject(result.result.rows);

            foreach (var item in rows)
            {
                TradeStat tradestat = new TradeStat()
                {
                    Date       = item.CreateDate,
                    TradeGain  = item.Amount,
                    TradeMoney = item.OrderAmount,
                    TradeTimes = item.Count
                };
                list.Add(tradestat);
            }
            return(list);
        }
Exemplo n.º 9
0
        public Tuple <IEnumerable <BillList>, int> GetBill(string code, string key, DateTime?startTime, DateTime?endTime, string status, int startIndex, int count)
        {
            var ch         = new CashbagHelper(_webUrlBill + "GetBill", "GET");
            var dictionary = new Dictionary <string, string> {
                { "code", code }, { "key", key }
            };

            if (startTime.HasValue)
            {
                dictionary.Add("StartDate", startTime.Value.ToString("yyyyMMddHHmmss"));
            }
            if (endTime.HasValue)
            {
                dictionary.Add("EndDate", endTime.Value.ToString("yyyyMMddHHmmss"));
            }
            if (!string.IsNullOrEmpty(status))
            {
                dictionary.Add("Status", status);
            }
            var page = Math.Ceiling((double)startIndex / count) + 1;

            dictionary.Add("CurrentPage", page.ToString(CultureInfo.InvariantCulture));
            dictionary.Add("PageSize", count.ToString(CultureInfo.InvariantCulture));
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }

            var lst        = new List <BillList>();
            var rows       = JArray.FromObject(result.result.rows);
            int totalcount = result.result.total;

            foreach (var item in rows)
            {
                lst.Add(new BillList
                {
                    Amount            = item.Amount,
                    CreateDate        = item.CreateDate,
                    LateAmount        = item.LateAmount,
                    FeeAmount         = item.FeeAmount,
                    ShouldRepayAmount = item.ShouldRepayAmount,
                    Status            = item.Status,
                    RepayAmount       = item.RepayAmount,
                    BillAmount        = item.BillAmount,
                    ShouldRepayDate   = item.ShouldRepayDate,
                    CreditDayStr      = item.CreditDayStr
                });
            }
            var tuple = new Tuple <IEnumerable <BillList>, int>(lst, totalcount);

            return(tuple);
        }
Exemplo n.º 10
0
        public Tuple <IEnumerable <BPiaoBaoTPos.Domain.Models.TradeDetail>, int> GetTradeDetail(string code, string key, DateTime?startTime, DateTime?endTime, string posNo, int startIndex, int count)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "QueryTrade", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            if (startTime.HasValue)
            {
                dictionary.Add("StartDate", startTime.Value.ToString("yyyyMMddHHmmss"));
            }
            if (endTime.HasValue)
            {
                dictionary.Add("EndDate", endTime.Value.ToString("yyyyMMddHHmmss"));
            }
            dictionary.Add("POSNumber", posNo);
            var page = Math.Ceiling((double)startIndex / count) + 1;

            dictionary.Add("CurrentPage", page.ToString());
            dictionary.Add("PageSize", count.ToString());
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <TradeDetail> list = new List <TradeDetail>();
            var rows       = JArray.FromObject(result.result.rows);
            int totalcount = result.result.total;

            foreach (var item in rows)
            {
                TradeDetail tradedetail = new TradeDetail()
                {
                    BatchNo         = item.OutOrderNo,
                    BusinessmanName = item.CompanyFullName,
                    ReceivMoney     = item.Amount,
                    PosGain         = item.POSAmount,
                    PosNo           = item.POSNumber,
                    PosRate         = item.Rate,
                    TradeCardNo     = item.CardNo,
                    TradeCardType   = item.CardType,
                    TradeMoney      = item.OrderAmount,
                    TradeTime       = item.CreateDate
                };
                list.Add(tradedetail);
            }
            Tuple <IEnumerable <TradeDetail>, int> tuple = new Tuple <IEnumerable <TradeDetail>, int>(list, totalcount);

            return(tuple);
        }
Exemplo n.º 11
0
        public void GrantApply(string code, string key, string ca, string ra, string wa, string ha, string ba, string ma, string ea, string ia)
        {
            var ch         = new CashbagHelper(_webUrl + "GrantApply", "POST");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };

            if (!string.IsNullOrEmpty(ca))
            {
                dictionary.Add("ca", ca);
            }
            if (!string.IsNullOrEmpty(ra))
            {
                dictionary.Add("ra", ra);
            }
            if (!string.IsNullOrEmpty(wa))
            {
                dictionary.Add("wa", wa);
            }
            if (!string.IsNullOrEmpty(ha))
            {
                dictionary.Add("ha", ha);
            }
            if (!string.IsNullOrEmpty(ba))
            {
                dictionary.Add("ba", ba);
            }
            if (!string.IsNullOrEmpty(ma))
            {
                dictionary.Add("ma", ma);
            }
            if (!string.IsNullOrEmpty(ea))
            {
                dictionary.Add("ea", ea);
            }
            if (!string.IsNullOrEmpty(ia))
            {
                dictionary.Add("ia", ia);
            }
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 12
0
        public BPiaoBaoTPos.Domain.Models.BusinessmanReport GetBusinessmanReport(string code, string key, DateTime startTime, DateTime endTime)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "AgentTradeSummary", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("StartDate", startTime.ToString("yyyyMMddHHmmss"));
            dictionary.Add("EndDate", endTime.ToString("yyyyMMddHHmmss"));
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <BusinessmanTrade> listtrade = new List <BusinessmanTrade>();

            var rows = JArray.FromObject(result.result.rows);

            foreach (var item in rows)
            {
                BusinessmanTrade btrade = new BusinessmanTrade()
                {
                    BusinessmanName = item.CompanyName
                };
                List <TradeStat> listtradestat = new List <TradeStat>();
                foreach (var TradeSet in item.TradeStat)
                {
                    listtradestat.Add(new TradeStat()
                    {
                        Date       = TradeSet.Date,
                        TradeGain  = TradeSet.SplitAmount,
                        TradeMoney = TradeSet.TradeMoney,
                        TradeTimes = TradeSet.TradeTimes
                    });
                }
                btrade.BusinessmanTradeStat = listtradestat;
                listtrade.Add(btrade);
            }

            var report = new BusinessmanReport()
            {
                TradeList = listtrade
            };

            return(report);
        }
Exemplo n.º 13
0
        public Tuple <IEnumerable <BPiaoBaoTPos.Domain.Models.BusinessmanInfo>, int> GetPosBusinessman(string code, string key, string businessmanName, string posNo, int startIndex, int count)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "GetTPOSCompanyList", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("POSNumber", posNo);
            dictionary.Add("CompanyName", businessmanName);
            var page = Math.Ceiling((double)startIndex / count) + 1;

            dictionary.Add("CurrentPage", page.ToString());
            dictionary.Add("PageSize", count.ToString());
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <BusinessmanInfo> list = new List <BusinessmanInfo>();
            var rows       = JArray.FromObject(result.result.rows);
            int totalcount = result.result.total;

            foreach (var item in rows)
            {
                BusinessmanInfo businessinfo = new BusinessmanInfo()
                {
                    Id = item.CompanyID,
                    BusinessmanName = item.CompanyName,
                    TotalPosCount   = item.Count,
                    PosRate         = item.POSRate,
                    Bank            = new BusinessmanInfo.BankInfo()
                    {
                        BankName = item.BankName,
                        CardNo   = item.BankCardNumber
                    },
                    CreateTime = item.SignDate
                };
                list.Add(businessinfo);
            }
            Tuple <IEnumerable <BusinessmanInfo>, int> tuple = new Tuple <IEnumerable <BusinessmanInfo>, int>(list, totalcount);

            return(tuple);
        }
Exemplo n.º 14
0
        public Tuple <IEnumerable <BPiaoBaoTPos.Domain.Models.PosInfo>, int> GetPosList(string code, string key, string posNo, string businessmanName, bool?isAssign, int startIndex, int count)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "QueryPOS", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("CompanyName", businessmanName);
            if (isAssign.HasValue)
            {
                dictionary.Add("Status", isAssign.Value == true ? "1" : "0");
            }
            dictionary.Add("POSNumber", posNo);
            var page = Math.Ceiling((double)startIndex / count) + 1;

            dictionary.Add("CurrentPage", page.ToString());
            dictionary.Add("PageSize", count.ToString());
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            List <PosInfo> list       = new List <PosInfo>();
            var            rows       = JArray.FromObject(result.result.rows);
            int            totalcount = result.result.total;

            foreach (var item in rows)
            {
                PosInfo posinfo = new PosInfo()
                {
                    BusinessmanName = item.PosCompany,
                    PosNo           = item.PosNumber,
                    PosRate         = item.posRate,
                    Status          = item.Status == 1 ? true : false,
                    StatusStr       = item.StatusStr,
                    CompanyID       = item.CompanyID
                };
                list.Add(posinfo);
            }
            Tuple <IEnumerable <PosInfo>, int> tuple = new Tuple <IEnumerable <PosInfo>, int>(list, totalcount);

            return(tuple);
        }
Exemplo n.º 15
0
        public void DeleteCashBagBusinessman(string code, string payAccount, string key)
        {
            var ch         = new CashbagHelper(_webUrlBusinesst + "Remove", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "payAccount", payAccount },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 16
0
        public void DeleteBusinessman(string code, string key, string OperationUser, string Id)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "Remove", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("CompanyID", Id);
            dictionary.Add("OperationUser", OperationUser);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
        }
Exemplo n.º 17
0
        public string AlipayUnBind(string code, string key, string payPwd)
        {
            var ch         = new CashbagHelper(_webUrl + "AlipayUnBind", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "paypwd", payPwd }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            return(result.status);
        }
Exemplo n.º 18
0
        public string GetAliPaySign(string code, string key, string alipayAccount)
        {
            var ch         = new CashbagHelper(_webUrl + "GetAliPaySign", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "email", alipayAccount }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            return(result.result);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 获取可用临时额度
        /// </summary>
        /// <param name="code"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public decimal GetTempCreditAmount(string code, string key)
        {
            var ch         = new CashbagHelper(webURLAccount + "GetTempCreditAmount", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            return(result.result);
        }
Exemplo n.º 20
0
        public void AlipaySignRepay(string code, string key, decimal money, string payPwd)
        {
            var ch         = new CashbagHelper(webURLfunds + "AlipaySignRepay", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "money", money.ToString(CultureInfo.InvariantCulture) },
                { "pwd", payPwd }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 21
0
        public void ExchangeSource(string code, string key, decimal source)
        {
            var ch         = new CashbagHelper(_webUrlAccount + "HandMovePointToRecieve", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "source", source.ToString(CultureInfo.InvariantCulture) },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 22
0
        public void RemoveBank(string code, string key, string bankId)
        {
            var ch         = new CashbagHelper(_webUrlbank + "RemoveAccount", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "AccountID", bankId },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 23
0
        public BusinessmanInfo GetBusinessmanInfo(string code, string key, string Id)
        {
            CashbagHelper ch = new CashbagHelper(WebUrlTPos + "QueryMerchant", "GET");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("MerchantID", Id);
            dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CustomException(500, result.message.ToString());
            }
            var businessinfo = new BusinessmanInfo()
            {
                Id              = result.result.CompanyID,
                Address         = result.result.Address,
                LinkMan         = result.result.ContactUser,
                LinkPhone       = result.result.Moblie,
                LinkTel         = result.result.Phone,
                PosRate         = result.result.POSRate,
                BusinessmanName = result.result.CompanyName,
                CreateTime      = result.result.CreateDate,
                Bank            = new BusinessmanInfo.BankInfo()
                {
                    Address = new BusinessmanInfo.BankAddress()
                    {
                        Province  = result.result.BankProvince,
                        City      = result.result.BankCity,
                        Subbranch = result.result.BankAddress
                    },
                    BankName   = result.result.BankName,
                    Cardholder = result.result.AccountName,
                    CardNo     = result.result.BankCardNumber,
                    BankId     = result.result.AccountID
                },
                TotalPosCount = result.result.POSCount
            };

            return(businessinfo);
        }
Exemplo n.º 24
0
        public void SetPayPassword(string code, string key, string newpwd, string smsPwd)
        {
            var ch         = new CashbagHelper(_webUrl + "SetPayPassword", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "NewPwd", newpwd },
                { "SmsPwd", smsPwd },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 申请临时额度
        /// </summary>
        /// <param name="code"></param>
        /// <param name="key"></param>
        /// <param name="tempAmount"></param>
        /// <param name="pwd"></param>
        public void TempCreditApplication(string code, string key, string pwd, decimal tempAmount)
        {
            var ch         = new CashbagHelper(webURLAccount + "TempCreditApplication", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "pwd", pwd },
                { "tempAmount", tempAmount.ToString(CultureInfo.InvariantCulture) },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }
Exemplo n.º 26
0
        public CashCompanyInfo GetCompanyInfo(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrlBusinesst + "GetCompanyInfo", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data    = ch.ParamsURLEncode(dictionary);
            var result  = ch.GetBackJsonData(data);
            var cpyinfo = new CashCompanyInfo
            {
                CpyName = result.result.CompanyName,
                Contact = result.result.ContactUser
            };

            return(cpyinfo);
        }
Exemplo n.º 27
0
        public string GetValidateCode(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrl + "GetValidateCodeAccount", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") },
                { "account", SettingSection.GetInstances().Sms.smsLKAccount },
                { "password", SettingSection.GetInstances().Sms.smsLKPwd }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            return(result.result);
        }
Exemplo n.º 28
0
        public GrantInfo GetGrantInfo(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrl + "QueryGrantApply", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }

            var grant = new GrantInfo();

            if (result.result != null)
            {
                grant.GrantArray = new List <GrantArray>();
                var rows = JArray.FromObject(result.result);
                foreach (var item in rows)
                {
                    if (item.Key.ToString() == "")
                    {
                        continue;
                    }
                    var grantarray = new GrantArray
                    {
                        Key      = item.Key,
                        ImageUrl = item.ImageUrl
                    };
                    grant.GrantArray.Add(grantarray);
                }
            }
            grant.Applystatus = result.code;
            grant.message     = result.message;
            return(grant);
        }
Exemplo n.º 29
0
        public Tuple <string, string> GetBindAccount(string code, string key)
        {
            var ch         = new CashbagHelper(_webUrl + "GetBind", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key }
            };
            var data   = ch.ParamsURLEncode(dictionary);
            var result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
            //return new Tuple<string, string>(result.result.alipayEmail, result.result.tenpayEmail);
            string alipayEmail = result.result.alipayEmail;
            string tenpayEmail = result.result.tenpayEmail;

            return(Tuple.Create(alipayEmail, tenpayEmail));
        }
Exemplo n.º 30
0
        public void ModifyBank(string code, string key, BankCard bank)
        {
            var ch         = new CashbagHelper(_webUrlbank + "ModifyAccount", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "accountId", bank.BankId },
                { "BankCardNumber", bank.CardNo },
                { "Address", bank.BankBranch },
                { "BankName", bank.Name },
                { "Province", bank.Province },
                { "City", bank.City },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") }
            };
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagException(result.message.ToString());
            }
        }