Sfoglia il codice sorgente

修复支付宝签约问题

DuGuYang 1 anno fa
parent
commit
3fee930c7a
2 ha cambiato i file con 15 aggiunte e 9 eliminazioni
  1. 12 6
      Util/HaoDa/AlipayFunctionForHD.cs
  2. 3 3
      Util/HaoDa/WeChatFunctionForHD.cs

+ 12 - 6
Util/HaoDa/AlipayFunctionForHD.cs

@@ -35,11 +35,11 @@ namespace MySystem
             string identity_type = info.SubjectType;
             string store_address = info.BizStoreAddress;
             string merchant_type = "STORE";
-            if(!string.IsNullOrEmpty(info.MerchantType))
+            if (!string.IsNullOrEmpty(info.MerchantType))
             {
                 merchant_type = info.MerchantType;
             }
-            if(merchant_type == "STALL")
+            if (merchant_type == "STALL")
             {
                 store_address = "无";
             }
@@ -63,7 +63,7 @@ namespace MySystem
             if (info.SubjectType == "SUBJECT_TYPE_SMALL")
             {
                 info.LicenseCopy = info.IdCardCopy;
-                for(int i = 0; i < 9; i++)
+                for (int i = 0; i < 9; i++)
                 {
                     CertMerchantName = CertMerchantName.Replace(i.ToString(), "");
                 }
@@ -107,9 +107,15 @@ namespace MySystem
                     city_code = district_code.Substring(0, 4) + "00";
                     province_code = district_code.Substring(0, 2) + "0000";
                     string[] CityNames = cityItem.CityName.Split(',');
-                    district = CityNames[CityNames.Length - 3];
-                    city = CityNames[CityNames.Length - 2];
-                    province = CityNames[CityNames.Length - 1];
+                    province = CityNames[0];
+                    if (CityNames.Length >= 2)
+                    {
+                        city = CityNames[1];
+                    }
+                    if (CityNames.Length >= 3)
+                    {
+                        district = CityNames[2];
+                    }
                 }
                 BizContent += "    \"support_credentials\":{" +
                 "      \"merchant_type\":\"" + merchant_type + "\"," +

+ 3 - 3
Util/HaoDa/WeChatFunctionForHD.cs

@@ -40,7 +40,7 @@ namespace MySystem
         {
             Dictionary<string, object> result = new Dictionary<string, object>();
             string business_code = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
-            if(!string.IsNullOrEmpty(info.WeChatMerchantId))
+            if (!string.IsNullOrEmpty(info.WeChatMerchantId))
             {
                 result.Add("channel_id", info.WeChatMerchantId); //渠道商户号
             }
@@ -68,7 +68,7 @@ namespace MySystem
             if (info.SubjectType == "SUBJECT_TYPE_SMALL")
             {
                 info.LicenseCopy = info.IdCardCopy;
-                for(int i = 0; i < 9; i++)
+                for (int i = 0; i < 9; i++)
                 {
                     CertMerchantName = CertMerchantName.Replace(i.ToString(), "");
                 }
@@ -103,7 +103,7 @@ namespace MySystem
                 assist_prove_info.Add("store_indoor_copy", GetMediaId("/" + info.IndoorPic)); //店内环境照片
                 subject_info.Add("assist_prove_info", assist_prove_info); //辅助证明材料信息
             }
-            
+
             result.Add("subject_info", subject_info);
 
             Dictionary<string, object> identification_info = new Dictionary<string, object>();