步步为盈
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.

63 lines
2.6 KiB

2 years ago
using Jd.ACES;
using Jd.Api;
using Jd.Api.Request;
using Newtonsoft.Json;
3 years ago
using Newtonsoft.Json.Linq;
using System;
3 years ago
using System.Collections.Generic;
using System.Linq;
3 years ago
namespace BBWY.Test
{
internal class Program
{
3 years ago
private static IJdClient GetJdClient(string appKey, string appSecret)
{
return new DefaultJdClient("https://api.jd.com/routerjson", appKey, appSecret);
}
static void Main(string[] args)
{
2 years ago
//var appkey = "E1AA9247D5583A6D87449CE6AB290185";
// var appSecret = "e479558ddd9e40f8929cfc00c6cbbc9c";
3 years ago
////0e61c4a8ec3e4df4b5836e10884db9220yth 齐盛
////2ace3023200c4ea9aa682bbf8bffee18jztm 布莱特玩具
2 years ago
// var token = "01dc6f6e7fc34dcd99090d690312556cmdfk"; //齐盛
3 years ago
2 years ago
var appkey = "120EA9EC65AB017567D78CC1139EEEA5";
var appSecret = "8a42bc2301e8439b896e99f5475e0a9b";
var token = "2ace3023200c4ea9aa682bbf8bffee18jztm";
3 years ago
//var path = @"C:\Users\pengcong001\Desktop\含赠品SKU.txt";
//var j = JToken.Parse(System.IO.File.ReadAllText(path, System.Text.Encoding.UTF8));
//var firstJ = j["Json"]["jingdong_sku_read_searchSkuList_responce"]["page"]["data"].Children().FirstOrDefault();
//var saleAtters = firstJ.Value<JArray>("saleAttrs").Select(s => new
//{
// attrId = s.Value<string>("attrId"),
// attrValues = s.Value<JArray>("attrValues").Select(x => x.ToString()).ToList()
//}).ToList();
3 years ago
IJdClient client = GetJdClient(appkey, appSecret);
3 years ago
2 years ago
{
var req = new PopOrderEnGetRequest();
req.optionalFields = "orderId,venderId,orderType,payType,orderTotalPrice,orderSellerPrice,orderPayment,freightPrice,orderState,orderStateRemark,orderRemark,orderStartTime,orderEndTime,modified,consigneeInfo,itemInfoList,couponDetailList,taxFee,venderRemark,waybill,storeOrder,storeId,sellerDiscount,pin,realPin,open_id,open_id_buyer";
req.orderId = "259240708456";
var res = client.Execute(req, token, DateTime.Now.ToLocalTime());
Console.WriteLine(JsonConvert.SerializeObject(res));
var jobject = JObject.Parse(res.Body);
var pin = jobject["jingdong_pop_order_enGet_responce"]["orderDetailInfo"]["orderInfo"]["pin"].ToString();
var tdeClient = new TDEClient("https://api.jd.com/routerjson", appkey, appSecret, token);
var jiemiPin = tdeClient.DecryptString(pin);
Console.WriteLine(jiemiPin);
}
Console.ReadKey();
}
}
}