Browse Source

支付宝逻辑调通

lcl 1 year ago
parent
commit
4adfd30590

+ 1 - 0
AppStart/Alipay/AlipayFunction.cs

@@ -16,6 +16,7 @@ namespace MySystem
         { }
 
         private string AppId = "2021003116616751";
+        public string Pid = "2088141704579033";
         private string PrivateKey = "MIIEpAIBAAKCAQEA1KjMzZJIRG6QQ3+c/euVrc+8RR0xMw6A+EONSKhJq4Bg+rtxQPCfdF2bpZ4NMaSqfalSiLoxrZSYBYOZhpDP67i9LXGUoFCWdRL7ROTqJvuU6KyEeMplQ6Q3uwWbuKbh9COt0vhqn/pjlUsomTwq+DRQv10awynkZikqceXdP0EH4iGZG0hyerEP5yLHpHiggf4f7TOsovHX+fGLPmWFO1zUTHHbz7HxU4BQKn3yuje4yMhoyv5h/wZzeVwvj+Qti8Hlh351rF0f5BHwN1YMGIrWuPU5bF8OMHS/UXPxh7Bs795ZZyplYztTz26QfKfLWVVsLOng4pvgPS+OgzZydwIDAQABAoIBAEu6mMQT9Zw46zK+PP/HZxPwSBEsphqSbab7F1LqauGh4+cl3NzNU1szAnxl3jjxdK0vIO8DrzErGz/Lb16WLxS4QtXt/olgaVPjoIsWIbQkHxEEbmA9YvZFgnsdMij9dLVmBz57rCywE8pUa262GG8u4hpjY2Zggq9GtZC91J3zOeETBG828gU+FLHGcDpfz7pD1jC0noDfDRxmIImOMZvChIvvY+tm6MpySXN8lw1vxhLc0aZbKSQkuVyCyB4fIsdJJvh2dRPiY+BA0jXNK3mWwnnHzac/9JXqWFlwk6iPIIjXPUldz7Zq3EpCI+9p+UqLtIu6BAUbk1biFTt8xMECgYEA+2iIxZfdl1N1suA/aEbUdjd0kxeeOsGv7Ps0rOYn+4/q1dkUukg2V6VRy3E8BUt+9zLPTR8DmL7oBi+kDsGehjHlH7U6Pe8qKszB4ufQBDHc71yg9liqOWa4s9VoBD0VIU9CO0HtYjRor7rVuUzp+j58SLP7wIEPGEwdgjeYENECgYEA2IsYEyHiwhjy5rx7fmv3duZC5zyesIqxdAz79AuZ7gnpNEhddi5cEpcibnVmwZliCe6SoLzXZ6difEfD4VmLsYEAWqf5sqJ2PswZmHtA9F4We9WUe2zj+pFG0yCCVrcbDZXzQYaLmyuMNe/jpgyY178czohpnvQlr++bYa9DYMcCgYEAqGX6xy/UM9qpiel/T1+yTIUUxroZOI4oQvp47B82ROC/kgJYSfa4v7hys2zjoUBSiU41YRkXFac6T3p1z5SNlKGzMav4mSer/QMuE8jmowirToGjJ594Vf6iVYLqq3wmvSsT2BFu6krknGDva7FDQGW+Zgx44xcPf1zsnx6R8yECgYEAtfFA3Cp3lbBSvy4U8ScUOPHFuvbDOwB9k02pkOcCgfAP4p7+8GKJeBFGm9rG6NnQdxneV3Hz5yLL7DJ8UebkKdODEajbc41vntnsk6LT877uU0QkSwQ2FX1lLdW9zdBxyZt5VVAQEuOnHlaeRxGEhpoMQTh6zlTDKa1AN/aDvVcCgYApytvSEdTpKcQuEyPOfbQv2pXYujCacMFIRHvJW/HvX7yaZSAvSYK+lw8l53bTbJpJ3pq/1Tol6tyjY7HRsVvQ68Jn1MApARMlldn1GoAPcgDFzlJCB0JCOUAE1rBS5lA97wQ1YhI8qBRqaE7Qrtf4D5oZdEjbtq8VCeIaD9huIQ==";
         private string PublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1KjMzZJIRG6QQ3+c/euVrc+8RR0xMw6A+EONSKhJq4Bg+rtxQPCfdF2bpZ4NMaSqfalSiLoxrZSYBYOZhpDP67i9LXGUoFCWdRL7ROTqJvuU6KyEeMplQ6Q3uwWbuKbh9COt0vhqn/pjlUsomTwq+DRQv10awynkZikqceXdP0EH4iGZG0hyerEP5yLHpHiggf4f7TOsovHX+fGLPmWFO1zUTHHbz7HxU4BQKn3yuje4yMhoyv5h/wZzeVwvj+Qti8Hlh351rF0f5BHwN1YMGIrWuPU5bF8OMHS/UXPxh7Bs795ZZyplYztTz26QfKfLWVVsLOng4pvgPS+OgzZydwIDAQAB";
         private string AlipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxycehrmnTl2IaIAECP+0HWc1eWGM/T6x022K7K6fdf+xoyC97TBJaG4G3Bcon4gsJX+Sad5IA9OJIQ4eN1joM35hIlwcFZ6MmCuVXx/SMAKThIjK0jsRc6aTxVQG+GVCgS7dXMKb4Sm+vK2wEM6xtDeqcfYMB0BqGZRvxbIV59a2ooPrha4FkV6nNC9DQefzC0picHXV64oYUjMM2ed4ASTQVds7HP9BZfalz//APZcWdBV08f+xv7n79Twz/gNtVAadfuTAlcjsS6aK+G/OrZtr/diuemeRPRUKlVhcr5xOQDhqBgtdIw8M9Wp6I4ULXRlthKVBWToH9j6n9vDIiwIDAQAB";

+ 4 - 4
AppStart/Helper/AlipayPayBackService.cs

@@ -117,20 +117,20 @@ namespace MySystem
                                 //添加分账接收方
                                 if(merchant.Sort == 0)
                                 {
-                                    string content = AlipayFunction.Instance.BindSettleRelation(DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), merchantAdd.AlipayPid, merchantAdd.AlipayAuthToken);
+                                    string content = AlipayFunction.Instance.BindSettleRelation(DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), AlipayFunction.Instance.Pid, merchantAdd.AlipayAuthToken);
                                     merchantAdd.Sort = 1;
                                     db.SaveChanges();
                                 }
                                 //发起分账
-                                decimal fee = order.PayMoney * 0.99M;
-                                if(fee >= 1)
+                                decimal fee = order.PayMoney * 0.01M;
+                                if(fee >= 0.01M)
                                 {
                                     string TradeNo = order.SeoTitle;
                                     string OrderNo = order.OrderNo;
                                     List<RoyaltyParameters> Parameters = new List<RoyaltyParameters>();
                                     Parameters.Add(new RoyaltyParameters()
                                     {
-                                        Account = merchantAdd.SeoTitle,
+                                        Account = AlipayFunction.Instance.Pid,
                                         Amount = fee.ToString("f2"),
                                     });
                                     AlipayFunction.Instance.Settle(OrderNo, TradeNo, Parameters, merchantAdd.AlipayAuthToken);

+ 1 - 1
AppStart/Helper/AlipayShareService.cs

@@ -70,7 +70,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "查询分账异常");
+                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝查询分账异常");
             }
         }
     }

+ 12 - 11
Startup.cs

@@ -171,17 +171,18 @@ namespace MySystem
             });
 
             //必须打开的
-            // MerchantConfirmService.Instance.Start(); //特约商户进件队列
-            // CheckAlipaySignService.Instance.Start(); //特约商户签约队列(支付宝)
-            // CheckWeChatSignService.Instance.Start(); //特约商户签约队列(微信)
-            // AlipayPayBackService.Instance.Start(); //支付宝支付回调队列
-            // AlipayPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
-            // WeChatPayBackService.Instance.Start(); //微信支付回调队列
-            // WeChatPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
-            // ProfitHelper.Instance.StartActive(); //发放达标奖励队列
-            // ProfitHelper.Instance.StartListenTrade(); //支付宝返现队列
-            // ProfitHelper.Instance.StartListenWxTrade(); //微信返现队列
-            // ProfitShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现
+            MerchantConfirmService.Instance.Start(); //特约商户进件队列
+            CheckAlipaySignService.Instance.Start(); //特约商户签约队列(支付宝)
+            CheckWeChatSignService.Instance.Start(); //特约商户签约队列(微信)
+            AlipayPayBackService.Instance.Start(); //支付宝支付回调队列
+            AlipayPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
+            WeChatPayBackService.Instance.Start(); //微信支付回调队列
+            WeChatPayBackService.Instance.StartProfitShare(); //监听已支付订单,超过1分钟的订单执行分账
+            ProfitHelper.Instance.StartActive(); //发放达标奖励队列
+            ProfitHelper.Instance.StartListenTrade(); //支付宝返现队列
+            ProfitHelper.Instance.StartListenWxTrade(); //微信返现队列
+            ProfitShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现(微信)
+            AlipayShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现(支付宝)
             //必须打开的
         }
     }