wx.sendBizRedPacket({
timeStamp: "" + timeStamp,
nonceStr: nonceStr,
package: pack,
signType: 'MD5',
paySign: getSign(timeStamp, nonceStr, pack),
success: function (res) {
console.log("success:", res);
if (suc) suc(res);
},
fail: function (res) {
console.log("fail:", res);
if (fail) fail(res);
},
complete: function (res) {
if (com) com();
}
});
function getSign(timeStamp,nonceStr,pack){
var string1 = "appId=" + aid + "&nonceStr=" + nonceStr + "&package=" + pack + "&timeStamp=" + timeStamp
var stringSignTemp = string1+ "&key=人工马赛克";
var paySign = md5.hexMD5(stringSignTemp);
console.log("string1", stringSignTemp);
console.log("paySign", paySign);
return paySign;
}
小程序红包详细教程 无需任何资质,不懂得问我哦https://developers.weixin.qq.com/community/develop/article/doc/000c6009a5cbd805d8790d4ab56013
1 检查支付路径是否匹配,要完全一致。
2 您需要用小程序调起微信支付API来调用。不能用JSAPI支付的API来调用 ,就会报这个错
https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_7&index=5