/// <summary>
/// 获取审核结果
/// </summary>
/// <param name="business_code">业务申请编号</param>
/// <param name="applyment_id">微信返回的申请编号</param>
/// <returns></returns>
public static string Getstate(string business_code,string applyment_id)
{
WxPayDataToXiaoWei inputObj = new WxPayDataToXiaoWei();
inputObj.SetValue("version", "1.0");//接口版本号
inputObj.SetValue("mch_id", weixinConfig.MchID);//商户号
inputObj.SetValue("nonce_str", Guid.NewGuid().ToString().Replace("-", ""));//随机字符串
inputObj.SetValue("business_code", business_code);//
inputObj.SetValue("applyment_id", applyment_id);//
inputObj.SetValue("sign_type", "HMAC-SHA256");//签名类型
inputObj.SetValue("sign", inputObj.MakeSign(weixinConfig.Key));//签名
string xml = inputObj.ToXml();
string url = "https://api.mch.weixin.qq.com/applyment/micro/getstate";
int timeOut = 10;
LogHelper.Error("Getstate:"+inputObj.GetValue("sign").ToString());
string response = WeixinXiaoweiService.Post(xml, url, true,true, timeOut);//调用HTTP通信接口以提交数据到API
inputObj = new WxPayDataToXiaoWei();
inputObj.FromXml(response);
var model = ConfigDbTable.DbWeixinApplyment.SingleOrDefault(p => p.business_code == business_code && p.applyment_id == applyment_id);
if (inputObj.GetValue("return_code").ToString() == "SUCCESS")
{
model.applyment_state_desc = inputObj.GetValue("applyment_state_desc").ToString();
if (inputObj.GetValue("applyment_state").ToString() == "REJECTED") {
//被驳回
model.audit_detail = JsonConvert.SerializeObject(inputObj.GetValue("audit_detail").ToString());
}
}
ConfigDbTable.DbWeixinApplyment.Update(model);
return ProtocolManager.GetPackage(PackageReturnCode.OK, response);
}