فهرست منبع

记录微信支付订单号

lcl 1 سال پیش
والد
کامیت
6c346de49d
4فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 2 0
      AppStart/Helper/WeChatPayBackService.cs
  2. 0 1
      AppStart/WeChatFunction.cs
  3. 4 2
      Controllers/HomeController.cs
  4. 3 3
      Startup.cs

+ 2 - 0
AppStart/Helper/WeChatPayBackService.cs

@@ -46,6 +46,7 @@ namespace MySystem
                                 // {\"sp_mchid\":\"1611167423\",\"sub_mchid\":\"1622024882\",\"sp_appid\":\"wxe2c051b3e46c0f6f\",\"out_trade_no\":\"2022022621562926396898863\",\"transaction_id\":\"4200001412202202267619496496\",\"trade_type\":\"JSAPI\",\"trade_state\":\"SUCCESS\",\"trade_state_desc\":\"支付成功\",\"bank_type\":\"OTHERS\",\"attach\":\"\",\"success_time\":\"2022-02-26T21:56:42+08:00\",\"payer\":{\"sp_openid\":\"omawy5W6jb0pgPfuKUVs6K3bEhzk\",\"sub_openid\":\"\"},\"amount\":{\"total\":1,\"payer_total\":1,\"currency\":\"CNY\",\"payer_currency\":\"CNY\"}}
                                 JsonData orderObj = JsonMapper.ToObject(WxPayResourceDecryptModel);
                                 string OrderNo = orderObj["out_trade_no"].ToString();
+                                string TradeNo = orderObj["transaction_id"].ToString();
                                 WebCMSEntities db = new WebCMSEntities();
                                 ConsumerOrderForNo forNo = db.ConsumerOrderForNo.FirstOrDefault(m => m.OrderNo == OrderNo);
                                 if (forNo != null)
@@ -57,6 +58,7 @@ namespace MySystem
                                         order.UpdateDate = DateTime.Now;
                                         order.PayMoney = order.PayMoney * 10000;
                                         order.MaxDivi = order.MaxDivi * 10000;
+                                        order.SeoTitle = TradeNo;
                                         MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
                                         order.UserId = merchant.UserId;
                                         db.SaveChanges();

+ 0 - 1
AppStart/WeChatFunction.cs

@@ -306,7 +306,6 @@ namespace MySystem
 
         #region 敏感信息加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OzHboiXFToJJBtmi7Rdp8AN1aYBbtVX1o0+RmfEiHqXn84GpSNT6tGirHvARi5ab3jvn+bkUWjZYOGd96hus8GirA+wQb/V92Ms3jS5VUS1HBfHaTGT5G2Slrr8YZu"; //私钥
         public string RSAEncrypt(string text)

+ 4 - 2
Controllers/HomeController.cs

@@ -50,9 +50,11 @@ namespace MySystem.Controllers
 
         public string test()
         {
-            string content = "4fGrZ4FwfDEeWp7nPtemBu+FDX81kmHC8nUTb5br0DuctbJSV02UkXkWIylMCEIAGPvE8aprqa0uq2smcHR7YGKv2y8rG/7Gl9QQope2HIZwqtTA4Mgqcl5OfHeDBWAg6QJpL+YmV4Kt9APoZGB/f2iFev+OIUhWAFJS17ev04TPRwlqZ8baAzdIDy31YlDXLd/HlkIj3JdsxlcUwwDtKYGex3412CsyYxjUp7G2W18QEej0WQAnoQxxkP1zA98BQrmTIf4Mwnv5gCe+Wjxk1Ypprh23jHPvWsNesxwMCJSjAylqNLLlXvfJ/F86noL33A9NcavVUXEmbqdVipI5Y9BTXL0OiPCLCDkGvpTFWD8D9VbDjVu9mouMYSWmllWOyz4g6OUKbxE+mUS1J5wLTtiCWn+K7Q37gdIYQheAMj0a4g5SXxOAVFgg0GSFxGeEOpgsd0nXb3OfmU2GKWv1urXP7MPGVg/9QCMyi4YrHE5pSbbCrTybLncf7dNn4SLd3qHpd+sMugRWEjKYe7LD2Wz9Zul5UYg5o+Oz71vIRWCGHNNZEKSD2yjLfyZoBc3RB6pZY0B9HlykNkzfb6t5KpMWj+hxvTyVxYJm12eS06OSS+dAi4VUd50gkG3yo23qsNoZiOlag/hR4Q==";
-            string txt = new WeChatFunction().AesGcmDecrypt("transaction", "5QQ7PFFvBmmY", content);
+            //{"id":"dc4512b7-83cd-5fa5-91e9-a80fc8562e96","create_time":"2023-06-01T13:42:42+08:00","resource_type":"encrypt-resource","event_type":"TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"transaction","algorithm":"AEAD_AES_256_GCM","ciphertext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qL4jZ8hdxV2MRquy8Nbxr1wj926ye98BXdR9ZaAH9G6UMk4YyTjiVMbvhOqciqfuFlwxNkXtpV8b3QAWOhsIw0E210Tss2JDNW38ITaCwfBwSyRfYjYFhoIEbpEVpUZBn2NqxxeK1iv/h2zp3BapS+Zy0iMDba9GDjJVqEHDc6in3rSB3e5/VFjdVm3dWVH3+Gry/pU9ATTJNWaJsr/z3sWzzOoa3u0SsihPIdhJ4QiDlsYAz0JGVvbcqMXyaEb9tRR2oYWy4kOOsYirnSmhuRbeow==";
+            string txt = new WeChatFunction().AesGcmDecrypt("transaction", "QxHnxeB6xtrU", content);
             return txt;
+            //{"sp_mchid":"1611167423","sub_mchid":"1645266943","sp_appid":"wx5417e0770bb19c4e","out_trade_no":"2023060113423544310448679","transaction_id":"4200001833202306012813500432","trade_type":"JSAPI","trade_state":"SUCCESS","trade_state_desc":"支付成功","bank_type":"OTHERS","attach":"","success_time":"2023-06-01T13:42:42+08:00","payer":{"sp_openid":"ooDpv5LkCKEguE-LMZO-rSV4TDpk","sub_openid":""},"amount":{"total":2,"payer_total":2,"currency":"CNY","payer_currency":"CNY"}}
         }
     
     }

+ 3 - 3
Startup.cs

@@ -171,9 +171,9 @@ namespace MySystem
             });
 
             //必须打开的
-            // MerchantConfirmService.Instance.Start();
-            // CheckWeChatSignService.Instance.Start();
-            // WeChatPayBackService.Instance.Start();
+            MerchantConfirmService.Instance.Start();
+            CheckWeChatSignService.Instance.Start();
+            WeChatPayBackService.Instance.Start();
             ProfitHelper.Instance.StartListenTrade();
             //必须打开的
         }