Пример #1
0
        public void TestService()
        {
            CreateOrderParameters para = new CreateOrderParameters()
            {
                AppOrderAmount = 1,
                AppOrderDesc   = "测试",
                AppOrderID     = sss,
                AppOrderTime   = DateTime.Now.ToJITFormatString(),
                PayChannelID   = 16,
                MobileNO       = "18019438327"
            };
            TradeRequest request = new TradeRequest()
            {
                AppID      = 1,
                ClientID   = "27",
                Parameters = para,
                UserID     = "1111"
            };
            string parameter = string.Format("action=CreateOrder&request={1}", Url, request.ToJSON());
            //parameter = "action=CreateOrder&request={\"AppID\":1,\"ClientID\":\"e703dbedadd943abacf864531decdac1\",\"UserID\":\"00193aeff94341a1a8f64e224c7c249c\",\"Token\":null,\"Parameters\":{\"PayChannelID\":3,\"AppOrderID\":\"61ebfd4cbb1b4716b40605845cc761cd\",\"AppOrderTime\":\"2014-01-17 09:46:30 562\",\"AppOrderAmount\":1,\"AppOrderDesc\":\"jitmarketing\",\"Currency\":1,\"MobileNO\":\"\",\"ReturnUrl\":\"http://www.o2omarketing.cn:9004/HtmlApp/LJ/html/pay_success.html?orderId=61ebfd4cbb1b4716b40605845cc761cd\",\"DynamicID\":null,\"DynamicIDType\":null}}";
            var data = Encoding.GetEncoding("utf-8").GetBytes(parameter);
            var res  = GetResponseStr(Url, data).DeserializeJSONTo <TradeResponse>();

            Console.WriteLine(res.ToJSON());
        }
Пример #2
0
        public void TestQueryOrderBySourceID()
        {
            QueryOrderByAppInfoParameters para = new QueryOrderByAppInfoParameters()
            {
                AppOrderID = "f7410ab4bf4e40979f04dc76808c15ac"
            };
            TradeRequest request = new TradeRequest()
            {
                AppID      = 1,
                ClientID   = "e703dbedadd943abacf864531decdac1",
                Parameters = para,
                UserID     = "1111"
            };
            string parameter = string.Format("action=IsOrderPaid&request={1}", Url, request.ToJSON());
            var    data      = Encoding.GetEncoding("utf-8").GetBytes(parameter);
            var    res       = GetResponseStr(Url, data);

            Console.WriteLine(res.ToJSON());
        }
Пример #3
0
        public void TestQueryOrder()
        {
            QueryOrderParameters para = new QueryOrderParameters()
            {
                OrderID = 1
            };
            TradeRequest request = new TradeRequest()
            {
                AppID      = 1,
                ClientID   = "27",
                Parameters = para,
                UserID     = "1111"
            };
            string parameter = string.Format("action=QueryOrder&request={1}", Url, request.ToJSON());
            var    data      = Encoding.GetEncoding("utf-8").GetBytes(parameter);
            var    res       = GetResponseStr(Url, data);

            Console.WriteLine(res.ToJSON());
        }