收藏
回答

小程序领取 红包 提示 access denied 错误

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;

}


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容