You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using BBWY.Common.Http;
|
|
|
|
using BBWY.Server.Model.Db;
|
|
|
|
using com.alibaba.openapi.client;
|
|
|
|
using com.alibaba.openapi.client.policy;
|
|
|
|
using Jd.Api;
|
|
|
|
using Jd.Api.Request;
|
|
|
|
using Jd.Api.Response;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
namespace BBWY.Test
|
|
|
|
{
|
|
|
|
internal class Program
|
|
|
|
{
|
|
|
|
private static IJdClient GetJdClient(string appKey, string appSecret)
|
|
|
|
{
|
|
|
|
return new DefaultJdClient("https://api.jd.com/routerjson", appKey, appSecret);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
{
|
|
|
|
var appkey = "120EA9EC65AB017567D78CC1139EEEA5";
|
|
|
|
var appSecret = "866a9877f5f24b03b537483b4defe75d";
|
|
|
|
var token = "2ace3023200c4ea9aa682bbf8bffee18jztm";
|
|
|
|
|
|
|
|
var jdClient = GetJdClient(appkey, appSecret);
|
|
|
|
|
|
|
|
PopOrderNotPayOrderByIdRequest req = new PopOrderNotPayOrderByIdRequest();
|
|
|
|
|
|
|
|
req.orderId = "251822408170";
|
|
|
|
|
|
|
|
|
|
|
|
PopOrderNotPayOrderByIdResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime());
|
|
|
|
//logger.Info(response);
|
|
|
|
|
|
|
|
//if (response.IsError)
|
|
|
|
// throw new Exception($"获取未付款订单失败,{(string.IsNullOrEmpty(response.ErrorMsg) ? response.ErrMsg : response.ErrorMsg)}");
|
|
|
|
//if (response.Json == null)
|
|
|
|
// response.Json = JsonConvert.DeserializeObject<JObject>(response.Body);
|
|
|
|
//if (response.Json["jingdong_pop_order_notPayOrderById_response"] == null || response.Json["jingdong_pop_order_notPayOrderById_response"]["orderDataNotPayInfo"] == null)
|
|
|
|
// throw new Exception($"未查询到未付款订单");
|
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(response));
|
|
|
|
Console.ReadKey();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|