var timestamp = new Date().getTime().toString();
var pzKeyArr =[{name:"walletId",value:walletId},{name:"nonceStr",value:timestamp},{name:"money",value:(totalPrice*100)},{name:"goodsName",value:encodeURIComponent(goodsname)}];
var sign = getSign(pzKeyArr);
function getSign(pzKeyArr){
var PZKEY="aLBZ0NP0aFXH60bQbxk0ktibbbnbbn";
var compare = function (obj1, obj2) {
var val1 = obj1.name;
var val2 = obj2.name;
if (val1 < val2) {
return -1;
} else if (val1 > val2) {
return 1;
} else {
return 0;
}
}
pzKeyArr.sort(compare);
var signSrc = "";
for(var i=0; i<pzKeyArr.length; i++){
signSrc += pzKeyArr[i].name + "=" + pzKeyArr[i].value + "&";
}
signSrc += "key="+PZKEY;
return calcMD5(signSrc).toUpperCase();
}