基本信息
源码名称:微信扫码支付实例源码下载(亲测通过)
源码大小:0.76M
文件格式:.zip
开发语言:C#
更新时间:2016-01-05
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
主要实现了 扫描二维码进行支付,支付成功后 执行相关业务操作
需 把 WxPayHelper.cs 构造 函数中的 appid/mch_id/PartnerKey 这些值改成自己申请的支付信息即可使用
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WxV3.Helper; namespace WxV3 { /// <summary> /// 生成二维码,扫描 /// </summary> public partial class NativeQrCode : System.Web.UI.Page { WxPayHelper helper = new WxPayHelper(); protected void Page_Load(object sender, EventArgs e) { string proId = DateTime.Now.ToString("yyyyMMddHHmmss") CommonUtil.BuildRandomStr(4); litQrcode.Text = CreateQRCodeUrl(proId);//暂定产品id为1 ,模拟 } public string CreateQRCodeUrl(string productid) { Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("appid", helper.GetAppId); dic.Add("mch_id", helper.GetMch_Id); dic.Add("nonce_str", TenpayUtil.getNoncestr()); dic.Add("product_id", productid); dic.Add("time_stamp", TenpayUtil.getTimestamp()); dic.Add("sign",helper.GetSign(dic)); string url = WxPayHelper.FormatBizQueryParaMap(dic, false);//这里不要url编码 return "weixin://wxpay/bizpayurl?" url; } } }