qq_39464862 2017-07-20 01:19 采纳率: 0%
浏览 1067

微信公众号支付成功后修改数据失败

try
{
if (res.Element("xml").Element("return_code").Value == "SUCCESS")
{
//下单成功返回
string repayId = res.Element("xml").Element("prepay_id").Value;
wxpayconfig = new wxHandleModel.wxPayconfig();
wxpayconfig = wxhand.GetwxPay(repayId);

                    b2ccms_Model.b2ccms_order oredrsa = new b2ccms_Model.b2ccms_order();
                    oredrsa.o_static = res.Element("xml").Element("result_code").Value;
                    oredrsa.o_shh = res.Element("xml").Element("out_trade_no").Value;
                    b2ccms_BLL.b2ccms_orderBLL orderBLL = new b2ccms_BLL.b2ccms_orderBLL();
                    orderBLL.Update(oredr);
                }
                else
                {
                    //下单失败返回
                    wxpayconfig = new wxHandleModel.wxPayconfig();
                    if (res.Element("xml").Element("return_msg").Value.Contains("openid"))
                    {
                        //如果错误信息为无效的openid,跳转到授权页面重新授权。
                        Response.Redirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=" + oauthurl + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect");
                    }
                    else
                    {
                        //下单错误信息。
                        Response.Write("return_code:" + res.Element("xml").Element("return_code").Value + ",return_msg:" + res.Element("xml").Element("return_msg").Value);
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message + res.ToString());
            }

                            为什么拿不到数据?
  • 写回答

1条回答 默认 最新

  • kun_hello 2017-07-21 01:59
    关注

    是哪里拿不到数据? 如果是一进页面就没反应的话 就是你没用微信浏览器的问题,

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测