收藏
回答

【微信支付】为什么我的H5场景mweb_url参数不是链接?

统一下单配置:

var wechat = WechatOfficialConfig.ConfigObject;
var wechatpay = WechatPayConfig.ConfigObject;
var enty = new UnifiedOrder();
enty.notify_url = PlatformInfo.ConfigObject.SiteUrl + "/wechat/pay";
enty.appid = wechat.AppId;
enty.device_info = "web001";
enty.attach = "";
enty.mch_id = wechatpay.MerchantId;
enty.out_trade_no = tradeNo;
enty.total_fee = (int)(payTotal * 100); //转成分
enty.spbill_create_ip = userIp;
enty.time_start = DateTime.Now.ToString("yyyyMMddHHmmss");
enty.time_expire = DateTime.Now.AddMinutes(5).ToString("yyyyMMddHHmmss");
enty.trade_type = TradeType.MWEB;
enty.scene_info = new H5Info
{
    h5_info = new WapScene  // type = "Wap"
    {
        wap_name = "***在线支付",
        wap_url = siteUrl // 网站域名
    }
};
enty.sign_type = SignType.MD5;

获取支付信息:

var result = helper.WechatPayHelper.GetH5PayOrderResult(unified, helper.SignKey);
return Content(JsonConvert.SerializeObject(result));

返回结果:

{
    "IsError": false,
    "Message": null,
    "Result": {
        "prepay_id": "wx030915504445932372d1700e1042396100",
        "mweb_url": "DUTOTOHDFLC8wteJ",
        "trade_type": 3
    }
}

文档说 mweb_url 返回一个(支付中间页)链接。但是为什么我返回的不是链接呢?

最后一次编辑于  09-03
回答关注问题邀请回答
收藏

2 个回答

问题标签