You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 regels
2.6 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using CCBSign;
  7. using Learun.Application.Base.SystemModule;
  8. using Learun.Loger;
  9. using Learun.Util;
  10. namespace Learun.Application.Web.Controllers
  11. {
  12. public class PayResultNoticeController : Controller
  13. {
  14. //ccb Notice 建行支付通知
  15. [HttpPost]
  16. public ActionResult ccb()
  17. {
  18. //签名串
  19. string signString =
  20. "3f075c001b32f9ae33e235e5584442438a3c1a60472dd6e2a45eccf91f16b648c173f7ed86cc7e51495f1b59bc91a71314c70a5ac3ea29f080d97fc9e41e1c3c42c4e4b889e338426b20480483cd94a089987076485fc3cb37dfabafea1dd37d0eaaa92d60a3717557824ac3768a5f94d6e0c2a0c108d780e093bdd9319f526f";
  21. //公钥
  22. string pubKey =
  23. "30819d300d06092a864886f70d010101050003818b00308187028181009ba4951169c5deecf03a8ddb2fd934f53747c03a211f63bccc84773182bdd8f7159634705041087e4c9053df05326952a143e1aab5e8ba75ed891a91c2db484b66a064abba6605418944d8763814ff23c161101948ec9ef2dfac735b4bb7c7dac18fbf87157b424780eb7080a3e7c9e79dd4841e44a001edfe497b9e3d2181b9020111";
  24. //签名源串
  25. string initString =
  26. "POSID=000000&BRANCHID=110000000&ORDERID=00320995&PAYMENT=0.01&CURCODE=01&REMARK1=test1&REMARK2=test2&SUCCESS=Y";
  27. //RSASig sign = new RSASig();
  28. //sign.setPublicKey(pubKey);
  29. //bool result = sign.verifySigature(signString, initString);
  30. //if (true == result)//验证成功
  31. //{
  32. // Console.WriteLine("RSA verified!");
  33. //}
  34. //else//验证失败
  35. //{
  36. // Console.WriteLine("RSA not verified!");
  37. //}
  38. //Console.ReadKey();
  39. string ORDERID = Request["ORDERID"];
  40. string ACC_TYPE = Request["ACC_TYPE"];
  41. string SUCCESS = Request["SUCCESS"];
  42. string TYPE = Request["TYPE"];
  43. string REFERER = Request["REFERER"];
  44. string CLIENTIP = Request["CLIENTIP"];
  45. string ACCDATE = Request["ACCDATE"];
  46. string USRMSG = Request["USRMSG"];
  47. string USRINFO = Request["USRINFO"];
  48. string PAYTYPE = Request["PAYTYPE"];
  49. string SIGN = Request["SIGN"];
  50. LogEntity logEntity=new LogEntity();
  51. logEntity.F_CategoryId = 121;
  52. logEntity.F_Module = "cbc";
  53. logEntity.F_ExecuteResultJson = new
  54. {ORDERID, ACC_TYPE, SUCCESS, TYPE, REFERER, CLIENTIP, ACCDATE, USRMSG, USRINFO, PAYTYPE, SIGN}.ToJson();
  55. logEntity.WriteLog();
  56. return Content("true");
  57. }
  58. }
  59. }