public async Task <string> ScanJavBus(string str) { try { NoticeService.SendBarkNotice(SettingService.GetSetting().Result.BarkId, $"开始扫描JavBus"); var startTime = DateTime.Now; str = RedisService.GetHash("scan", str); ScanParam param = JsonHelper.Deserialize <ScanParam>(str); Progress <string> progress = new(); progress.ProgressChanged += ReportScanProgress; await MagnetUrlService.SearchJavBus(param.Url, param.Page, param.Name, progress); NoticeService.SendBarkNotice(SettingService.GetSetting().Result.BarkId, $"扫描JavBus完成,耗时 {(DateTime.Now - startTime).TotalSeconds} 秒"); } catch (Exception ee) { await Clients.Caller.SendAsync($"异常 {ee}"); } finally { RedisService.DeleteHash("scan", str); } return("success"); }
/// <summary> /// 汇聚扫码支付 /// </summary> /// <returns></returns> /// <remarks>2017-12-21 廖移凤</remarks> public ActionResult AjaxScanPayment(int SysNo) { var SP = ScanParamBo.Instance.GetScanParam(SysNo); int pd = 0; if (SP == null) { return(Json("1", JsonRequestBehavior.AllowGet)); } ScanParam param = new ScanParam(); #region 扫码支付 测试参数 param.P2_OrderNo = SysNo + "_" + DateTime.Now.ToString("yyyyMMddhhmm"); param.P3_Amount = SP.P3_Amount; param.P5_ProductName = SP.P5_ProductName.Replace("&", "_"); param.P0_Version = "1.0"; param.P1_MerchantNo = "888100050941685"; param.P4_Cur = 1; param.P9_NotifyUrl = "http://testapi.com/pay/wx_call_back"; if ("微信支付".Equals(SP.Q1_FrpCode)) { param.Q1_FrpCode = "WEIXIN_NATIVE"; pd = 1; } else if ("支付宝".Equals(SP.Q1_FrpCode)) { param.Q1_FrpCode = "ALIPAY_NATIVE"; pd = 2; } else { return(Json("0", JsonRequestBehavior.AllowGet)); } param.Q4_IsShowPic = 1; #endregion var json = ScanPayment(param);//支付 var data = new { json = json, pd = pd }; return(Json(data, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 汇聚扫码支付 /// </summary> /// <param name="param">参数</param> /// <returns>json</returns> /// <remarks> 2017-12-18 廖移凤</remarks> public static string ScanPayment(ScanParam param) { // string secret = "3f67fd97162d20e6fe27748b5b372509";//888100000002340测试密钥 string secret = "68d13cf26c4b4f4f932e3eff990093ba"; //888100050941685测试密钥 string url = "https://www.joinpay.com/trade/uniPayApi.action"; //请求地址 StringBuilder sb = new StringBuilder(); //签名字符串+密钥 sb.Append(param.P0_Version); sb.Append(param.P1_MerchantNo); sb.Append(param.P2_OrderNo); sb.Append(param.P3_Amount); sb.Append(param.P4_Cur); sb.Append(param.P5_ProductName); sb.Append(param.P9_NotifyUrl); sb.Append(param.Q1_FrpCode); sb.Append(param.Q4_IsShowPic); string request = url + "?p0_Version=" + param.P0_Version + "&p1_MerchantNo=" + param.P1_MerchantNo + "&p2_OrderNo=" + param.P2_OrderNo + "&p3_Amount=" + param.P3_Amount + "&p4_Cur=" + param.P4_Cur + "&p5_ProductName=" + param.P5_ProductName + "&p9_NotifyUrl=" + param.P9_NotifyUrl + "&q1_FrpCode=" + param.Q1_FrpCode + "&q4_IsShowPic=" + param.Q4_IsShowPic + "&hmac=" + md5hex(sb.ToString() + secret); string result = Get(request); return(result); }