Exemplo n.º 1
0
        public FinancialProduct GetSingleProductInfo(string code, string key, string productID)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLProduct + "GetSingleProductInfo", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("productID", productID);
            dictionary.Add("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());
            }
            result = result.result;
            var fp = new FinancialProduct()
            {
                ProductId          = result.FinancingProductID,
                Name               = result.ProductName,
                Description        = result.Content,
                IconUrl            = result.ImageUrl,
                ReturnRate         = result.ReturnRate,
                Day                = result.Day,
                LimitAmount        = result.LimitAmount,
                EndDate            = result.EndDate,
                ValidDate          = result.ValidDate,
                InterestRate       = result.InterestRate,
                CreateDate         = result.CreateDate,
                CanSettleInAdvance = result.CanSettleInAdvance
            };

            return(fp);
        }
Exemplo n.º 2
0
        public string PaymentByQuikAliPay(string code, string key, string orderID, string productName, decimal money, string Platform, string notifyUrl, string remark, string paypassword, string BusDesc, string notes)
        {
            //string rs = "";
            var ch         = new CashbagHelper(webURLfunds + "AlipaySignPay", "GET");
            var dictionary = new Dictionary <string, string>
            {
                { "code", code },
                { "key", key },
                { "orderNo", orderID },
                { "ProductName", productName },
                { "money", money.ToString() },
                { "NotifyUrl", notifyUrl },
                { "remark", remark },
                { "pwd", paypassword },
                { "payType", Platform },
                { "BusDesc", BusDesc },
                { "currentTime", DateTime.Now.ToString("yyyyMMddHHmmss") },
                { "Notes", notes }
            };
            string data   = ch.ParamsURLEncode(dictionary);
            var    result = ch.GetBackJsonData(data);

            if (result.status == false)
            {
                throw new CashBagPayException(result.message.ToString());
            }
            //return result.result;
            var payvalue = result.result;
            var ispay    = (bool)payvalue.PayStatus;

            return(!ispay ? payvalue.value : payvalue.PayStatus.ToString());
        }
Exemplo n.º 3
0
        public ExpectProfit GetExpectProfit(string code, string key, string tradeID)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLProduct + "GetExpectProfit", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("tradeID", tradeID);

            dictionary.Add("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());
            }

            var ep = new ExpectProfit()
            {
                Profit       = result.result.profit == null ? "0" : result.result.profit,
                NormalProfit = result.result.normalProfit == null ? "0" : result.result.normalProfit
            };

            return(ep);
        }
Exemplo n.º 4
0
        public FeeRuleInfo GetFeeRule(string code, string key)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLWithdraw + "GetFeeRule", "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 CashBagException(result.message.ToString());
            }
            var FeeRuleInfo = new FeeRuleInfo()
            {
                //todayFee = result.result.todayFee,
                //todayMax = result.result.todayMax,
                //todayMin = result.result.todayMin,
                //tomorrowFee = result.result.tomorrowFee,
                //tomorrowMax = result.result.tomorrowMax,
                //tomorrowMin = result.result.tomorrowMin
                IsHoliday              = result.result.IsHoliday,
                Id                     = result.result.withdraw.Id,
                Name                   = result.result.withdraw.Name,
                CustomerType           = result.result.withdraw.CustomerType,
                IsDefault              = result.result.withdraw.IsDefault,
                TodayEnable            = result.result.withdraw.TodayEnable,
                TodayLast              = result.result.withdraw.TodayLast,
                TodayWithdrawRateType  = result.result.withdraw.TodayWithdrawRateType,
                TodayEachFeeAmount     = result.result.withdraw.TodayEachFeeAmount,
                TodayEachRate          = result.result.withdraw.TodayEachRate,
                TodayEachFeeAmountMin  = result.result.withdraw.TodayEachFeeAmountMin,
                TodayEachFeeAmountMax  = result.result.withdraw.TodayEachFeeAmountMax,
                TodayDayAmount         = result.result.withdraw.TodayDayAmount,
                TodayEachAmount        = result.result.withdraw.TodayEachAmount,
                MorrowEnable           = result.result.withdraw.MorrowEnable,
                MorrowLast             = result.result.withdraw.MorrowLast,
                MorrowWithdrawRateType = result.result.withdraw.MorrowWithdrawRateType,
                MorrowEachFeeAmount    = result.result.withdraw.MorrowEachFeeAmount,
                MorrowEachRate         = result.result.withdraw.MorrowEachRate,
                MorrowEachFeeAmountMin = result.result.withdraw.MorrowEachFeeAmountMin,
                MorrowEachFeeAmountMax = result.result.withdraw.MorrowEachFeeAmountMax,
                MorrowDayAmount        = result.result.withdraw.MorrowDayAmount,
                MorrowEachAmount       = result.result.withdraw.MorrowEachAmount
            };

            return(FeeRuleInfo);
        }
Exemplo n.º 5
0
        public string GetApplicationMaxAmount(string code, string key, string Type)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLWithdraw + "GetMaxAmount", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("Type", Type);
            dictionary.Add("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());
            }
            return(result.result);
        }
Exemplo n.º 6
0
        public void BuyFinancialProductByCashAccount(string code, string key, string productID, decimal money, string pwd)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLfunds + "BuyProductByCash", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("Pwd", pwd);
            dictionary.Add("productID", productID);
            dictionary.Add("Money", money.ToString());
            dictionary.Add("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());
            }
        }
Exemplo n.º 7
0
        public IEnumerable <FinancialProduct> GetActiveProduct(string code, string key, string quantity)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLProduct + "GetActiveProduct", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("quantity", quantity);
            dictionary.Add("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());
            }
            List <FinancialProduct> lists = new List <FinancialProduct>();
            var rows = JArray.FromObject(result.result);

            foreach (var item in rows)
            {
                FinancialProduct fp = new FinancialProduct()
                {
                    ProductId          = item.FinancingProductID,
                    Name               = item.ProductName,
                    Description        = item.Content,
                    IconUrl            = item.ImageUrl,
                    Abstract           = "",
                    ReturnRate         = item.ReturnRate,
                    Day                = item.Day,
                    LimitAmount        = item.LimitAmount ?? 0,
                    MaxAmount          = item.MaxAmount,
                    CurrentAmount      = item.CurrentAmount,
                    EndDate            = item.EndDate,
                    ValidDate          = item.ValidDate,
                    InterestRate       = item.InterestRate,
                    CreateDate         = item.CreateDate,
                    CanSettleInAdvance = item.CanSettleInAdvance
                };
                lists.Add(fp);
            }
            return(lists);
        }
Exemplo n.º 8
0
        public void AbortFinancial(string code, string key, string tradeID, string pwd)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLProduct + "EarlyTermination", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("tradeID", tradeID);
            dictionary.Add("pwd", pwd);

            dictionary.Add("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());
            }
        }
Exemplo n.º 9
0
        public string RechargeByPlatform(string code, string key, decimal money, string payPlatform)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLfunds + "Recharge", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("money", money.ToString());
            dictionary.Add("payType", payPlatform);
            dictionary.Add("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());
            }

            return(result.result);
        }
Exemplo n.º 10
0
        public string OnLineRecieveByBank(string code, string key, decimal money, string NotifyUrl, string payBank)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLWithdraw + "OnLineRecieve", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("money", money.ToString());
            dictionary.Add("bankName", payBank);
            dictionary.Add("NotifyUrl", NotifyUrl);
            dictionary.Add("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());
            }
            return(result.result);
        }
Exemplo n.º 11
0
        public void CashOut(string code, string key, decimal money, string AccountID, string pwd, string Type)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLWithdraw + "ManualCreate", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("Amount", money.ToString());
            dictionary.Add("AccountID", AccountID);
            dictionary.Add("pwd", pwd);
            dictionary.Add("Type", Type);
            dictionary.Add("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());
            }
        }
Exemplo n.º 12
0
        public void InnerTransfer(string code, string key, string targetcode, string money, string pwd, string notes)
        {
            BPiaoBao.Common.CashbagHelper ch         = new BPiaoBao.Common.CashbagHelper(webURLfunds + "InnerTransfer", "GET");
            Dictionary <string, string>   dictionary = new Dictionary <string, string>();

            dictionary.Add("code", code);
            dictionary.Add("key", key);
            dictionary.Add("pwd", pwd);
            dictionary.Add("targetCode", targetcode);
            dictionary.Add("money", money.ToString());
            dictionary.Add("notes", notes);
            dictionary.Add("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());
            }
        }