• 微信小微商户获取申请状态


      /// <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);
    
            }
    
    
  • 相关阅读:
    windows上phpstudy配置memcache
    获取全站详情链接,并输出为txt文本
    Linux 宝塔面板免费版开启 waf 防火墙的方法
    where条件多种情况
    网站加https
    git常用命令
    缓存
    Stream转换成byte[] 、将 byte[] 转成 Stream 、Stream和文件的转换、从文件读取 Stream
    C#发送邮件
    Ref和Out的区别
  • 原文地址:https://www.cnblogs.com/HiLzd/p/10444860.html
Copyright © 2020-2023  润新知