微信小程序支付开发教程,微信支付有优惠小程序

来源:未知 浏览 151次 时间 2021-06-15 04:10


微信小程序支付终于踩完坑了发现里面坑挺大的现在发个贴创新思维现在发个贴希望以后入坑的同学可以看一下 
https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_4&index=2 
业务流程在这里大家看文档的时候可以看到。第一个坑获取用户的openid参数一定要拼在url连接上英文网站优化方法参数一定要拼在url连接上否则会报{"errcode":40013,"errmsg":"invalid appid, hints: [ req_id: iil1ba0504ns86 ]"}错误

 

微信小程序支付开发教程

// 统一下单接口获取sign(签名) paysignjsapi: function (appid, attach, body, mch_id, nonce_str, notify_url, openid, out_trade_no, spbill_create_ip, total_fee, trade_type, key) { var self = this; //加密签名 wx.request({ url: ':8080/XinXingWXApi/wxXcxApi/Md5Encrypt.do', method: 'GET', data: { appid: appid, attach: attach, body: body, mch_id: mch_id, nonce_str: nonce_str, notify_url: notify_url, openid: openid, out_trade_no: out_trade_no, spbill_create_ip: spbill_create_ip, total_fee: total_fee, trade_type: trade_type, key: key }, //统一下单 success: function (res) { var sign = res.data.strMd5 var formData = "<xml>" formData += "<appid>" + appid + "</appid>" //appid  

标签: urlappid加密签名