Ejemplo n.º 1
0
 public string ConvertPayJson(PayRequestInfo req)
 {
     string str = "{";
     return (((((((str + "\"appId\":\"" + req.appId + "\",") + "\"timeStamp\":\"" + req.timeStamp + "\",") + "\"nonceStr\":\"" + req.nonceStr + "\",") + "\"package\":\"" + req.package + "\",") + "\"signType\":\"" + req.signType + "\",") + "\"paySign\":\"" + req.paySign + "\"") + "}");
 }
Ejemplo n.º 2
0
 public PayRequestInfo BuildPayRequest(PackageInfo package)
 {
     PayRequestInfo info = new PayRequestInfo {
         appId = this._payAccount.AppId,
         package = this.BuildPackage(package),
         timeStamp = Utils.GetCurrentTimeSeconds().ToString(),
         nonceStr = Utils.CreateNoncestr()
     };
     PayDictionary parameters = new PayDictionary();
     parameters.Add("appId", this._payAccount.AppId);
     parameters.Add("timeStamp", info.timeStamp);
     parameters.Add("package", info.package);
     parameters.Add("nonceStr", info.nonceStr);
     parameters.Add("signType", "MD5");
     info.paySign = SignHelper.SignPay(parameters, this._payAccount.PartnerKey);
     return info;
 }