Ejemplo n.º 1
0
        /// <summary>
        /// 获得退款笔数,配合BCRefundQueryByCondition使用,使用查询退款时一样的参数
        /// </summary>
        /// <param name="para"></param>
        /// <returns></returns>
        public static int BCRefundQueryCount(BCQueryRefundParameter para)
        {
            string payQueryUrl = BCPrivateUtil.getHost() + BCConstants.version + BCConstants.refundsCountURL;

            string paraString = prepareRefundQueryByConditionParameters(para);

            try
            {
                string url = payQueryUrl + "?para=" + HttpUtility.UrlEncode(paraString, Encoding.UTF8);
                HttpWebResponse response = BCPrivateUtil.CreateGetHttpResponse(url, BCCache.Instance.networkTimeout);
                string respString = BCPrivateUtil.GetResponseString(response);
                return handleQueryCountResult(respString);
            }
            catch (Exception e)
            {
                var ex = new BCException(e.Message);
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public void prepareRefundQueryByConditionParametersTest()
        {
            BeeCloud.registerApp("c5d1cba1-5e3f-4ba0-941d-9b0a371fe719", "39a7a518-9ac8-4a9e-87bc-7885f33cf18c", "e14ae2db-608c-4f8b-b863-c8c18953eef2", null);

            BCQueryRefundParameter para = new BCQueryRefundParameter();
            para.channel = "ALI";
            para.limit = 2;
            para.needDetail = true;
            para.skip = 10;
            para.startTime = 1000000000000;
            para.endTime = 1100000000000;

            string paraString = "\"channel\":\"ALI\",\"bill_no\":null,\"refund_no\":null,\"start_time\":1000000000000,\"end_time\":1100000000000,\"need_approval\":null,\"need_detail\":true,\"skip\":10,\"limit\":2}";
            string actual = BCPay.prepareRefundQueryByConditionParameters(para);
            Assert.IsTrue(actual.Contains(paraString));
        }
Ejemplo n.º 3
0
        //准备退款查询参数
        public static string prepareRefundQueryByConditionParameters(BCQueryRefundParameter para)
        {
            long timestamp = BCUtil.GetTimeStamp(DateTime.Now);

            JsonData data = new JsonData();
            data["app_id"] = BCCache.Instance.appId;
            data["app_sign"] = BCPrivateUtil.getAppSignature(BCCache.Instance.appId, BCCache.Instance.appSecret, timestamp.ToString());
            data["timestamp"] = timestamp;
            data["channel"] = para.channel;
            data["bill_no"] = para.billNo;
            data["refund_no"] = para.refundNo;
            data["start_time"] = para.startTime;
            data["end_time"] = para.endTime;
            data["need_approval"] = para.needApproval;
            data["need_detail"] = para.needDetail;
            data["skip"] = para.skip;
            data["limit"] = para.limit;

            string paraString = data.ToJson();
            return paraString;
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request.Form["querytype"];

            if (type == "alirefundquery")
            {
                typeChannel = "Ali";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "Ali" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "ALI";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            if (type == "wxrefundquery")
            {
                typeChannel = "WX";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "WX" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "WX";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            if (type == "unionrefundquery")
            {
                typeChannel = "UN";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "UN" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "UN";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            if (type == "jdrefundquery")
            {
                typeChannel = "JD";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "JD" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "JD";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            if (type == "ybrefundquery")
            {
                typeChannel = "YEE";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "YEE" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "YEE";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            if (type == "kqrefundquery")
            {
                typeChannel = "KUAIQIAN";
                Response.Write("<span style='color:#00CD00;font-size:20px'>" + "KUAIQIAN" + "</span><br/>");
                BCQueryRefundParameter para = new BCQueryRefundParameter();
                para.channel = "KUAIQIAN";
                para.limit = 50;
                try
                {
                    refunds = BCPay.BCRefundQueryByCondition(para);
                }
                catch (Exception excption)
                {
                    Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
                }
            }
            this.bind();
        }