JAVA WeChat public account payment

wx.chooseWXPay({
    timestamp: 0, // Payment signature timestamp, note that all timestamp fields in WeChat jssdk are lowercase. However, the timeStamp field name used to generate the signature in the latest version of the payment background needs to capitalize the S character in it.
    nonceStr: '', // Payment signature random string, no longer than 32 bits
    package: '', // The prepay_id parameter value returned by the unified payment interface, the submission format is: prepay_id=***)
    signType: '', // Signature method, the default is 'SHA1', if you use the new version of payment, you need to pass in 'MD5'
    paySign: '', // payment signature
    success: function (res) {
        // Callback function after successful payment
    }
});

timestamp: 0, I was caught by this, I thought it was enough to pass an int type
wx.ready(function() {
    wx.chooseWXPay({
         "timestamp" : "" + orderTimeStamp, // Payment signature timestamp, note that all timestamp fields used in WeChat jssdk are lowercase. However, the timeStamp field name used to generate the signature in the latest version of the payment background needs to capitalize the S character in it.
         "nonceStr" : orderNonceStr, // Payment signature random string, no longer than 32 bits "package" : orderPackage, // The value of the prepay_id parameter returned by the unified payment interface, the submission format is: prepay_id=***)
         "signType" : orderSignType, // Signature method, the default is 'SHA1', if you use the new version of payment, you need to pass in 'MD5'
         "paySign" : orderPaySign, // payment signature
         success : function(res) {
         // Callback function after successful payment
        if (res.errMsg == 'chooseWXPay:ok') {
             $("#payResult").html("Payment successful");
         }
   }
});
});

"timestamp" : "" + orderTimeStamp is changed to this, you need to pass a String to solve it

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326872259&siteId=291194637