Forráskód Böngészése

绑定音响需要请求支付宝接口

lcl 1 éve
szülő
commit
72ff2bd7bc
29 módosított fájl, 2364 hozzáadás és 31 törlés
  1. 45 13
      Areas/Api/Controllers/Main/MerchantQrCodeController.cs
  2. 18 18
      Service/Main/PosMachinesService.cs
  3. 168 0
      Util/HaoDa/Alipay/AliIotFunction.cs
  4. 102 0
      Util/HaoDa/Alipay/Base/AopDictionary.cs
  5. 191 0
      Util/HaoDa/Alipay/Base/AopModelParser.cs
  6. 90 0
      Util/HaoDa/Alipay/Base/RoyaltyDetail.cs
  7. 24 0
      Util/HaoDa/Alipay/Domain/IndirectAuthOrderFailedReason.cs
  8. 123 0
      Util/HaoDa/Alipay/Request/AlipayCommerceIotDeviceBaseinfoQueryRequest.cs
  9. 123 0
      Util/HaoDa/Alipay/Request/AlipayCommerceIotDeviceTradevoiceSendRequest.cs
  10. 123 0
      Util/HaoDa/Alipay/Request/AlipayMerchantIndirectAuthorderCreateRequest.cs
  11. 123 0
      Util/HaoDa/Alipay/Request/AlipayMerchantIndirectAuthorderQuerystatusRequest.cs
  12. 123 0
      Util/HaoDa/Alipay/Request/AlipayMerchantIndirectIotBindRequest.cs
  13. 123 0
      Util/HaoDa/Alipay/Request/AlipayMerchantIndirectIotUnbindRequest.cs
  14. 268 0
      Util/HaoDa/Alipay/Request/AlipayOpenAgentCommonSignRequest.cs
  15. 126 0
      Util/HaoDa/Alipay/Request/AlipayOpenAgentCommonsignConfirmRequest.cs
  16. 123 0
      Util/HaoDa/Alipay/Request/AlipayTradeOrderSettleQueryRequest.cs
  17. 123 0
      Util/HaoDa/Alipay/Request/AlipayTradeRoyaltyRelationBindRequest.cs
  18. 139 0
      Util/HaoDa/Alipay/Request/AntMerchantExpandIndirectImageUploadRequest.cs
  19. 17 0
      Util/HaoDa/Alipay/Response/AlipayCommerceIotDeviceBaseinfoQueryResponse.cs
  20. 12 0
      Util/HaoDa/Alipay/Response/AlipayCommerceIotDeviceTradevoiceSendResponse.cs
  21. 23 0
      Util/HaoDa/Alipay/Response/AlipayMerchantIndirectAuthorderCreateResponse.cs
  22. 38 0
      Util/HaoDa/Alipay/Response/AlipayMerchantIndirectAuthorderQuerystatusResponse.cs
  23. 12 0
      Util/HaoDa/Alipay/Response/AlipayMerchantIndirectIotBindResponse.cs
  24. 12 0
      Util/HaoDa/Alipay/Response/AlipayMerchantIndirectIotUnbindResponse.cs
  25. 12 0
      Util/HaoDa/Alipay/Response/AlipayOpenAgentCommonSignResponse.cs
  26. 17 0
      Util/HaoDa/Alipay/Response/AlipayOpenAgentCommonsignConfirmResponse.cs
  27. 32 0
      Util/HaoDa/Alipay/Response/AlipayTradeOrderSettleQueryResponse.cs
  28. 17 0
      Util/HaoDa/Alipay/Response/AlipayTradeRoyaltyRelationBindResponse.cs
  29. 17 0
      Util/HaoDa/Alipay/Response/AntMerchantExpandIndirectImageUploadResponse.cs

+ 45 - 13
Areas/Api/Controllers/Main/MerchantQrCodeController.cs

@@ -120,13 +120,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             fields.Add("SnNo", SnNo);
             fields.Add("QueryCount", 2);
             MerchantQrCodeService.Add(fields);
-            // query = maindb.MerchantQrCode.Add(new MerchantQrCode()
-            // {
-            //     CreateDate = DateTime.Now, //绑定时间
-            //     MerchantId = MerchantId, //商户
-            //     SnNo = SnNo,
-            // }).Entity;
-            // maindb.SaveChanges();
+
             string DataId = query.Id + "_0";
             Models.Main1.MachineForQrCode forQrCode = main1db.MachineForQrCode.FirstOrDefault(m => m.DataId == DataId);
             if (forQrCode == null)
@@ -157,12 +151,33 @@ namespace MySystem.Areas.Api.Controllers.v1
             fields.Add("OpId", 2);
             fields.Add("QueryCount", 2);
             PosMachinesTwoService.Edit(fields, pos.Id, false);
-            // pos.BuyUserId = merchant.UserId;
-            // pos.UserId = merchant.UserId;
-            // pos.BindingTime = DateTime.Now;
-            // pos.BindingState = 1;
-            // pos.BindMerchantId = MerchantId;
-            // maindb.SaveChanges();
+
+            if(SnNo != MachineNo && !string.IsNullOrEmpty(MachineNo))
+            {                
+                //通过sn获取设备号
+                string result = AliIotFunction.Instance.IotDeviceQuery(MachineNo);
+                JsonData jsonObj = JsonMapper.ToObject(result);
+                if(jsonObj["alipay_commerce_iot_device_baseinfo_query_response"]["code"].ToString() == "10000")
+                {
+                    string deviceId = jsonObj["alipay_commerce_iot_device_baseinfo_query_response"]["device_id"].ToString();                    
+                    Models.Main.MerchantAddInfo addinfo = MerchantAddInfoService.Query(MerchantId);
+                    //通过商户smid(好哒认证成功后台提供)绑定支付宝设备
+                    result = AliIotFunction.Instance.IotBind(addinfo.AliMerchantId, deviceId);
+                    jsonObj = JsonMapper.ToObject(result);
+                    if(jsonObj["alipay_merchant_indirect_iot_bind_response"]["code"].ToString() == "10000")
+                    {                        
+                        Models.Main1.PosMachines machine = PosMachinesService.Query(" PosSn='" + MachineNo + "'");
+                        fields = new Dictionary<string, object>();
+                        fields.Add("BuyUserId", merchant.UserId);
+                        fields.Add("UserId", merchant.UserId);
+                        fields.Add("BindingTime", DateTime.Now);
+                        fields.Add("BindingState", 1);
+                        fields.Add("BindMerchantId", MerchantId);
+                        fields.Add("DeviceName", deviceId);
+                        PosMachinesService.Edit(fields, machine.Id, false);
+                    }
+                }
+            }
 
             PublicFunction.BindUserMachineData(main1db, merchant.UserId, 0, 1, SnNo);
 
@@ -226,6 +241,23 @@ namespace MySystem.Areas.Api.Controllers.v1
                 Models.Main1.MachineForQrCode edit = main1db.MachineForQrCode.FirstOrDefault(m => m.DataId == sub.DataId);
                 if (edit != null)
                 {
+                    if(edit.SnNo != edit.MachineSnNo)
+                    {
+                        Models.Main.MerchantAddInfo addinfo = MerchantAddInfoService.Query(edit.MerchantId);
+                        Models.Main1.PosMachines machine = PosMachinesService.Query(" PosSn='" + edit.MachineSnNo + "'");
+                        string result = AliIotFunction.Instance.IotUnBind(addinfo.AliMerchantId, machine.DeviceName);
+                        JsonData jsonObj = JsonMapper.ToObject(result);
+                        if(jsonObj["alipay_merchant_indirect_iot_unbind_response"]["code"].ToString() == "10000")
+                        {
+                            Dictionary<string, object> fields = new Dictionary<string, object>();
+                            fields.Add("BuyUserId", 0);
+                            fields.Add("UserId", 0);
+                            fields.Add("BindingTime", DateTime.Parse("1900-01-01"));
+                            fields.Add("BindingState", 0);
+                            fields.Add("BindMerchantId", 0);
+                            PosMachinesService.Edit(fields, machine.Id, false);
+                        }
+                    }
                     main1db.MachineForQrCode.Remove(edit);
                     int MachineId = int.Parse(function.CheckInt(edit.DataId.Split('_')[1]));
                     Models.Main1.MerchantQrCode qrCode = main1db.MerchantQrCode.FirstOrDefault(m => m.MerchantId == MachineId);

+ 18 - 18
Service/Main/PosMachinesService.cs

@@ -49,7 +49,7 @@ namespace MySystem.Service.Main
             fields.Add("ActivationStatus"); //激活状态
             fields.Add("ActivationDate"); //激活时间
 
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.main1Tables, _conn).IndexData("MerchantInfo", relationData, orderBy, page, limit, condition, fields);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.main1Tables, _conn).IndexData("PosMachines", relationData, orderBy, page, limit, condition, fields);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             count = int.Parse(obj["count"].ToString());
             return diclist;
@@ -77,7 +77,7 @@ namespace MySystem.Service.Main
             fields.Add("ActivationStatus"); //激活状态
             fields.Add("ActivationDate"); //激活时间
 
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.main1Tables, _conn).IndexData("MerchantInfo", relationData, orderBy, page, limit, condition, fields);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.main1Tables, _conn).IndexData("PosMachines", relationData, orderBy, page, limit, condition, fields);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             return diclist;
         }
@@ -87,26 +87,26 @@ namespace MySystem.Service.Main
         /// </summary>
         /// <param name="Id">主键Id</param>
         /// <returns></returns>
-        public static MerchantInfo Query(int Id)
+        public static PosMachines Query(int Id)
         {
             WebCMSEntities db = new WebCMSEntities();
-            MerchantInfo editData = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+            PosMachines editData = db.PosMachines.FirstOrDefault(m => m.Id == Id) ?? new PosMachines();
             db.Dispose();
             return editData;
         }
-        public static MerchantInfo Query(string condition, string fields = "*")
+        public static PosMachines Query(string condition, string fields = "*")
         {
-            var merchantInfo = new DbService(AppConfig.Base.main1Tables, _conn).Query(fields, "MerchantInfo", condition);
-            if (merchantInfo.Count > 0)
+            var PosMachines = new DbService(AppConfig.Base.main1Tables, _conn).Query(fields, "PosMachines", condition);
+            if (PosMachines.Count > 0)
             {
-                return Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantInfo>(Newtonsoft.Json.JsonConvert.SerializeObject(merchantInfo));
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<PosMachines>(Newtonsoft.Json.JsonConvert.SerializeObject(PosMachines));
             }
-            return new MerchantInfo();
+            return new PosMachines();
         }
 
         public static decimal Sum(string condition, string field)
         {
-            var dt = new DbService(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field, "MerchantInfo", condition);
+            var dt = new DbService(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field, "PosMachines", condition);
             decimal amount = 0;
             if (dt.Count > 0)
             {
@@ -122,7 +122,7 @@ namespace MySystem.Service.Main
         /// <returns></returns>
         public static int Count(string condition = "", string field = "Id")
         {
-            var dt = new DbService(AppConfig.Base.main1Tables, _conn).Query("Count(" + field + ") " + field, "MerchantInfo", condition);
+            var dt = new DbService(AppConfig.Base.main1Tables, _conn).Query("Count(" + field + ") " + field, "PosMachines", condition);
             int result = 0;
             if (dt.Count > 0)
             {
@@ -139,7 +139,7 @@ namespace MySystem.Service.Main
         public static bool Exist(int Id)
         {
             WebCMSEntities db = new WebCMSEntities();
-            bool check = db.MerchantInfo.Any(m => m.Id == Id);
+            bool check = db.PosMachines.Any(m => m.Id == Id);
             db.Dispose();
             return check;
         }
@@ -163,7 +163,7 @@ namespace MySystem.Service.Main
                 }
 
             }
-            int Id = new DbService(AppConfig.Base.main1Tables, _conn).Add("MerchantInfo", fields, 0);
+            int Id = new DbService(AppConfig.Base.main1Tables, _conn).Add("PosMachines", fields, 0);
             return new AppResultJson() { Status = "1", Data = Id };
         }
 
@@ -186,7 +186,7 @@ namespace MySystem.Service.Main
                 }
 
             }
-            new DbService(AppConfig.Base.main1Tables, _conn).Edit("MerchantInfo", fields, Id);
+            new DbService(AppConfig.Base.main1Tables, _conn).Edit("PosMachines", fields, Id);
             return new AppResultJson() { Status = "1", Data = Id };
         }
 
@@ -198,7 +198,7 @@ namespace MySystem.Service.Main
         {
             Dictionary<string, object> fields = new Dictionary<string, object>();
             fields.Add("Status", -1);
-            new DbService(AppConfig.Base.main1Tables, _conn).Edit("MerchantInfo", fields, Id);
+            new DbService(AppConfig.Base.main1Tables, _conn).Edit("PosMachines", fields, Id);
         }
 
         /// <summary>
@@ -207,7 +207,7 @@ namespace MySystem.Service.Main
         /// <param name="Id">主键Id</param>
         public static void Delete(int Id)
         {
-            new DbService(AppConfig.Base.main1Tables, _conn).Delete("MerchantInfo", Id);
+            new DbService(AppConfig.Base.main1Tables, _conn).Delete("PosMachines", Id);
         }
 
         /// <summary>
@@ -217,7 +217,7 @@ namespace MySystem.Service.Main
         /// <param name="Sort">排序序号</param>
         public static void Sort(int Id, int Sort)
         {
-            new DbService(AppConfig.Base.main1Tables, _conn).Sort("MerchantInfo", Sort, Id);
+            new DbService(AppConfig.Base.main1Tables, _conn).Sort("PosMachines", Sort, Id);
         }
 
         /// <summary>
@@ -232,7 +232,7 @@ namespace MySystem.Service.Main
             {
                 JsonData dr = list[i];
 
-                db.MerchantInfo.Add(new MerchantInfo()
+                db.PosMachines.Add(new PosMachines()
                 {
                     CreateDate = DateTime.Now,
                     UpdateDate = DateTime.Now,

+ 168 - 0
Util/HaoDa/Alipay/AliIotFunction.cs

@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using Aop.Api;
+using Library;
+using Microsoft.AspNetCore.Http;
+using Aop.Api.Request;
+using Aop.Api.Response;
+using Aop.Api.Util;
+using MySystem.Models;
+using System.Linq;
+
+namespace MySystem
+{
+    public class AliIotFunction
+    {
+        public readonly static AliIotFunction Instance = new AliIotFunction();
+        private AliIotFunction()
+        { }
+
+        // public string Pid = "2088720140260314";
+        private string AppId = "2021004109682585";
+        private string PrivateKey = "MIIEpAIBAAKCAQEAvf75JGQL9IDg8xu2C6qWrIO3H4roSwpvwUeh6y2kQ8iH0gqQXlyLj13ku8pzY1H9JTSeARCsHSD/VJFxMoPOBO+/xGDV3CSdxhOE5Fu5E30ZZMA5XmnMKyN8q+MEh7refGuCmldedTmzr9mNw4HDjS1uqJoqYRl3eUEaC/Syl620iiaSh7Q9/rsT/qNcnP5hO9P3DWionNt78elmjLt0sBdBkQ10o2XwC5RuzBfP8DCBEdL/DPOOE4vtmLP1IdDI7qtjBhX8PdL+/IRxe/4OGvYSPnHW7JNlN970h2UN5i0Yu0AkidJvlS59nX9C1WJ4U37HiMnkMNXLB/Ubi5BkgQIDAQABAoIBAQC1itVKpWIa/a5z/Q2EtjqEmtK2jAcL9Ov11dlsm07zCcBlvXxW/bzIf6IYogiBZY0qKM21HNYoeygeCV8NMo3/f4pQPWr7j+1Fn88CWHZOneFOuLHYeeUBb0YoA6KHgtImNqAzk7oI7tq383uWzP4qfrfW2IAYCbp0HPWjaOvhKw7qrejcTPW0oCsPjm6nkjzW6FzjkPCwiiivvpC67EzpXKF8HnYyF1KMEuH6h7qZl4jtloW8CkgkwnBhc9iYhN/ygllYdPU9aRdThG7tFVCHft7cIq5F54pJoUm/ML3fpdVjFDAVGZFbkZyg4gkIYCLIEgTVt2W4Lfr8/61PimC1AoGBAOAt7Un2B3ouxN/31Z8ApcTL9QfElPcepTfKhwUDI+KRlygele1r7bIzlDgYVVrMSzzkoYD1vb0scc3hO1EBvURM9BbJJHRl9qncDbF0BPiznm688G26jNwLSn5sgloBV1scqWIK1vCSGw+x71Iy2PQBGlliNVwycFzGvLVTenlHAoGBANj26d25362Jvstq7VMIyYGHU9N/gG4k2Ngoxv2uDbeVb9qeTb0N8/w9mar9fD6Cg4Wr1yLoX3oZqkomxcVU0Zy2ihzf0dpyD9j6M0t+e0Qkvuw3b3RSHzHDEn/j00H2IPQB+uzkczruvOAo4X5YwkE5Jz19xiaPXn8hZmfEgBf3AoGAdJ+v6GAzt56JETLvUQ6XLnAkguwDyyOINCQKZdMiYgX3qwluWdtiBujKXPxbuya4pW8TjfFJyhZLBh38K8JJ4jReb1QowN0im289OGnxBCj9bQKh2ZPJH9hH4sk0bvpvpZidjcGx2+lGZr3ckNifASFpwcJTnCkpRzqkhXhuKJUCgYEAmh3iiB7VlXboMaTVygrO4JSZZf4G47aG1h05JM/zbHnZR4j1nZqAuqejNYP0Mo8RD+29100LLTd38E5UY9TZRKGhv9r5PVuSiEVKFJFWzFPxzued4xnGkNmJlZDm6s8EH3AcpxOsCqu1POGtM8umyR/pENP74j4rGNFH5eP+PYcCgYA84Die07zXP31rfOWWabjDMaq4bPMH9drzhjXdMYaFH3T6F1Ba52Iqsk5K526RdPM6eeR1dFPPotNhZMJPmg1PALNSjVBmKnklF+/y6c4eFOiUgTS/wyNpSlr/eKECsWPch9UlAkkIos5lq02pVAv4kK9WumSyXDe5Gu6a5pUC1A==";
+        private string PublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvf75JGQL9IDg8xu2C6qWrIO3H4roSwpvwUeh6y2kQ8iH0gqQXlyLj13ku8pzY1H9JTSeARCsHSD/VJFxMoPOBO+/xGDV3CSdxhOE5Fu5E30ZZMA5XmnMKyN8q+MEh7refGuCmldedTmzr9mNw4HDjS1uqJoqYRl3eUEaC/Syl620iiaSh7Q9/rsT/qNcnP5hO9P3DWionNt78elmjLt0sBdBkQ10o2XwC5RuzBfP8DCBEdL/DPOOE4vtmLP1IdDI7qtjBhX8PdL+/IRxe/4OGvYSPnHW7JNlN970h2UN5i0Yu0AkidJvlS59nX9C1WJ4U37HiMnkMNXLB/Ubi5BkgQIDAQAB";
+        public string AlipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiXVtTk6opnYllnH/X40k/jSw/82WZ+lGbYQLYH/nVONFJ7Gr9C/dlKpJFIbS+vNDn+YLtM923KmEVSgf8zU0WrTkRjWvKEiyLswWZVqSZW5Jfon1e2SfjNrAVi6XBZa7urAItKQsdD2vFFuyG/ohlXBL103xC1wnjvECD/iholoruEFOLyfobJKTY/6iyrKeOElem1V7OWl6gdjG2oozj3nbVZhtkQvPJECYlolH96eK2mieTkFK82aZ5Tdzx1LPk/3hxRAmzz/9X7xfXdOly88hKBmW8LC9RhTlOWbrXJhhFz13A4brnbnOiY/X7b2OkAYifammc2uh0AIJlCmBTQIDAQAB";
+        //"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB";
+
+
+        #region 间连iot设备和间连商户绑定
+        public string IotBind(string Smid, string DeviceId)
+        {
+            IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
+            AlipayMerchantIndirectIotBindRequest  request = new AlipayMerchantIndirectIotBindRequest() ;
+            request.BizContent="{" +
+            "  \"smid\":\"" + Smid + "\"," +
+            "  \"mode\":\"SDK\"," +
+            "  \"device_id\":\"" + DeviceId + "\"," +
+            "  \"supplier_id\":\"202208101504455785\"" +
+            "}";
+            function.WriteLog(request.BizContent, "间连iot设备和间连商户绑定");
+
+            string result = "";
+            try
+            {
+                AlipayMerchantIndirectIotBindResponse response=client.Execute(request);
+                result = response.Body;
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(ex.ToString(), "间连iot设备和间连商户绑定异常");
+                result = "";
+            }
+            return result;
+        }
+
+        #endregion
+
+        #region 间连iot设备和间连商户解绑
+        public string IotUnBind(string Smid, string DeviceId)
+        {            
+            IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
+            AlipayMerchantIndirectIotUnbindRequest  request= new AlipayMerchantIndirectIotUnbindRequest() ;
+            request.BizContent="{" +
+            "  \"smid\":\"" + Smid + "\"," +
+            "  \"mode\":\"SDK\"," +
+            "  \"device_id\":\"" + DeviceId + "\"," +
+            "  \"supplier_id\":\"202208101504455785\"" +
+            "}";
+            function.WriteLog(request.BizContent, "间连iot设备和间连商户解绑");
+
+            string result = "";
+            try
+            {
+                AlipayMerchantIndirectIotUnbindResponse response=client.Execute(request);
+                result = response.Body;
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(ex.ToString(), "间连iot设备和间连商户解绑异常");
+                result = "";
+            }
+            return result;
+        }
+
+        #endregion
+
+        #region 查询设备基础信息
+        public string IotDeviceQuery(string Sn)
+        {
+            IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
+            AlipayCommerceIotDeviceBaseinfoQueryRequest  request= new AlipayCommerceIotDeviceBaseinfoQueryRequest() ;
+            request.BizContent="{" +
+            "  \"sn\":\"" + Sn + "\"," +
+            "  \"supplier_id\":\"202208101504455785\"" +
+            "}";
+            function.WriteLog(request.BizContent, "查询设备基础信息");
+
+            string result = "";
+            try
+            {
+                AlipayCommerceIotDeviceBaseinfoQueryResponse response=client.Execute(request);
+                result = response.Body;
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(ex.ToString(), "查询设备基础信息异常");
+                result = "";
+            }
+            return result;
+        }
+
+        #endregion
+
+        #region 到账播报
+        public string IotTradeVoice(string BizTid, string Smid, string TradeNo, string Amount, string TradeType = "ALIPAY_TRADE")
+        {
+            IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
+            AlipayCommerceIotDeviceTradevoiceSendRequest  request= new AlipayCommerceIotDeviceTradevoiceSendRequest() ;
+            request.BizContent="{" +
+            "  \"biz_tid\":\"" + BizTid + "\"," +
+            "  \"smid\":\"" + Smid + "\"," +
+            "  \"trade_type\":\"" + TradeType + "\"," +
+            "  \"trade_id\":\"" + TradeNo + "\"," +
+            "  \"amount\":\"" + Amount + "\"" +
+            // "  \"msg_id\":\"202108020001101043\"" +
+            "}";
+            function.WriteLog(request.BizContent, "到账播报");
+
+            string result = "";
+            try
+            {
+                AlipayCommerceIotDeviceTradevoiceSendResponse response=client.Execute(request);
+                result = response.Body;
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(ex.ToString(), "到账播报异常");
+                result = "";
+            }
+            return result;
+        }
+
+        #endregion
+
+        #region 图片上传
+
+        public string UploadPic(string path)
+        {
+            IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
+            string fileName = path.Substring(path.LastIndexOf("/") + 1);
+            string imageBase64 = function.imageToBase64String(function.getPath(path));
+            // imageBase64 = imageBase64.Substring(imageBase64.IndexOf(";base64,") + 8);
+            AntMerchantExpandIndirectImageUploadRequest request = new AntMerchantExpandIndirectImageUploadRequest();
+            FileItem imageContent = new FileItem(fileName,Convert.FromBase64String(imageBase64));
+            request.ImageContent = imageContent;
+            request.ImageType = "jpg";
+            AntMerchantExpandIndirectImageUploadResponse response = client.Execute(request);
+            return fileName;
+        }
+
+        #endregion
+
+
+
+
+
+
+    }
+}

+ 102 - 0
Util/HaoDa/Alipay/Base/AopDictionary.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Collections;
+using Aop.Api.Parser;
+using Newtonsoft.Json;
+
+namespace Aop.Api
+{
+    /// <summary>
+    /// 符合AOP习惯的纯字符串字典结构。
+    /// </summary>
+    public class AopDictionary : Dictionary<string, string>
+    {
+        private const string DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+        public AopDictionary() { }
+
+        public AopDictionary(IDictionary<string, string> dictionary)
+            : base(dictionary)
+        { }
+
+        public void AddAll(Dictionary<string, string> textParams)
+        {
+            foreach (var param in textParams)
+            {
+                this.Add(param.Key, param.Value);
+            }
+        }
+
+        /// <summary>
+        /// 添加一个新的键值对。空键或者空值的键值对将会被忽略。
+        /// </summary>
+        /// <param name="key">键名称</param>
+        /// <param name="value">键对应的值,目前支持:string, int, long, double, bool, DateTime类型</param>
+        public void Add(string key, object value)
+        {
+            string strValue;
+
+            if (value == null)
+            {
+                strValue = null;
+            }
+            else if (value is string)
+            {
+                strValue = (string)value;
+            }
+            else if (value is Nullable<DateTime>)
+            {
+                Nullable<DateTime> dateTime = value as Nullable<DateTime>;
+                strValue = dateTime.Value.ToString(DATE_TIME_FORMAT);
+            }
+            else if (value is Nullable<int>)
+            {
+                strValue = (value as Nullable<int>).Value.ToString();
+            }
+            else if (value is Nullable<long>)
+            {
+                strValue = (value as Nullable<long>).Value.ToString();
+            }
+            else if (value is Nullable<double>)
+            {
+                strValue = (value as Nullable<double>).Value.ToString();
+            }
+            else if (value is Nullable<bool>)
+            {
+                strValue = (value as Nullable<bool>).Value.ToString().ToLower();
+            }
+            else if (value is ICollection)
+            {
+                Aop.Api2.Parser.AopModelParser parser = new Aop.Api2.Parser.AopModelParser();
+                object jo = parser.serializeArrayValue(value as ICollection);
+
+                JsonSerializerSettings jsetting = new JsonSerializerSettings();
+                jsetting.NullValueHandling = NullValueHandling.Ignore;
+                strValue = JsonConvert.SerializeObject(jo, Formatting.None, jsetting);
+            }
+            else if (value is AopObject)
+            {
+                AopModelParser parser = new AopModelParser();
+                object jo = parser.serializeAopObject(value as AopObject);
+
+                JsonSerializerSettings jsetting = new JsonSerializerSettings();
+                jsetting.NullValueHandling = NullValueHandling.Ignore;
+                strValue = JsonConvert.SerializeObject(jo, Formatting.None, jsetting);
+            }
+            else
+            {
+                strValue = value.ToString();
+            }
+
+            this.Add(key, strValue);
+        }
+
+        public new void Add(string key, string value)
+        {
+            if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
+            {
+                base.Add(key, value);
+            }
+        }
+    }
+}

+ 191 - 0
Util/HaoDa/Alipay/Base/AopModelParser.cs

@@ -0,0 +1,191 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Aop.Api;
+using System.Reflection;
+using System.Collections;
+using System.Xml.Serialization;
+using Newtonsoft.Json;
+
+namespace Aop.Api2.Parser
+{
+    public class AopModelParser
+    {
+
+        /// <summary>
+        /// Json序列化AopObject对象
+        /// </summary>
+        /// <param name="res"></param>
+        /// <returns></returns>
+        public IDictionary<object, object> serializeAopObject(AopObject res)
+        {
+            PropertyInfo[] pis = res.GetType().GetProperties();
+            IDictionary<object, object> jo = new Dictionary<object, object>();
+            foreach (PropertyInfo pi in pis)
+            {
+                if (!pi.CanRead)
+                {
+                    continue;
+                }
+
+                String elementName = getElementName(pi);
+                Object value = getPiValue(res, pi);
+                if (!String.IsNullOrEmpty(elementName))
+                {
+                    Object serialized = serializeValue(value);
+                    if (serialized != null)
+                    {
+                        jo[elementName] = serialized;
+                    }
+                }
+            }
+
+            return jo;
+        }
+
+        /// <summary>
+        /// 序列化某个对象
+        /// </summary>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        private Object serializeValue(Object value)
+        {
+            if (value == null)
+            {
+                return null;
+            }
+
+            Object result = null;
+            if (value is IDictionary)
+            {
+                result = serializeDicValue((IDictionary)value);
+            }
+            else if (value is ICollection)
+            {
+                result = serializeArrayValue((ICollection)value);
+            }
+            else
+            {
+                result = serializeElementValue(value);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 序列化一个元素
+        /// </summary>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        private Object serializeElementValue(Object value)
+        {
+            if (value == null)
+            {
+                return null;
+            }
+
+            Object result = null;
+            if (value is AopObject)
+            {
+                result = serializeAopObject((AopObject)value);
+            }
+            else
+            {
+                result = value;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 序列化一个字典
+        /// </summary>
+        /// <param name="dic"></param>
+        /// <returns></returns>
+        private Object serializeDicValue(IDictionary dic)
+        {
+            if (dic == null)
+            {
+                return null;
+            }
+
+            IDictionary<object, object> jo = new Dictionary<object, object>();
+            foreach (String key in dic.Keys)
+            {
+                Object dicValue = dic[key];
+                Object serializedValue = serializeValue(dicValue);
+                jo[key] = serializedValue;
+            }
+            return jo;
+        }
+
+        /// <summary>
+        /// 序列化一个数组
+        /// </summary>
+        /// <param name="collection"></param>
+        /// <returns></returns>
+        public Object serializeArrayValue(ICollection collection)
+        {
+            if (collection == null)
+            {
+                return null;
+            }
+
+            List<object> ja = new List<object>();
+            foreach (var item in collection)
+            {
+                ja.Add(serializeValue(item));
+            }
+            return ja;
+        }
+
+        /// <summary>
+        /// 获取对象的属性值
+        /// </summary>
+        /// <param name="res"></param>
+        /// <param name="pi"></param>
+        /// <returns></returns>
+        private Object getPiValue(Object res, PropertyInfo pi)
+        {
+            if (!pi.CanRead)
+            {
+                return null;
+            }
+
+            Object value = pi.GetValue(res, null);
+            return value;
+        }
+
+        /// <summary>
+        /// 获取Xml属性名
+        /// </summary>
+        /// <param name="pi"></param>
+        /// <returns></returns>
+        private String getElementName(PropertyInfo pi)
+        {
+            if (pi == null)
+            {
+                return null;
+            }
+
+            // 获取XmlElement属性
+            XmlElementAttribute[] xeas = pi.GetCustomAttributes(typeof(XmlElementAttribute), true) as XmlElementAttribute[];
+            String elementName = null;
+            if (xeas != null && xeas.Length > 0)
+            {
+                elementName = xeas[0].ElementName;
+            }
+
+            // 如果获取XmlElement属性为空,则去获取XmlArray属性
+            if (String.IsNullOrEmpty(elementName))
+            {
+                XmlArrayAttribute[] xaas = pi.GetCustomAttributes(typeof(XmlArrayAttribute), true) as XmlArrayAttribute[];
+                if (xaas != null && xaas.Length > 0)
+                {
+                    elementName = xaas[0].ElementName;
+                }
+            }
+            return elementName;
+        }
+
+    }
+}

+ 90 - 0
Util/HaoDa/Alipay/Base/RoyaltyDetail.cs

@@ -0,0 +1,90 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Domain
+{
+    /// <summary>
+    /// RoyaltyDetail Data Structure.
+    /// </summary>
+    [Serializable]
+    public class RoyaltyDetail : AopObject
+    {
+        /// <summary>
+        /// 分账金额
+        /// </summary>
+        [XmlElement("amount")]
+        public string Amount { get; set; }
+
+        /// <summary>
+        /// 支付宝分账明细单号,每笔分账业务执行的明细单号
+        /// </summary>
+        [XmlElement("detail_id")]
+        public string DetailId { get; set; }
+
+        /// <summary>
+        /// 分账失败错误码,只在分账失败时返回
+        /// </summary>
+        [XmlElement("error_code")]
+        public string ErrorCode { get; set; }
+
+        /// <summary>
+        /// 分账错误描述信息
+        /// </summary>
+        [XmlElement("error_desc")]
+        public string ErrorDesc { get; set; }
+
+        /// <summary>
+        /// 分账执行时间
+        /// </summary>
+        [XmlElement("execute_dt")]
+        public string ExecuteDt { get; set; }
+
+        /// <summary>
+        /// 分账操作类型。有以下几种类型: replenish(补差)、replenish_refund(退补差)、transfer(分账)、transfer_refund(退分账)
+        /// </summary>
+        [XmlElement("operation_type")]
+        public string OperationType { get; set; }
+
+        /// <summary>
+        /// 分账状态,SUCCESS成功,FAIL失败,PROCESSING处理中
+        /// </summary>
+        [XmlElement("state")]
+        public string State { get; set; }
+
+        /// <summary>
+        /// 分账转入账号,只有在operation_type为replenish_refund(退补差),transfer(分账)才返回该字段或trans_in_open_id。trans_in_open_id为分账转入方的openId,当trans_in_open_id不为空的时候,请优先使用trans_in_open_id。
+        /// </summary>
+        [XmlElement("trans_in")]
+        public string TransIn { get; set; }
+
+        /// <summary>
+        /// 分账转入方的OpenId,OpenId为用户在该应用下支付宝的唯一用户标识。
+        /// </summary>
+        [XmlElement("trans_in_open_id")]
+        public string TransInOpenId { get; set; }
+
+        /// <summary>
+        /// 分账转入账号类型,userId表示是支付宝账号对应的支付宝唯一用户号,loginName表示是支付宝登录号,secondMerchantID表示是二级商户id。 只有在operation_type为replenish_refund(退补差),transfer(分账)才返回该字段
+        /// </summary>
+        [XmlElement("trans_in_type")]
+        public string TransInType { get; set; }
+
+        /// <summary>
+        /// 分账转出账号,只有在operation_type为replenish(补差),transfer_refund(退分账)类型才返回该字段或trans_out_open_id字段。trans_out_open_id字段为分账转出方的openId,当trans_out_open_id 字段不为空时,请优先使用trans_out_open_id。
+        /// </summary>
+        [XmlElement("trans_out")]
+        public string TransOut { get; set; }
+
+        /// <summary>
+        /// 分账转出方的OpenId,OpenId为用户在该应用下支付宝内的唯一用户标识。
+        /// </summary>
+        [XmlElement("trans_out_open_id")]
+        public string TransOutOpenId { get; set; }
+
+        /// <summary>
+        /// 分账转出账号类型,userId表示是支付宝账号对应的支付宝唯一用户号,loginName表示是支付宝登录号,secondMerchantID表示是二级商户id。 只有在operation_type为replenish(补差),transfer_refund(退分账)类型才返回该字段
+        /// </summary>
+        [XmlElement("trans_out_type")]
+        public string TransOutType { get; set; }
+    }
+}

+ 24 - 0
Util/HaoDa/Alipay/Domain/IndirectAuthOrderFailedReason.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Domain
+{
+    /// <summary>
+    /// IndirectAuthOrderFailedReason Data Structure.
+    /// </summary>
+    [Serializable]
+    public class IndirectAuthOrderFailedReason : AopObject
+    {
+        /// <summary>
+        /// 审核失败字段
+        /// </summary>
+        [XmlElement("fail_param")]
+        public string FailParam { get; set; }
+
+        /// <summary>
+        /// 描述申请单审核失败原因
+        /// </summary>
+        [XmlElement("fail_reason")]
+        public string FailReason { get; set; }
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayCommerceIotDeviceBaseinfoQueryRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.commerce.iot.device.baseinfo.query
+    /// </summary>
+    public class AlipayCommerceIotDeviceBaseinfoQueryRequest : IAopRequest<AlipayCommerceIotDeviceBaseinfoQueryResponse>
+    {
+        /// <summary>
+        /// 查询设备基础信息
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.commerce.iot.device.baseinfo.query";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayCommerceIotDeviceTradevoiceSendRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.commerce.iot.device.tradevoice.send
+    /// </summary>
+    public class AlipayCommerceIotDeviceTradevoiceSendRequest : IAopRequest<AlipayCommerceIotDeviceTradevoiceSendResponse>
+    {
+        /// <summary>
+        /// 到账播报
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.commerce.iot.device.tradevoice.send";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayMerchantIndirectAuthorderCreateRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.merchant.indirect.authorder.create
+    /// </summary>
+    public class AlipayMerchantIndirectAuthorderCreateRequest : IAopRequest<AlipayMerchantIndirectAuthorderCreateResponse>
+    {
+        /// <summary>
+        /// 间连商户意愿确认申请单提交
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.merchant.indirect.authorder.create";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayMerchantIndirectAuthorderQuerystatusRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.merchant.indirect.authorder.querystatus
+    /// </summary>
+    public class AlipayMerchantIndirectAuthorderQuerystatusRequest : IAopRequest<AlipayMerchantIndirectAuthorderQuerystatusResponse>
+    {
+        /// <summary>
+        /// 查询意愿申请单审核结果
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.merchant.indirect.authorder.querystatus";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayMerchantIndirectIotBindRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.merchant.indirect.iot.bind
+    /// </summary>
+    public class AlipayMerchantIndirectIotBindRequest : IAopRequest<AlipayMerchantIndirectIotBindResponse>
+    {
+        /// <summary>
+        /// 间连iot设备和间连商户绑定
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.merchant.indirect.iot.bind";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayMerchantIndirectIotUnbindRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.merchant.indirect.iot.unbind
+    /// </summary>
+    public class AlipayMerchantIndirectIotUnbindRequest : IAopRequest<AlipayMerchantIndirectIotUnbindResponse>
+    {
+        /// <summary>
+        /// 间连iot设备和间连商户解绑
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.merchant.indirect.iot.unbind";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 268 - 0
Util/HaoDa/Alipay/Request/AlipayOpenAgentCommonSignRequest.cs

@@ -0,0 +1,268 @@
+using System;
+using System.Collections.Generic;
+using Aop.Api.Response;
+using Aop.Api.Util;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.open.agent.common.sign
+    /// </summary>
+    public class AlipayOpenAgentCommonSignRequest : IAopUploadRequest<AlipayOpenAgentCommonSignResponse>
+    {
+        /// <summary>
+        /// 支付宝生活号(原服务窗)名称(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写)
+        /// </summary>
+        public string AlipayLifeName { get; set; }
+
+        /// <summary>
+        /// APP demo,格式为.apk;或者应用说明文档, 格式为.doc .docx .pdf格式(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写)
+        /// </summary>
+        public FileItem AppDemo { get; set; }
+
+        /// <summary>
+        /// 商户的APP应用名称(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写)
+        /// </summary>
+        public string AppName { get; set; }
+
+        /// <summary>
+        /// 代商户操作事务编号,通过alipay.open.agent.create接口进行创建。
+        /// </summary>
+        public string BatchNo { get; set; }
+
+        /// <summary>
+        /// 营业执照授权函图片,个体工商户如果使用总公司或其他公司的营业执照认证需上传该授权函图片,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg
+        /// </summary>
+        public FileItem BusinessLicenseAuthPic { get; set; }
+
+        /// <summary>
+        /// 营业执照号码
+        /// </summary>
+        public string BusinessLicenseNo { get; set; }
+
+        /// <summary>
+        /// 营业执照图片。被代创建商户运营主体为个人账户必填,企业账户无需填写。图片最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg。
+        /// </summary>
+        public FileItem BusinessLicensePic { get; set; }
+
+        /// <summary>
+        /// 营业期限
+        /// </summary>
+        public string DateLimitation { get; set; }
+
+        /// <summary>
+        /// 营业期限是否长期有效
+        /// </summary>
+        public Nullable<bool> LongTerm { get; set; }
+
+        /// <summary>
+        /// <a href="https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.59bgD2&treeId=222&articleId=105364&docType=1#s1">商家经营类目</a> 中的“经营类目编码”
+        /// </summary>
+        public string MccCode { get; set; }
+
+        /// <summary>
+        /// isv要代商户签约产品码,产品码是支付宝内部对产品的唯一标识
+        /// </summary>
+        public string ProductCode { get; set; }
+
+        /// <summary>
+        /// 店铺内景图片,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg。
+        /// </summary>
+        public FileItem ShopScenePic { get; set; }
+
+        /// <summary>
+        /// 店铺门头照图片,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg。
+        /// </summary>
+        public FileItem ShopSignBoardPic { get; set; }
+
+        /// <summary>
+        /// 企业特殊资质图片,可参考 <a href="https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.59bgD2&treeId=222&articleId=105364&docType=1#s1">商家经营类目</a> 中的“需要的特殊资质证书”。文件最小为 5KB,最大为5M,图片格式必须为:png、bmp、gif、jpg、jpeg。
+        /// </summary>
+        public FileItem SpecialLicensePic { get; set; }
+
+        /// <summary>
+        /// 网站首页截图,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg
+        /// </summary>
+        public FileItem WebHomeScreenshot { get; set; }
+
+        /// <summary>
+        /// 网站商品页截图,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg
+        /// </summary>
+        public FileItem WebItemScreenshot { get; set; }
+
+        /// <summary>
+        /// 网站支付页截图,最小5KB,最大5M,图片格式必须为:png、bmp、gif、jpg、jpeg
+        /// </summary>
+        public FileItem WebPayScreenshot { get; set; }
+
+        /// <summary>
+        /// 接入网址信息(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写)
+        /// </summary>
+        public List<string> WebSites { get; set; }
+
+        /// <summary>
+        /// 接入网址的授权涵,格式为.doc .docx .pdf格式
+        /// </summary>
+        public FileItem WebSitesLoa { get; set; }
+
+        /// <summary>
+        /// 网站状态,枚举值为:已上线,未上线
+        /// </summary>
+        public string WebStatus { get; set; }
+
+        /// <summary>
+        /// 可以登录此网站的测试账户
+        /// </summary>
+        public string WebTestAccount { get; set; }
+
+        /// <summary>
+        /// 可以登录此网站的账户的密码。对应web_test_account的登录密码
+        /// </summary>
+        public string WebTestAccountPassword { get; set; }
+
+        /// <summary>
+        /// 微信公众号名称(1 app_name、app_demo;2 web_sites;3 alipay_life_name;4 wechat_official_account_name。1、2、3、4至少选择一个填写)
+        /// </summary>
+        public string WechatOfficialAccountName { get; set; }
+
+        #region IAopRequest Members
+		private bool needEncrypt=false;
+		private string apiVersion = "1.0";
+		private string terminalType;
+		private string terminalInfo;
+        private string prodCode;
+		private string notifyUrl;
+        private string returnUrl;
+		private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+    	 public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+		public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+		public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.open.agent.common.sign";
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("alipay_life_name", this.AlipayLifeName);
+            parameters.Add("app_name", this.AppName);
+            parameters.Add("batch_no", this.BatchNo);
+            parameters.Add("business_license_no", this.BusinessLicenseNo);
+            parameters.Add("date_limitation", this.DateLimitation);
+            parameters.Add("long_term", this.LongTerm);
+            parameters.Add("mcc_code", this.MccCode);
+            parameters.Add("product_code", this.ProductCode);
+            parameters.Add("web_sites", this.WebSites);
+            parameters.Add("web_status", this.WebStatus);
+            parameters.Add("web_test_account", this.WebTestAccount);
+            parameters.Add("web_test_account_password", this.WebTestAccountPassword);
+            parameters.Add("wechat_official_account_name", this.WechatOfficialAccountName);
+            if(udfParams != null) 
+            {
+                foreach (string key in this.udfParams.Keys)
+                {
+                    parameters.Add(key, this.udfParams[key]);
+                }
+            }
+            return parameters;
+        }
+		
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+
+        #region IAopUploadRequest Members
+
+        public IDictionary<string, FileItem> GetFileParameters()
+        {
+            IDictionary<string, FileItem> parameters = new Dictionary<string, FileItem>();
+            parameters.Add("app_demo", this.AppDemo);
+            parameters.Add("business_license_auth_pic", this.BusinessLicenseAuthPic);
+            parameters.Add("business_license_pic", this.BusinessLicensePic);
+            parameters.Add("shop_scene_pic", this.ShopScenePic);
+            parameters.Add("shop_sign_board_pic", this.ShopSignBoardPic);
+            parameters.Add("special_license_pic", this.SpecialLicensePic);
+            parameters.Add("web_home_screenshot", this.WebHomeScreenshot);
+            parameters.Add("web_item_screenshot", this.WebItemScreenshot);
+            parameters.Add("web_pay_screenshot", this.WebPayScreenshot);
+            parameters.Add("web_sites_loa", this.WebSitesLoa);
+            return parameters;
+        }
+
+        #endregion
+    }
+}

+ 126 - 0
Util/HaoDa/Alipay/Request/AlipayOpenAgentCommonsignConfirmRequest.cs

@@ -0,0 +1,126 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.open.agent.commonsign.confirm
+    /// </summary>
+    public class AlipayOpenAgentCommonsignConfirmRequest : IAopRequest<AlipayOpenAgentCommonsignConfirmResponse>
+    {
+        /// <summary>
+        /// 代商户签约,提交信息确认接口
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.open.agent.commonsign.confirm";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                foreach (string key in this.udfParams.Keys)
+                {
+                    parameters.Add(key, this.udfParams[key]);
+                }
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayTradeOrderSettleQueryRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.trade.order.settle.query
+    /// </summary>
+    public class AlipayTradeOrderSettleQueryRequest : IAopRequest<AlipayTradeOrderSettleQueryResponse>
+    {
+        /// <summary>
+        /// 交易分账查询接口
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.trade.order.settle.query";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 123 - 0
Util/HaoDa/Alipay/Request/AlipayTradeRoyaltyRelationBindRequest.cs

@@ -0,0 +1,123 @@
+using System;
+using Aop.Api.Domain;
+using System.Collections.Generic;
+using Aop.Api.Response;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: alipay.trade.royalty.relation.bind
+    /// </summary>
+    public class AlipayTradeRoyaltyRelationBindRequest : IAopRequest<AlipayTradeRoyaltyRelationBindResponse>
+    {
+        /// <summary>
+        /// 分账关系绑定
+        /// </summary>
+        public string BizContent { get; set; }
+
+        #region IAopRequest Members
+        private bool  needEncrypt=false;
+        private string apiVersion = "1.0";
+	    private string terminalType;
+	    private string terminalInfo;
+        private string prodCode;
+	    private string notifyUrl;
+        private string returnUrl;
+	    private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+		public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+        public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+        public string GetApiName()
+        {
+            return "alipay.trade.royalty.relation.bind";
+        }
+
+        public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("biz_content", this.BizContent);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+    }
+}

+ 139 - 0
Util/HaoDa/Alipay/Request/AntMerchantExpandIndirectImageUploadRequest.cs

@@ -0,0 +1,139 @@
+using System;
+using System.Collections.Generic;
+using Aop.Api.Response;
+using Aop.Api.Util;
+
+namespace Aop.Api.Request
+{
+    /// <summary>
+    /// AOP API: ant.merchant.expand.indirect.image.upload
+    /// </summary>
+    public class AntMerchantExpandIndirectImageUploadRequest : IAopUploadRequest<AntMerchantExpandIndirectImageUploadResponse>
+    {
+        /// <summary>
+        /// 图片二进制字节流,最大为10M
+        /// </summary>
+        public FileItem ImageContent { get; set; }
+
+        /// <summary>
+        /// 图片格式,支持格式:bmp、jpg、jpeg、png、gif.
+        /// </summary>
+        public string ImageType { get; set; }
+
+        #region IAopRequest Members
+		private bool needEncrypt=false;
+		private string apiVersion = "1.0";
+		private string terminalType;
+		private string terminalInfo;
+        private string prodCode;
+		private string notifyUrl;
+        private string returnUrl;
+		private AopObject bizModel;
+        private Dictionary<string, string> udfParams; //add user-defined text parameters
+
+    	 public void SetNeedEncrypt(bool needEncrypt){
+             this.needEncrypt=needEncrypt;
+        }
+
+        public bool GetNeedEncrypt(){
+
+            return this.needEncrypt;
+        }
+
+		public void SetNotifyUrl(string notifyUrl){
+            this.notifyUrl = notifyUrl;
+        }
+
+        public string GetNotifyUrl(){
+            return this.notifyUrl;
+        }
+
+        public void SetReturnUrl(string returnUrl){
+            this.returnUrl = returnUrl;
+        }
+
+        public string GetReturnUrl(){
+            return this.returnUrl;
+        }
+
+		public void SetTerminalType(String terminalType){
+			this.terminalType=terminalType;
+		}
+
+    	public string GetTerminalType(){
+    		return this.terminalType;
+    	}
+
+    	public void SetTerminalInfo(String terminalInfo){
+    		this.terminalInfo=terminalInfo;
+    	}
+
+    	public string GetTerminalInfo(){
+    		return this.terminalInfo;
+    	}
+
+        public void SetProdCode(String prodCode){
+            this.prodCode=prodCode;
+        }
+
+        public string GetProdCode(){
+            return this.prodCode;
+        }
+
+		public void SetApiVersion(string apiVersion){
+            this.apiVersion=apiVersion;
+        }
+
+        public string GetApiVersion(){
+            return this.apiVersion;
+        }
+
+        public string GetApiName()
+        {
+            return "ant.merchant.expand.indirect.image.upload";
+        }
+
+        public void PutOtherTextParam(string key, string value) 
+        {
+            if(this.udfParams == null) 
+            {
+                this.udfParams = new Dictionary<string, string>();
+            }
+            this.udfParams.Add(key, value);
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            AopDictionary parameters = new AopDictionary();
+            parameters.Add("image_type", this.ImageType);
+            if(udfParams != null) 
+            {
+                parameters.AddAll(this.udfParams);
+            }
+            return parameters;
+        }
+		
+		public AopObject GetBizModel()
+        {
+            return this.bizModel;
+        }
+
+        public void SetBizModel(AopObject bizModel)
+        {
+            this.bizModel = bizModel;
+        }
+
+        #endregion
+
+        #region IAopUploadRequest Members
+
+        public IDictionary<string, FileItem> GetFileParameters()
+        {
+            IDictionary<string, FileItem> parameters = new Dictionary<string, FileItem>();
+            parameters.Add("image_content", this.ImageContent);
+            return parameters;
+        }
+
+        #endregion
+    }
+}

+ 17 - 0
Util/HaoDa/Alipay/Response/AlipayCommerceIotDeviceBaseinfoQueryResponse.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayCommerceIotDeviceBaseinfoQueryResponse.
+    /// </summary>
+    public class AlipayCommerceIotDeviceBaseinfoQueryResponse : AopResponse
+    {
+        /// <summary>
+        /// 设备ID,biztid
+        /// </summary>
+        [XmlElement("device_id")]
+        public string DeviceId { get; set; }
+    }
+}

+ 12 - 0
Util/HaoDa/Alipay/Response/AlipayCommerceIotDeviceTradevoiceSendResponse.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayCommerceIotDeviceTradevoiceSendResponse.
+    /// </summary>
+    public class AlipayCommerceIotDeviceTradevoiceSendResponse : AopResponse
+    {
+    }
+}

+ 23 - 0
Util/HaoDa/Alipay/Response/AlipayMerchantIndirectAuthorderCreateResponse.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayMerchantIndirectAuthorderCreateResponse.
+    /// </summary>
+    public class AlipayMerchantIndirectAuthorderCreateResponse : AopResponse
+    {
+        /// <summary>
+        /// 申请单号
+        /// </summary>
+        [XmlElement("order_no")]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 意愿申请单状态,枚举值:审核中(AUDITING)、待联系人确认(CONTACT_CONFIRM),待法人确认(LEGAL_CONFIRM)、审核通过(AUDIT_PASS)、审核失败(AUDIT_REJECT)、已冻结(AUDIT_FREEZE)、已撤回(CANCELED)、联系人处理中(CONTACT_PROCESSING)
+        /// </summary>
+        [XmlElement("order_status")]
+        public string OrderStatus { get; set; }
+    }
+}

+ 38 - 0
Util/HaoDa/Alipay/Response/AlipayMerchantIndirectAuthorderQuerystatusResponse.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Xml.Serialization;
+using System.Collections.Generic;
+using Aop.Api.Domain;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayMerchantIndirectAuthorderQuerystatusResponse.
+    /// </summary>
+    public class AlipayMerchantIndirectAuthorderQuerystatusResponse : AopResponse
+    {
+        /// <summary>
+        /// 商家认证申请单号
+        /// </summary>
+        [XmlElement("order_no")]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 商家认证申请单状态,枚举值:审核中(AUDITING)、待联系人确认(CONTACT_CONFIRM),待法人确认(LEGAL_CONFIRM)、审核通过(AUDIT_PASS)、审核失败(AUDIT_REJECT)、已冻结(AUDIT_FREEZE)、已撤回(CANCELED)、联系人处理中(CONTACT_PROCESSING)
+        /// </summary>
+        [XmlElement("order_status")]
+        public string OrderStatus { get; set; }
+
+        /// <summary>
+        /// 商家认证小程序二维码图片链接,申请单状态处于审核通过、待联系人确认、待法人确认、已冻结、审核失败时返回,商户使用支付宝APP扫码后完成后续确认、修改信息等动作。 此字段是平台生成并返回的二维码码值,通过浏览器访问即可获得一个二维码的图片。服务商在推广过程中,可引导商家使用支付宝APP扫描此二维码,进入认证申请单页面,完成认证申请的后续确认操作。
+        /// </summary>
+        [XmlElement("qr_code")]
+        public string QrCode { get; set; }
+
+        /// <summary>
+        /// 申请单审核失败时的原因描述列表
+        /// </summary>
+        [XmlArray("verify_list")]
+        [XmlArrayItem("indirect_auth_order_failed_reason")]
+        public List<IndirectAuthOrderFailedReason> VerifyList { get; set; }
+    }
+}

+ 12 - 0
Util/HaoDa/Alipay/Response/AlipayMerchantIndirectIotBindResponse.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayMerchantIndirectIotBindResponse.
+    /// </summary>
+    public class AlipayMerchantIndirectIotBindResponse : AopResponse
+    {
+    }
+}

+ 12 - 0
Util/HaoDa/Alipay/Response/AlipayMerchantIndirectIotUnbindResponse.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayMerchantIndirectIotUnbindResponse.
+    /// </summary>
+    public class AlipayMerchantIndirectIotUnbindResponse : AopResponse
+    {
+    }
+}

+ 12 - 0
Util/HaoDa/Alipay/Response/AlipayOpenAgentCommonSignResponse.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayOpenAgentCommonSignResponse.
+    /// </summary>
+    public class AlipayOpenAgentCommonSignResponse : AopResponse
+    {
+    }
+}

+ 17 - 0
Util/HaoDa/Alipay/Response/AlipayOpenAgentCommonsignConfirmResponse.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayOpenAgentCommonsignConfirmResponse.
+    /// </summary>
+    public class AlipayOpenAgentCommonsignConfirmResponse : AopResponse
+    {
+        /// <summary>
+        /// 签约单号
+        /// </summary>
+        [XmlElement("order_no")]
+        public string OrderNo { get; set; }
+    }
+}

+ 32 - 0
Util/HaoDa/Alipay/Response/AlipayTradeOrderSettleQueryResponse.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Xml.Serialization;
+using System.Collections.Generic;
+using Aop.Api.Domain;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayTradeOrderSettleQueryResponse.
+    /// </summary>
+    public class AlipayTradeOrderSettleQueryResponse : AopResponse
+    {
+        /// <summary>
+        /// 分账受理时间
+        /// </summary>
+        [XmlElement("operation_dt")]
+        public string OperationDt { get; set; }
+
+        /// <summary>
+        /// 商户分账请求单号
+        /// </summary>
+        [XmlElement("out_request_no")]
+        public string OutRequestNo { get; set; }
+
+        /// <summary>
+        /// 分账明细
+        /// </summary>
+        [XmlArray("royalty_detail_list")]
+        [XmlArrayItem("royalty_detail")]
+        public List<RoyaltyDetail> RoyaltyDetailList { get; set; }
+    }
+}

+ 17 - 0
Util/HaoDa/Alipay/Response/AlipayTradeRoyaltyRelationBindResponse.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AlipayTradeRoyaltyRelationBindResponse.
+    /// </summary>
+    public class AlipayTradeRoyaltyRelationBindResponse : AopResponse
+    {
+        /// <summary>
+        /// SUCCESS:分账关系绑定成功; FAIL:分账关系绑定失败。
+        /// </summary>
+        [XmlElement("result_code")]
+        public string ResultCode { get; set; }
+    }
+}

+ 17 - 0
Util/HaoDa/Alipay/Response/AntMerchantExpandIndirectImageUploadResponse.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Xml.Serialization;
+
+namespace Aop.Api.Response
+{
+    /// <summary>
+    /// AntMerchantExpandIndirectImageUploadResponse.
+    /// </summary>
+    public class AntMerchantExpandIndirectImageUploadResponse : AopResponse
+    {
+        /// <summary>
+        /// 图片在文件存储平台的标识
+        /// </summary>
+        [XmlElement("image_id")]
+        public string ImageId { get; set; }
+    }
+}