function paySign(a,b,c,d,e){a=MD5Util.MD5("appId\x3d"+a+"\x26nonceStr\x3d"+b+"\x26package\x3dprepay_id\x3d"+c+"\x26signType\x3dMD5\x26timeStamp\x3d"+d+"\x26key\x3d"+e).toUpperCase();console.log(a);return a}function getTimestamp(){return Date.parse(new Date)/1E3}function getNonceStr(a){a=a||32;for(var b="",c=0;c<a;c++)b+="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678".charAt(Math.floor(48*Math.random()));return b}function requestPayment(a){var b=getTimestamp(),c=getNonceStr(32),d=paySign(app.globalData.appId,c,a,b,app.globalData.api_key);wx.requestPayment({timeStamp:b.toString(),nonceStr:c,"package":"prepay_id\x3d"+a,signType:"MD5",paySign:d,success:function(a){wx.showToast({title:"\u652f\u4ed8\u6210\u529f"})},fail:function(a){}})};