Browse Source

支付接口音响码解密

lcl 1 year ago
parent
commit
6089a07578
1 changed files with 14 additions and 0 deletions
  1. 14 0
      Areas/Api/Controllers/Main/ConsumerOrdersController.cs

+ 14 - 0
Areas/Api/Controllers/Main/ConsumerOrdersController.cs

@@ -64,6 +64,20 @@ namespace MySystem.Areas.Api.Controllers.v1
                 SnNo = SnNo.TrimEnd('\0');
                 SnNo = SnNo.Substring(0, 20);
             }
+            if(!string.IsNullOrEmpty(Machine))
+            {
+                if (Machine.Length > 20)
+                {
+                    Machine = System.Web.HttpUtility.UrlDecode(Machine);
+                    if (!Machine.EndsWith("="))
+                    {
+                        Machine += "=";
+                    }
+                    Machine = dbconn.Decrypt3DES(Machine, "l2k0b2#3");
+                    Machine = Machine.TrimEnd('\0');
+                    Machine = Machine.Substring(0, 20);
+                }
+            }
             int MerchantId = 0;
             if(Machine == SnNo)
             {