微信改动,大家一起改,来吧
private string GetAccessToken(string openid){string AppID = "";string AppSecret = "";string url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+AppID+"&secret="+AppSecret;string accesstoken = "";if(String.IsNullOrEmpty(accesstoken)){string rtn = HttpHelper.HttpGet(url);JObject obj = JObject.Parse(rtn);accesstoken = obj["access_token"].ToString();}return accesstoken;}
其中用到的HttpGet,这个网上一大堆,自己区找
然后
public string NotifyWChatLittlePay_SendGood(string goodtitle,string openid,string transaction_id){string access = GetAccessToken(openid);string url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" + access;string strDatason = "{";strDatason += "\"order_key\":{\"order_number_type\":2,,\"transaction_id\":\"" + transaction_id + "\"},";strDatason += "\"logistics_type\":4,\"delivery_mode\":1,";strDatason += "\"shipping_list\":[{\"item_desc\":\"" + goodtitle + "\"}],\"upload_time\":\"" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffK") + "\",";strDatason += "\"payer\":{\"openid\":\"" + openid + "\"}";strDatason += "}";return HttpHelper.HttpPost(url, strDatason);}
测试,已经返回ok了