From 54609d1ec05ba402d74544e06063d38a51b07198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 30 Nov 2023 09:44:51 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs | 220 ++++++++++++++++ .../WxaAPIs/Sec/SecJson/AuthData.cs | 240 ++++++++++++++++++ .../Sec/SecJson/AuthIdentityTreeResultJson.cs | 66 +++++ .../Sec/SecJson/QueryAuthResultJson.cs | 47 ++++ .../WxaAPIs/Sec/SecJson/ReauthResultJson.cs | 51 ++++ .../SecJson/UploadAuthMaterialResultJson.cs | 51 ++++ .../WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs | 51 ++++ 7 files changed, 726 insertions(+) create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs new file mode 100644 index 0000000000..f0f3648223 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs @@ -0,0 +1,220 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:SecApi.cs + 文件功能描述:小程序微信认证 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +//文档:https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_wxaauth.html + +using Senparc.CO2NET.Extensions; +using Senparc.CO2NET.HttpUtility; +using Senparc.NeuChar; +using Senparc.Weixin.CommonAPIs; +using Senparc.Weixin.Open.WxaAPIs.Sec; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.WxaAPIs +{ + /// + /// 小程序微信认证 + /// + [NcApiBind(NeuChar.PlatformType.WeChat_Open, true)] + public class SecApi + { + #region 同步方法 + /// + /// 小程序认证 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_wxaauth.html + /// + /// + /// + /// + /// + public static WxaAuthResultJson WxaAuth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/wxaauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + auth_data + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 小程序认证进度查询 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_queryauth.html + /// + /// + /// + /// + /// + public static QueryAuthResultJson QueryAuth(string accessToken, string taskid, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/queryauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + taskid + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 小程序认证上传补充材料 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_uploadauthmaterial.html + /// + /// + /// 图片(image): 不超过2M,支持PNG\JPEG\JPG\GIF格式 + /// + /// + public static UploadAuthMaterialResultJson UploadAuthMaterial(string accessToken, string file, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/uploadauthmaterial?access_token={0}", accessToken.AsUrlData()); + var fileDictionary = new Dictionary(); + fileDictionary["media"] = file; + return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); + } + + /// + /// 小程序认证重新提审 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_reauth.html + /// + /// + /// 认证数据 + /// + /// + public static ReauthResultJson Reauth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/reauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + auth_data + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询个人认证身份选项列表 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_authidentitytree.html + /// + /// + /// + /// + public static AuthIdentityTreeResultJson AuthIdentityTree(string accessToken, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/authidentitytree?access_token={0}", accessToken.AsUrlData()); + return CommonJsonSend.Send(null, url, null, CommonJsonSendType.POST, timeOut); + } + #endregion + + #region 异步方法 + /// + /// 小程序认证 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_wxaauth.html + /// + /// + /// + /// + /// + public static async Task WxaAuthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/wxaauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + auth_data + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 小程序认证进度查询 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_queryauth.html + /// + /// + /// + /// + /// + public static async Task QueryAuthAsync(string accessToken, string taskid, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/queryauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + taskid + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 小程序认证上传补充材料 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_uploadauthmaterial.html + /// + /// + /// 图片(image): 不超过2M,支持PNG\JPEG\JPG\GIF格式 + /// + /// + public static async Task UploadAuthMaterialAsync(string accessToken, string file, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/uploadauthmaterial?access_token={0}", accessToken.AsUrlData()); + var fileDictionary = new Dictionary(); + fileDictionary["media"] = file; + return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); + } + + /// + /// 小程序认证重新提审 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_reauth.html + /// + /// + /// 认证数据 + /// + /// + public static async Task ReauthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/reauth?access_token={0}", accessToken.AsUrlData()); + var data = new + { + auth_data + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询个人认证身份选项列表 + /// https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/weapp-wxverify/secwxaapi_authidentitytree.html + /// + /// + /// + /// + public static async Task AuthIdentityTreeAsync(string accessToken, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/wxa/sec/authidentitytree?access_token={0}", accessToken.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.POST, timeOut); + } + #endregion + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthData.cs new file mode 100644 index 0000000000..a755a02062 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthData.cs @@ -0,0 +1,240 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:WxaAuth.cs + 文件功能描述:小程序认证 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 认证数据 + /// + public class AuthData + { + /// + /// 企业为1,个体工商户 为12,个人是15,详情参考: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/basic-info-management/getAccountBasicInfo.html#%E8%B0%83%E7%94%A8%E6%96%B9%E5%BC%8F + /// + public int customer_type { get; set; } + + /// + /// 认证任务id,打回重审调用reauth时为必填 + /// + public string taskid { get; set; } + + /// + /// 联系人信息 + /// + public WxaAuthAuthData_ContactInfo contact_info { get; set; } + + /// + /// 发票信息,如果是服务商代缴模式,不需要改参数 + /// + public WxaAuthAuthData_InvoiceInfo invoice_info { get; set; } + + /// + /// 非个人类型必填。主体资质材料 media_id 支持jpg,jpeg .bmp.gif .png格式,仅支持一张图片 + /// + public string qualification { get; set; } + + /// + /// 主体资质其他证明材料 media_id 支持jpg,jpeg .bmp.gif .png格式,最多上传10张图片 + /// + public List qualification_other { get; set; } + + /// + /// 小程序账号名称 + /// + public string account_name { get; set; } + + /// + /// 小程序账号名称命名类型 1:基于自选词汇命名 2:基于商标命名 + /// + public int account_name_type { get; set; } + + /// + /// 名称命中关键词-补充材料 media_id 支持jpg,jpeg .bmp.gif .png格式,支持上传多张图片 + /// + public List account_supplemental { get; set; } + + /// + /// 支付方式 1:消耗服务商预购包 2:小程序开发者自行支付 + /// + public int pay_type { get; set; } + + /// + /// 认证类型为个人类型时可以选择要认证的身份,从/wxa/sec/authidentitytree 里获取,填叶节点的name + /// + public string auth_identification { get; set; } + + /// + /// 填了auth_identification则必填。身份证明材料 media_id (1)基于不同认证身份上传不同的材料;(2)认证类型=1时选填,支持上传10张图片(3)支持jpg,jpeg .bmp.gif .png格式 + /// + public List auth_ident_material { get; set; } + + /// + /// 第三方联系电话 + /// + public string third_party_phone { get; set; } + + /// + /// 选择服务商代缴模式时必填。服务市场appid,该服务市场账号主体必须与服务商账号主体一致 + /// + public string service_appid { get; set; } + } + + /// + /// 联系人信息 + /// + public class WxaAuthAuthData_ContactInfo + { + /// + /// 认证联系人姓名 + /// + public string name { get; set; } + + /// + /// 认证联系人邮箱 + /// + public string email { get; set; } + } + + /// + /// 发票信息,如果是服务商代缴模式,不需要改参数 + /// + public class WxaAuthAuthData_InvoiceInfo + { + /// + /// 发票类型 1: 不开发票 2: 电子发票 3: 增值税专票 + /// + public int invoice_type { get; set; } + + /// + /// 发票类型=2时必填 电子发票开票信息 + /// + public WxaAuthAuthData_InvoiceInfo_Electronic electronic { get; set; } + + /// + /// 发票类型=3时必填 增值税专票开票信息 + /// + public WxaAuthAuthData_InvoiceInfo_Vat vat { get; set; } + + /// + /// 发票抬头,需要和认证主体名称一样 + /// + public string invoice_title { get; set; } + } + + /// + /// 发票类型=2时必填 电子发票开票信息 + /// + public class WxaAuthAuthData_InvoiceInfo_Electronic + { + /// + /// 纳税识别号(15位、17、18或20位) + /// + public string id { get; set; } + + /// + /// 发票备注(选填) + /// + public string desc { get; set; } + } + + /// + /// 发票类型=3时必填 增值税专票开票信息 + /// + public class WxaAuthAuthData_InvoiceInfo_Vat + { + /// + /// 企业电话 + /// + public string enterprise_phone { get; set; } + + /// + /// 纳税识别号(15位、17、18或20位) + /// + public string id { get; set; } + + /// + /// 企业注册地址 + /// + public string enterprise_address { get; set; } + + /// + /// 企业开户银行 + /// + public string bank_name { get; set; } + + /// + /// 企业银行账号 + /// + public string bank_account { get; set; } + + /// + /// 发票邮寄地址邮编 + /// + public string mailing_address { get; set; } + + /// + /// 街道地址 + /// + public string address { get; set; } + + /// + /// 联系人 + /// + public string name { get; set; } + + /// + /// 联系电话 + /// + public string phone { get; set; } + + /// + /// 省份 + /// + public string province { get; set; } + + /// + /// 城市 + /// + public string city { get; set; } + + /// + /// 县区 + /// + public string district { get; set; } + + /// + /// 发票备注(选填) + /// + public string desc { get; set; } + } +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs new file mode 100644 index 0000000000..d1587ea3dc --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs @@ -0,0 +1,66 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:AuthIdentityTreeResultJson.cs + 文件功能描述:查询个人认证身份选项列表 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using Senparc.Weixin.Entities; +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 查询个人认证身份选项列表 + /// + public class AuthIdentityTreeResultJson : WxJsonResult + { + /// + /// + /// + public List identity_tree_list { get; set; } + } + + public class AuthIdentityTreeNode + { + /// + /// + /// + public string name { get; set; } + + /// + /// + /// + public int node_id { get; set; } + + /// + /// + /// + public List node_list { get; set; } + } + +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs new file mode 100644 index 0000000000..a7b6c9966d --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs @@ -0,0 +1,47 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:QueryAuthResultJson.cs + 文件功能描述:小程序认证进度查询 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using Senparc.Weixin.Entities; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 小程序认证进度查询 + /// + public class QueryAuthResultJson : WxJsonResult + { + /// + /// 当前任务流程的状态码: + /// 0: 初始状态 1: 任务超时, 24小时内有效 2: 用户授权拒绝 3: 用户授权同意 4: 发起人脸流程 5: 人脸认证失败 6: 人脸认证ok 7: 人脸认证后,已经提交手机号码下发验证码 8: 手机验证失败 9: 手机验证成功 11: 创建认证审核单失败 12: 创建认证审核审核单成功 14: 验证失败 15: 等待支付 | | auth_url | string | 小程序管理员授权链接 | | apply_status | number | 审核单状态,创建认证审核审核单成功后该值有效。 0:审核单不存在 1:待支付 2:审核中 3:打回重填 4:认证通过 5:认证最终失败(不能再修改) | | orderid | number | 小程序后台展示的认证订单号 | | appid | string | 小程序appid | | refill_reason | string | 当审核单被打回重填(apply_status=3)时有效 | | fail_reason | string | 审核最终失败的原因(apply_status=5)时有效 | + /// + public int task_status { get; set; } + } +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs new file mode 100644 index 0000000000..8f621faff3 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs @@ -0,0 +1,51 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:ReauthResultJson.cs + 文件功能描述:小程序认证重新提审 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using Senparc.Weixin.Entities; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 小程序认证重新提审 + /// + public class ReauthResultJson : WxJsonResult + { + /// + /// 认证任务id + /// + public string taskid { get; set; } + + /// + /// 小程序管理员授权链接 + /// + public string auth_url { get; set; } + } +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs new file mode 100644 index 0000000000..28a1db15c7 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs @@ -0,0 +1,51 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:UploadAuthMaterialResultJson.cs + 文件功能描述:小程序认证上传补充材料 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using Senparc.Weixin.Entities; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 小程序认证上传补充材料 + /// + public class UploadAuthMaterialResultJson : WxJsonResult + { + /// + /// 类型 + /// + public string type { get; set; } + + /// + /// 媒体id + /// + public string mediaid { get; set; } + } +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs new file mode 100644 index 0000000000..e92198370d --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs @@ -0,0 +1,51 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:WxaAuthResultJson.cs + 文件功能描述:小程序认证 + + + 创建标识:Yaofeng - 20231130 + +----------------------------------------------------------------*/ + +using Senparc.Weixin.Entities; + +namespace Senparc.Weixin.Open.WxaAPIs.Sec +{ + /// + /// 小程序认证 + /// + public class WxaAuthResultJson : WxJsonResult + { + /// + /// 认证任务id + /// + public string taskid { get; set; } + + /// + /// 小程序管理员授权链接 + /// + public string auth_url { get; set; } + } +} \ No newline at end of file From a129955098bc84196b065ab2f16af7d8d631b59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 30 Nov 2023 10:39:23 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.Open/XPayAPIs/XPayApi.cs | 204 ++++++++++++++++++ .../XPayJson/CancelCurrencyPayJsonResult.cs | 20 ++ .../XPayJson/CancelCurrencyPayRequestData.cs | 49 +++++ .../XPayJson/CreateWithdrawOrderJsonResult.cs | 25 +++ .../CreateWithdrawOrderRequestData.cs | 29 +++ .../XPayJson/CurrencyPayJsonResult.cs | 30 +++ .../XPayJson/CurrencyPayRequestData.cs | 54 +++++ .../XPayJson/DownloadBillJsonResult.cs | 20 ++ .../XPayJson/NotifyProvideGoodsRequestData.cs | 29 +++ .../XPayAPIs/XPayJson/QueryOrderJsonResult.cs | 107 +++++++++ .../XPayJson/QueryOrderRequestData.cs | 34 +++ .../XPayJson/QueryUserBalanceJsonResult.cs | 50 +++++ .../XPayJson/QueryUserBalanceRequestData.cs | 29 +++ .../XPayJson/QueryWithdrawOrderJsonResult.cs | 50 +++++ .../XPayJson/QueryWithdrawOrderRequestData.cs | 24 +++ .../XPayJson/RefundOrderJsonResult.cs | 35 +++ .../XPayJson/RefundOrderRequestData.cs | 64 ++++++ .../XPayJson/StartUploadGoodsRequestData.cs | 51 +++++ 18 files changed, 904 insertions(+) create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs new file mode 100644 index 0000000000..333488cc9f --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs @@ -0,0 +1,204 @@ +#region Apache License Version 2.0 +/*---------------------------------------------------------------- + +Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the specific language governing permissions +and limitations under the License. + +Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md + +----------------------------------------------------------------*/ +#endregion Apache License Version 2.0 + +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:XPayApi.cs + 文件功能描述:小程序虚拟支付 + + + 创建标识:Yaofeng - 20231130 +----------------------------------------------------------------*/ + +using Senparc.CO2NET.Extensions; +using Senparc.NeuChar; +using Senparc.Weixin.CommonAPIs; +using Senparc.Weixin.Entities; +using Senparc.Weixin.Open.WxaAPIs.SecOrder; +using Senparc.Weixin.Open.XPayAPIs.XPayJson; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs +{ + /// + /// 小程序虚拟支付 + /// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html#_2-3-%E6%9C%8D%E5%8A%A1%E5%99%A8API + /// + [NcApiBind(NeuChar.PlatformType.WeChat_Open, true)] + public class XPayApi + { + #region 同步方法 + /// + /// 查询用户代币余额 + /// + /// + /// + /// 用户的openid + /// 0-正式环境 1-沙箱环境 + /// 用户ip,例如:1.1.1.1 + /// + /// + public static QueryUserBalanceJsonResult QueryUserBalance(string accessToken, string pay_sig, QueryUserBalanceRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_user_balance?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 扣减代币(一般用于代币支付) + /// + /// + /// + /// 签名 + /// 请求参数 + /// + /// + public static CurrencyPayJsonResult CurrencyPay(string accessToken, string pay_sig, string signature, CurrencyPayRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/currency_pay?access_token={0}&pay_sig={1}&signature={2}", accessToken.AsUrlData(), pay_sig.AsUrlData(), signature.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询创建的订单(现金单,非代币单) + /// + /// + /// + /// 请求参数 + /// + /// + public static QueryOrderJsonResult QueryOrder(string accessToken, string pay_sig, QueryOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 代币支付退款(currency_pay接口的逆操作) + /// + /// + /// + /// 请求参数 + /// + /// + public static CancelCurrencyPayJsonResult CancelCurrencyPay(string accessToken, string pay_sig, CancelCurrencyPayRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/cancel_currency_pay?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 通知已经发货完成(只能通知现金单),正常通过xpay_goods_deliver_notify消息推送返回成功就不需要调用这个api接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态 + /// + /// + /// + /// 请求参数 + /// + /// + public static WxJsonResult NotifyProvideGoods(string accessToken, string pay_sig, NotifyProvideGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/notify_provide_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 用于下载小程序账单,第一次调用触发生成下载url,可以间隔轮训来获取最终生成的下载url + /// + /// + /// + /// 起始时间(如20230801) + /// 截止时间(如20230810) + /// + /// + public static DownloadBillJsonResult DownloadBill(string accessToken, string pay_sig, long begin_ds, long end_ds, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/download_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + begin_ds, + end_ds + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 对使用jsapi接口下的单进行退款,此接口只是启动退款任务成功,启动后需要调用query_order接口来查询退款单状态,等状态变成退款完成后即为最终成功 + /// + /// + /// + /// 请求参数 + /// + /// + public static RefundOrderJsonResult RefundOrder(string accessToken, string pay_sig, RefundOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/refund_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 创建提现单 + /// + /// + /// + /// 请求参数 + /// + /// + public static CreateWithdrawOrderJsonResult CreateWithdrawOrder(string accessToken, string pay_sig, CreateWithdrawOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_withdraw_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询提现单 + /// + /// + /// + /// 请求参数 + /// + /// + public static QueryWithdrawOrderJsonResult QueryWithdrawOrder(string accessToken, string pay_sig, QueryWithdrawOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_withdraw_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 启动批量上传道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static WxJsonResult StartUploadGoods(string accessToken, string pay_sig, StartUploadGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/start_upload_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + #endregion + + #region 异步方法 + + #endregion + } +} \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs new file mode 100644 index 0000000000..76173fee29 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs @@ -0,0 +1,20 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 代币支付退款(currency_pay接口的逆操作) + /// + public class CancelCurrencyPayJsonResult : WxJsonResult + { + /// + /// 订单号 + /// + public string order_id { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs new file mode 100644 index 0000000000..83c0bccde9 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 代币支付退款(currency_pay接口的逆操作) + /// + public class CancelCurrencyPayRequestData + { + /// + /// 用户的openid + /// + public string openid { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + + /// + /// 用户ip,例如:1.1.1.1 + /// + public string user_ip { get; set; } + + /// + /// 代币支付(调用currency_pay接口时)时传的order_id + /// + public string pay_order_id { get; set; } + + /// + /// 本次退款单的单号 + /// + public string order_id { get; set; } + + /// + /// 退款金额 + /// + public int amount { get; set; } + + /// + /// 平台类型1-安卓 2-苹果 + /// + public int device_type { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs new file mode 100644 index 0000000000..27c0951537 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs @@ -0,0 +1,25 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class CreateWithdrawOrderJsonResult : WxJsonResult + { + /// + /// 提现单号 + /// + public string withdraw_no { get; set; } + + /// + /// 提现单的微信侧单号 + /// + public string wx_withdraw_no { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs new file mode 100644 index 0000000000..36fc8c0573 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 创建提现单 + /// + public class CreateWithdrawOrderRequestData + { + /// + /// 提现单单号,长度为[8,32],字符只允许使用字母、数字、'_'、'-' + /// + public string withdraw_no { get; set; } + + /// + /// 提现的金额,单位元,例如提现1分钱请使用0.01,允许不传,不传的情况下表示全额提现 + /// + public string withdraw_amount { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs new file mode 100644 index 0000000000..68fee1448a --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs @@ -0,0 +1,30 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 扣减代币(一般用于代币支付) + /// + public class CurrencyPayJsonResult : WxJsonResult + { + /// + /// 订单号 + /// + public string order_id { get; set; } + + /// + /// 总余额,包括有价和赠送部分 + /// + public int balance { get; set; } + + /// + /// 使用赠送部分的代币数量 + /// + public int used_present_amount { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs new file mode 100644 index 0000000000..df19d890a0 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 扣减代币(一般用于代币支付) + /// + public class CurrencyPayRequestData + { + /// + /// 用户的openid + /// + public string openid { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + + /// + /// 用户ip,例如:1.1.1.1 + /// + public string user_ip { get; set; } + + /// + /// 支付的代币数量 + /// + public int amount { get; set; } + + /// + /// 订单号 + /// + public string order_id { get; set; } + + /// + /// 物品信息。记录到账户流水中。如:[{"productid":"物品id", "unit_price": 单价, "quantity": 数量}] + /// + public string payitem { get; set; } + + /// + /// 备注 + /// + public string remark { get; set; } + + /// + /// 平台类型1-安卓 2-苹果 + /// + public int device_type { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs new file mode 100644 index 0000000000..379a2ff496 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs @@ -0,0 +1,20 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class DownloadBillJsonResult : WxJsonResult + { + /// + /// 下载地址 + /// + public string url { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs new file mode 100644 index 0000000000..b869638b96 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 通知已经发货完成(只能通知现金单),正常通过xpay_goods_deliver_notify消息推送返回成功就不需要调用这个api接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态 + /// + public class NotifyProvideGoodsRequestData + { + /// + /// 下单时传的单号 + /// + public string order_id { get; set; } + + /// + /// 微信内部单号(与order_id二选一) + /// + public string wx_order_id { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs new file mode 100644 index 0000000000..344283b4e2 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs @@ -0,0 +1,107 @@ +using Senparc.Weixin.Entities; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryOrderJsonResult : WxJsonResult + { + /// + /// 订单信息 + /// + public Order order { get; set; } + } + + /// + /// 订单信息 + /// + public class Order + { + /// + /// 订单号 + /// + public string order_id { get; set; } + /// + /// 创建时间 + /// + public long create_time { get; set; } + /// + /// 更新时间 + /// + public long update_time { get; set; } + /// + /// 当前状态 0-订单初始化(未创建成功,不可用于支付)1-订单创建成功 2-订单已经支付,待发货 3-订单发货中 4-订单已发货 5-订单已经退款 6-订单已经关闭(不可再使用) 7-订单退款失败 8-用户退款完成 9-回收广告金完成 10-分账回退完成 + /// + public int status { get; set; } + /// + /// 业务类型0-短剧 + /// + public int biz_type { get; set; } + /// + /// 订单金额,单位分 + /// + public int order_fee { get; set; } + /// + /// 订单优惠金额,单位分(暂无此字段) + /// + public int coupon_fee { get; set; } + /// + /// 用户支付金额 + /// + public int paid_fee { get; set; } + /// + /// 订单类型0-支付单 1-退款单 + /// + public int order_type { get; set; } + /// + /// 当类型为退款单时表示退款金额,单位分 + /// + public int refund_fee { get; set; } + /// + /// 支付/退款时间,unix秒级时间戳 + /// + public long paid_time { get; set; } + /// + /// 发货时间 + /// + public long provide_time { get; set; } + /// + /// 订单创建时传的信息 + /// + public string biz_meta { get; set; } + /// + /// 环境类型1-现网 2-沙箱 + /// + public int env_type { get; set; } + /// + /// 下单时米大师返回的token + /// + public string token { get; set; } + /// + /// 支付单类型时表示此单经过退款还剩余的金额,单位分 + /// + public int left_fee { get; set; } + /// + /// 微信内部单号 + /// + public string wx_order_id { get; set; } + /// + /// 渠道单号,为用户微信支付详情页面上的商户单号 + /// + public string channel_order_id { get; set; } + /// + /// 微信支付交易单号,为用户微信支付详情页面上的交易单号 + /// + public string wxpay_order_id { get; set; } + /// + /// 结算时间的秒级时间戳,大于0表示结算成功 + /// + public long sett_time { get; set; } + /// + /// 结算状态0-未开始结算 1-结算中 2-结算成功 + /// + public int sett_state { get; set; } + + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs new file mode 100644 index 0000000000..f98de1c342 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询创建的订单(现金单,非代币单) + /// + public class QueryOrderRequestData + { + /// + /// 用户的openid + /// + public string openid { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + + /// + /// 创建的订单号 + /// + public string order_id { get; set; } + + /// + /// 微信内部单号(与order_id二选一) + /// + public string wx_order_id { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs new file mode 100644 index 0000000000..0f78c07178 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs @@ -0,0 +1,50 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryUserBalanceJsonResult : WxJsonResult + { + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int balance { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int present_balance { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int sum_save { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int sum_present { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int sum_balance { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int sum_cost { get; set; } + + /// + /// 代币总余额,包括有价和赠送部分 + /// + public int first_save_flag { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs new file mode 100644 index 0000000000..6938489bd4 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询用户代币余额 + /// + public class QueryUserBalanceRequestData + { + /// + /// 用户的openid + /// + public string openid { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + + /// + /// 用户ip,例如:1.1.1.1 + /// + public string user_ip { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs new file mode 100644 index 0000000000..137accac88 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs @@ -0,0 +1,50 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryWithdrawOrderJsonResult : WxJsonResult + { + /// + /// 提现单号 + /// + public string withdraw_no { get; set; } + + /// + /// 提现单的微信侧单号1-创建成功,提现中 2-提现成功 3-提现失败 + /// + public int status { get; set; } + + /// + /// 提现金额 + /// + public string withdraw_amount { get; set; } + + /// + /// 提现单的微信侧单号 + /// + public string wx_withdraw_no { get; set; } + + /// + /// 提现单成功的秒级时间戳 + /// + public string withdraw_success_timestamp { get; set; } + + /// + /// 提现单创建时间 + /// + public string create_time { get; set; } + + /// + /// 提现失败的原因 + /// + public string fail_reason { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs new file mode 100644 index 0000000000..1f97f41fb9 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询提现单 + /// + public class QueryWithdrawOrderRequestData + { + /// + /// 提现单单号,长度为[8,32],字符只允许使用字母、数字、'_'、'-' + /// + public string withdraw_no { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs new file mode 100644 index 0000000000..5fb7b9e34d --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs @@ -0,0 +1,35 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class RefundOrderJsonResult : WxJsonResult + { + /// + /// 退款单号 + /// + public string refund_order_id { get; set; } + + /// + /// 退款单的微信侧单号 + /// + public string refund_wx_order_id { get; set; } + + /// + /// 该退款单对应的支付单单号 + /// + public string pay_order_id { get; set; } + + /// + /// 该退款单对应的支付单微信侧单号 + /// + public string pay_wx_order_id { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs new file mode 100644 index 0000000000..e2da38a2b1 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 对使用jsapi接口下的单进行退款,此接口只是启动退款任务成功,启动后需要调用query_order接口来查询退款单状态,等状态变成退款完成后即为最终成功 + /// + public class RefundOrderRequestData + { + /// + /// 下单时的用户openid + /// + public string openid { get; set; } + + /// + /// 下单时的单号,即jsapi接口传入的OutTradeNo,与wx_order_id字段二选一 + /// + public string order_id { get; set; } + + /// + /// 支付单对应的微信侧单号,与order_id字段二选一 + /// + public string wx_order_id { get; set; } + + /// + /// 本次退款时需要传的单号,长度为[8,32],字符只允许使用字母、数字、'_'、'-' + /// + public string refund_order_id { get; set; } + + /// + /// 当前单剩余可退金额,单位分,可以通过调用query_order接口查到 + /// + public int left_fee { get; set; } + + /// + /// 本次退款金额,单位分,需要(0,left_fee] + /// + public int refund_fee { get; set; } + + /// + /// 商家自定义数据,传入后可在query_order接口查询时原样返回,长度需要[0,1024] + /// + public string biz_meta { get; set; } + + /// + /// 退款原因,当前仅支持以下值 0-暂无描述 1-产品问题,影响使用或效果不佳 2-售后问题,无法满足需求 3-意愿问题,用户主动退款 4-价格问题 5:其他原因 + /// + public string refund_reason { get; set; } + + /// + /// 退款来源,当前仅支持以下值 1-人工客服退款,即用户电话给客服,由客服发起退款流程 2-用户自己发起退款流程 3-其它 + /// + public string req_from { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs new file mode 100644 index 0000000000..26d07e2466 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 启动批量上传道具任务 + /// + public class StartUploadGoodsRequestData + { + /// + /// 上传的商品列表 + /// + public List upload_item { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } + + /// + /// 上传的商品列表 + /// + public class StartUploadGoodsItem + { + /// + /// 道具id,长度(0,64],字符只允许使用字母、数字、'_'、'-' + /// + public string id { get; set; } + + /// + /// 道具名称,长度(0,1024] + /// + public string name { get; set; } + + /// + /// 道具单价,单位分,需要大于0 + /// + public int price { get; set; } + + /// + /// 道具备注,长度(0,1024] + /// + public string remark { get; set; } + + /// + /// 道具图片的url地址,当前仅支持jpg,png等格式 + /// + public string item_url { get; set; } + } +} From 8c47b3f967c94dd2256a7fcab3991669907213a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 30 Nov 2023 10:41:39 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84JsonResult=E7=B1=BB=E5=90=8D=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxaAPIs/SearchStatus/SearchStatusApi.cs | 8 ++-- ...son.cs => GetWxaSearchStatusJsonResult.cs} | 2 +- .../Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs | 40 +++++++++---------- ...tJson.cs => AuthIdentityTreeJsonResult.cs} | 2 +- ...thResultJson.cs => QueryAuthJsonResult.cs} | 2 +- ...eauthResultJson.cs => ReauthJsonResult.cs} | 2 +- ...son.cs => UploadAuthMaterialJsonResult.cs} | 2 +- ...AuthResultJson.cs => WxaAuthJsonResult.cs} | 2 +- .../WxaAPIs/SecOrder/SecOrderApi.cs | 24 +++++------ ...derResultJson.cs => GetOrderJsonResult.cs} | 2 +- ...esultJson.cs => GetOrderListJsonResult.cs} | 2 +- ...ultJson.cs => IsTradeManagedJsonResult.cs} | 2 +- .../SetWebViewDomain/SetWebViewDomainApi.cs | 8 ++-- ...tJson.cs => SetWebViewDomainJsonResult.cs} | 2 +- 14 files changed, 50 insertions(+), 50 deletions(-) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/{GetWxaSearchStatusResultJson.cs => GetWxaSearchStatusJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/{AuthIdentityTreeResultJson.cs => AuthIdentityTreeJsonResult.cs} (97%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/{QueryAuthResultJson.cs => QueryAuthJsonResult.cs} (97%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/{ReauthResultJson.cs => ReauthJsonResult.cs} (97%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/{UploadAuthMaterialResultJson.cs => UploadAuthMaterialJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/{WxaAuthResultJson.cs => WxaAuthJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/{GetOrderResultJson.cs => GetOrderJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/{GetOrderListResultJson.cs => GetOrderListJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/{IsTradeManagedResultJson.cs => IsTradeManagedJsonResult.cs} (96%) rename src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/{SetWebViewDomainResultJson.cs => SetWebViewDomainJsonResult.cs} (96%) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusApi.cs index b14d98772d..c4b8786894 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusApi.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusApi.cs @@ -52,10 +52,10 @@ public class SearchStatusApi /// /// /// - public static GetWxaSearchStatusResultJson GetWxaSearchStatus(string accessToken, int timeOut = Config.TIME_OUT) + public static GetWxaSearchStatusJsonResult GetWxaSearchStatus(string accessToken, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/getwxasearchstatus?access_token={0}", accessToken.AsUrlData()); - return CommonJsonSend.Send(null, url, null, CommonJsonSendType.GET, timeOut); + return CommonJsonSend.Send(null, url, null, CommonJsonSendType.GET, timeOut); } /// @@ -82,10 +82,10 @@ public static WxJsonResult ChangeWxaSearchStatus(string accessToken, int status, /// /// /// - public static async Task GetWxaSearchStatusAsync(string accessToken, int timeOut = Config.TIME_OUT) + public static async Task GetWxaSearchStatusAsync(string accessToken, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/getwxasearchstatus?access_token={0}", accessToken.AsUrlData()); - return await CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.GET, timeOut); + return await CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.GET, timeOut); } /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusJsonResult.cs index c3a79aab56..16ad0b6d8c 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SearchStatus/SearchStatusJson/GetWxaSearchStatusJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.SearchStatus /// /// 获取搜索状态返回类型 /// - public class GetWxaSearchStatusResultJson : WxJsonResult + public class GetWxaSearchStatusJsonResult : WxJsonResult { /// /// 1 表示不可搜索,0 表示可搜索 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs index f0f3648223..2bfd86f7d1 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecApi.cs @@ -56,14 +56,14 @@ public class SecApi /// /// /// - public static WxaAuthResultJson WxaAuth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + public static WxaAuthJsonResult WxaAuth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/wxaauth?access_token={0}", accessToken.AsUrlData()); var data = new { auth_data }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -74,14 +74,14 @@ public static WxaAuthResultJson WxaAuth(string accessToken, AuthData auth_data, /// /// /// - public static QueryAuthResultJson QueryAuth(string accessToken, string taskid, int timeOut = Config.TIME_OUT) + public static QueryAuthJsonResult QueryAuth(string accessToken, string taskid, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/queryauth?access_token={0}", accessToken.AsUrlData()); var data = new { taskid }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -92,12 +92,12 @@ public static QueryAuthResultJson QueryAuth(string accessToken, string taskid, i /// 图片(image): 不超过2M,支持PNG\JPEG\JPG\GIF格式 /// /// - public static UploadAuthMaterialResultJson UploadAuthMaterial(string accessToken, string file, int timeOut = Config.TIME_OUT) + public static UploadAuthMaterialJsonResult UploadAuthMaterial(string accessToken, string file, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/uploadauthmaterial?access_token={0}", accessToken.AsUrlData()); var fileDictionary = new Dictionary(); fileDictionary["media"] = file; - return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); + return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); } /// @@ -108,14 +108,14 @@ public static UploadAuthMaterialResultJson UploadAuthMaterial(string accessToken /// 认证数据 /// /// - public static ReauthResultJson Reauth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + public static ReauthJsonResult Reauth(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/reauth?access_token={0}", accessToken.AsUrlData()); var data = new { auth_data }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -125,10 +125,10 @@ public static ReauthResultJson Reauth(string accessToken, AuthData auth_data, in /// /// /// - public static AuthIdentityTreeResultJson AuthIdentityTree(string accessToken, int timeOut = Config.TIME_OUT) + public static AuthIdentityTreeJsonResult AuthIdentityTree(string accessToken, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/authidentitytree?access_token={0}", accessToken.AsUrlData()); - return CommonJsonSend.Send(null, url, null, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, null, CommonJsonSendType.POST, timeOut); } #endregion @@ -141,14 +141,14 @@ public static AuthIdentityTreeResultJson AuthIdentityTree(string accessToken, i /// /// /// - public static async Task WxaAuthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + public static async Task WxaAuthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/wxaauth?access_token={0}", accessToken.AsUrlData()); var data = new { auth_data }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -159,14 +159,14 @@ public static async Task WxaAuthAsync(string accessToken, Aut /// /// /// - public static async Task QueryAuthAsync(string accessToken, string taskid, int timeOut = Config.TIME_OUT) + public static async Task QueryAuthAsync(string accessToken, string taskid, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/queryauth?access_token={0}", accessToken.AsUrlData()); var data = new { taskid }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -177,12 +177,12 @@ public static async Task QueryAuthAsync(string accessToken, /// 图片(image): 不超过2M,支持PNG\JPEG\JPG\GIF格式 /// /// - public static async Task UploadAuthMaterialAsync(string accessToken, string file, int timeOut = Config.TIME_OUT) + public static async Task UploadAuthMaterialAsync(string accessToken, string file, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/uploadauthmaterial?access_token={0}", accessToken.AsUrlData()); var fileDictionary = new Dictionary(); fileDictionary["media"] = file; - return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); + return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); } /// @@ -193,14 +193,14 @@ public static async Task UploadAuthMaterialAsync(s /// 认证数据 /// /// - public static async Task ReauthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) + public static async Task ReauthAsync(string accessToken, AuthData auth_data, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/reauth?access_token={0}", accessToken.AsUrlData()); var data = new { auth_data }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -210,10 +210,10 @@ public static async Task ReauthAsync(string accessToken, AuthD /// /// /// - public static async Task AuthIdentityTreeAsync(string accessToken, int timeOut = Config.TIME_OUT) + public static async Task AuthIdentityTreeAsync(string accessToken, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/authidentitytree?access_token={0}", accessToken.AsUrlData()); - return await CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.POST, timeOut); } #endregion } diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeJsonResult.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeJsonResult.cs index d1587ea3dc..13c0a6db61 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/AuthIdentityTreeJsonResult.cs @@ -37,7 +37,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.Sec /// /// 查询个人认证身份选项列表 /// - public class AuthIdentityTreeResultJson : WxJsonResult + public class AuthIdentityTreeJsonResult : WxJsonResult { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthJsonResult.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthJsonResult.cs index a7b6c9966d..47db4cd88d 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/QueryAuthJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.Sec /// /// 小程序认证进度查询 /// - public class QueryAuthResultJson : WxJsonResult + public class QueryAuthJsonResult : WxJsonResult { /// /// 当前任务流程的状态码: diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthJsonResult.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthJsonResult.cs index 8f621faff3..2e55853009 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/ReauthJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.Sec /// /// 小程序认证重新提审 /// - public class ReauthResultJson : WxJsonResult + public class ReauthJsonResult : WxJsonResult { /// /// 认证任务id diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialJsonResult.cs index 28a1db15c7..0164466c3d 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/UploadAuthMaterialJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.Sec /// /// 小程序认证上传补充材料 /// - public class UploadAuthMaterialResultJson : WxJsonResult + public class UploadAuthMaterialJsonResult : WxJsonResult { /// /// 类型 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthJsonResult.cs index e92198370d..9d4ae2c1ba 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/Sec/SecJson/WxaAuthJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.Sec /// /// 小程序认证 /// - public class WxaAuthResultJson : WxJsonResult + public class WxaAuthJsonResult : WxJsonResult { /// /// 认证任务id diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderApi.cs index c9faa108c2..bb58c3699a 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderApi.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderApi.cs @@ -85,7 +85,7 @@ public static WxJsonResult UploadCombinedShippingInfo(string accessToken, Upload /// 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一 /// /// - public static GetOrderResultJson GetOrder(string accessToken, string transaction_id = "", string merchant_id = "", string sub_merchant_id = "", string merchant_trade_no = "", int timeOut = Config.TIME_OUT) + public static GetOrderJsonResult GetOrder(string accessToken, string transaction_id = "", string merchant_id = "", string sub_merchant_id = "", string merchant_trade_no = "", int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/get_order?access_token={0}", accessToken.AsUrlData()); var data = new @@ -95,7 +95,7 @@ public static GetOrderResultJson GetOrder(string accessToken, string transaction sub_merchant_id, merchant_trade_no, }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -110,7 +110,7 @@ public static GetOrderResultJson GetOrder(string accessToken, string transaction /// 翻页时使用,返回列表的长度,默认为100。 /// /// - public static GetOrderListResultJson GetOrderList(string accessToken, PayTimeRange pay_time_range = null, int? order_state = null, string openid = "", string last_index = "", int? page_size = null, int timeOut = Config.TIME_OUT) + public static GetOrderListJsonResult GetOrderList(string accessToken, PayTimeRange pay_time_range = null, int? order_state = null, string openid = "", string last_index = "", int? page_size = null, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/get_order_list?access_token={0}", accessToken.AsUrlData()); var data = new @@ -121,7 +121,7 @@ public static GetOrderListResultJson GetOrderList(string accessToken, PayTimeRan last_index, page_size, }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -176,14 +176,14 @@ public static WxJsonResult SetMsgJumpPath(string accessToken, string path, int t /// 商户自定义跳转路径。 /// /// - public static IsTradeManagedResultJson IsTradeManaged(string accessToken, string appid, int timeOut = Config.TIME_OUT) + public static IsTradeManagedJsonResult IsTradeManaged(string accessToken, string appid, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/is_trade_managed?access_token={0}", accessToken.AsUrlData()); var data = new { appid }; - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } #endregion @@ -225,7 +225,7 @@ public static async Task UploadCombinedShippingInfoAsync(string ac /// 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一 /// /// - public static async Task GetOrderAsync(string accessToken, string transaction_id = "", string merchant_id = "", string sub_merchant_id = "", string merchant_trade_no = "", int timeOut = Config.TIME_OUT) + public static async Task GetOrderAsync(string accessToken, string transaction_id = "", string merchant_id = "", string sub_merchant_id = "", string merchant_trade_no = "", int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/get_order?access_token={0}", accessToken.AsUrlData()); var data = new @@ -235,7 +235,7 @@ public static async Task GetOrderAsync(string accessToken, s sub_merchant_id, merchant_trade_no, }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -250,7 +250,7 @@ public static async Task GetOrderAsync(string accessToken, s /// 翻页时使用,返回列表的长度,默认为100。 /// /// - public static async Task GetOrderListAsync(string accessToken, PayTimeRange pay_time_range = null, int? order_state = null, string openid = "", string last_index = "", int? page_size = null, int timeOut = Config.TIME_OUT) + public static async Task GetOrderListAsync(string accessToken, PayTimeRange pay_time_range = null, int? order_state = null, string openid = "", string last_index = "", int? page_size = null, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/get_order_list?access_token={0}", accessToken.AsUrlData()); var data = new @@ -261,7 +261,7 @@ public static async Task GetOrderListAsync(string access last_index, page_size, }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } /// @@ -316,14 +316,14 @@ public static async Task SetMsgJumpPathAsync(string accessToken, s /// 商户自定义跳转路径。 /// /// - public static async Task IsTradeManagedAsync(string accessToken, string appid, int timeOut = Config.TIME_OUT) + public static async Task IsTradeManagedAsync(string accessToken, string appid, int timeOut = Config.TIME_OUT) { var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/is_trade_managed?access_token={0}", accessToken.AsUrlData()); var data = new { appid }; - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); } #endregion } diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderJsonResult.cs index ac22b506f5..ebbdd41b13 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.SecOrder /// /// 查询订单发货状态 /// - public class GetOrderResultJson : WxJsonResult + public class GetOrderJsonResult : WxJsonResult { /// /// 支付单信息 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListJsonResult.cs index 3362909927..ac73f6b218 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/GetOrderListJsonResult.cs @@ -37,7 +37,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.SecOrder /// /// 查询订单列表 /// - public class GetOrderListResultJson : WxJsonResult + public class GetOrderListJsonResult : WxJsonResult { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedJsonResult.cs index 75385acec1..e47d793a6b 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SecOrder/SecOrderJson/IsTradeManagedJsonResult.cs @@ -36,7 +36,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.SecOrder /// /// 查询小程序是否已开通发货信息管理服务 /// - public class IsTradeManagedResultJson : WxJsonResult + public class IsTradeManagedJsonResult : WxJsonResult { /// /// 是否已开通小程序发货信息管理服务 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs index d73e28ffe7..9ac177a3ba 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainApi.cs @@ -53,7 +53,7 @@ public class SetWebViewDomainApi /// /// [Obsolete("请使用DomainApi.SetWebViewDomain")] - public static SetWebViewDomainResultJson SetWebViewDomain(string accessToken, SetWebViewDomainAction action, + public static SetWebViewDomainJsonResult SetWebViewDomain(string accessToken, SetWebViewDomainAction action, List webviewdomain, int timeOut = Config.TIME_OUT) { @@ -77,7 +77,7 @@ public static SetWebViewDomainResultJson SetWebViewDomain(string accessToken, Se }; } - return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } #endregion @@ -94,7 +94,7 @@ public static SetWebViewDomainResultJson SetWebViewDomain(string accessToken, Se /// /// [Obsolete("请使用DomainApi.SetWebViewDomainAsync")] - public static async Task SetWebViewDomainAsync(string accessToken, SetWebViewDomainAction action, + public static async Task SetWebViewDomainAsync(string accessToken, SetWebViewDomainAction action, List webviewdomain, int timeOut = Config.TIME_OUT) { @@ -118,7 +118,7 @@ public static async Task SetWebViewDomainAsync(strin }; } - return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut).ConfigureAwait(false); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut).ConfigureAwait(false); } #endregion } diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainResultJson.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainResultJson.cs rename to src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainJsonResult.cs index 67e7e750a3..4736f4b6d6 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainResultJson.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/WxaAPIs/SetWebViewDomain/SetWebViewDomainJson/SetWebViewDomainJsonResult.cs @@ -41,7 +41,7 @@ namespace Senparc.Weixin.Open.WxaAPIs.SetWebViewDomain /// /// 修改业务域名接口返回类型 /// - public class SetWebViewDomainResultJson : WxJsonResult + public class SetWebViewDomainJsonResult : WxJsonResult { //以下字段仅在get时返回 From 5dfba62a4d9c6ce6669da1fab01b5ed994a17f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 30 Nov 2023 11:38:12 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...equestMessageEvent_XPay_Coin_Pay_Notify.cs | 62 +++ ...tMessageEvent_XPay_Goods_Deliver_Notify.cs | 88 ++++ .../RequestMessageEvent_XPay_Refund_Notify.cs | 70 ++++ .../Senparc.Weixin.MP/Enums.cs | 23 +- .../Async/MessageHandlerAsync.Event.cs | 28 ++ .../MessageHandlers/MessageHandler.Event.cs | 30 +- .../Senparc.Weixin.Open/XPayAPIs/XPayApi.cs | 389 +++++++++++++++++- .../XPayJson/BindTransferAccoutRequestData.cs | 25 ++ .../XPayJson/CreateFundsBillJsonResult.cs | 20 + .../XPayJson/CreateFundsBillRequestData.cs | 60 +++ .../XPayJson/QueryAdverFundsJsonResult.cs | 61 +++ .../XPayJson/QueryAdverFundsRequestData.cs | 52 +++ .../XPayJson/QueryBizBalanceJsonResult.cs | 36 ++ .../XPayJson/QueryPublishGoodsJsonResult.cs | 46 +++ .../XPayJson/QueryPublishGoodsRequestData.cs | 19 + .../QueryTransferAccountJsonResult.cs | 46 +++ .../XPayJson/QueryUploadGoodsJsonResult.cs | 66 +++ .../XPayJson/QueryUploadGoodsRequestData.cs | 19 + .../XPayJson/StartPublishGoodsRequestData.cs | 31 ++ 19 files changed, 1165 insertions(+), 6 deletions(-) create mode 100644 src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs create mode 100644 src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs create mode 100644 src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs create mode 100644 src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs new file mode 100644 index 0000000000..6473f39ca6 --- /dev/null +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs @@ -0,0 +1,62 @@ +namespace Senparc.Weixin.MP.Entities +{ + public class RequestMessageEvent_XPay_Coin_Pay_Notify : RequestMessageEventBase, IRequestMessageEventBase + { + public override Event Event + { + get { return Event.xpay_goods_deliver_notify; } + } + + /// + /// 用户openid + /// + public string OpenId { get; set; } + + /// + /// 业务订单号 + /// + public string OutTradeNo { get; set; } + + /// + /// 环境配置 0:现网环境(也叫正式环境)1:沙箱环境 + /// + public string Env { get; set; } + + /// + /// 微信支付信息 非微信支付渠道可能没有 + /// + public WeChatPayInfo WeChatPayInfo { get; set; } + + /// + /// 道具参数信息 + /// + public CoinInfo CoinInfo { get; set; } + } + + /// + /// 道具参数信息 + /// + public class CoinInfo + { + /// + /// 数量 + /// + public int Quantity { get; set; } + + /// + /// 物品原始价格 (单位:分) + /// + public int OrigPrice { get; set; } + + /// + /// 物品实际支付价格(单位:分) + /// + public int ActualPrice { get; set; } + + /// + /// 透传信息 + /// + public string Attach { get; set; } + + } +} diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs new file mode 100644 index 0000000000..ef38a49852 --- /dev/null +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs @@ -0,0 +1,88 @@ +namespace Senparc.Weixin.MP.Entities +{ + public class RequestMessageEvent_XPay_Goods_Deliver_Notify : RequestMessageEventBase, IRequestMessageEventBase + { + public override Event Event + { + get { return Event.xpay_goods_deliver_notify; } + } + + /// + /// 用户openid + /// + public string OpenId { get; set; } + + /// + /// 业务订单号 + /// + public string OutTradeNo { get; set; } + + /// + /// 环境配置 0:现网环境(也叫正式环境)1:沙箱环境 + /// + public string Env { get; set; } + + /// + /// 微信支付信息 非微信支付渠道可能没有 + /// + public WeChatPayInfo WeChatPayInfo { get; set; } + + /// + /// 道具参数信息 + /// + public GoodsInfo GoodsInfo { get; set; } + } + + /// + /// 微信支付信息 非微信支付渠道可能没有 + /// + public class WeChatPayInfo + { + /// + /// 微信支付商户单号 + /// + public string MchOrderNo { get; set; } + + /// + /// 交易单号(微信支付订单号) + /// + public string TransactionId { get; set; } + + /// + /// 用户支付时间,Linux秒级时间戳 + /// + public long PaidTime { get; set; } + } + + /// + /// 道具参数信息 + /// + public class GoodsInfo + { + /// + /// 道具ID + /// + public string ProductId { get; set; } + + /// + /// 数量 + /// + public int Quantity { get; set; } + + /// + /// 物品原始价格 (单位:分) + /// + public int OrigPrice { get; set; } + + /// + /// 物品实际支付价格(单位:分) + /// + public int ActualPrice { get; set; } + + /// + /// 透传信息 + /// + public string Attach { get; set; } + + } +} diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs new file mode 100644 index 0000000000..63a8b4bdc5 --- /dev/null +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs @@ -0,0 +1,70 @@ +namespace Senparc.Weixin.MP.Entities +{ + public class RequestMessageEvent_XPay_Refund_Notify : RequestMessageEventBase, IRequestMessageEventBase + { + public override Event Event + { + get { return Event.xpay_refund_notify; } + } + + /// + /// 用户openid + /// + public string OpenId { get; set; } + + /// + /// 微信退款单号 + /// + public string WxRefundId { get; set; } + + /// + /// 商户退款单号 + /// + public string MchRefundId { get; set; } + + /// + /// 退款单对应支付单的微信单号 + /// + public string WxOrderId { get; set; } + + /// + /// 退款单对应支付单的商户单号 + /// + public string MchOrderId { get; set; } + + /// + /// 退款金额,单位分 + /// + public int RefundFee { get; set; } + + /// + /// 退款结果,0为成功,非0为失败 + /// + public int RetCode { get; set; } + + /// + /// 退款结果详情,失败时为退款失败的原因 + /// + public string RetMsg { get; set; } + + /// + /// 开始退款时间,秒级时间戳 + /// + public long RefundStartTimestamp { get; set; } + + /// + /// 结束退款时间,秒级时间戳 + /// + public long RefundSuccTimestamp { get; set; } + + /// + /// 退款单的微信支付单号 + /// + public string WxpayRefundTransactionId { get; set; } + + /// + /// 重试次数,从0开始。重试间隔为2 4 8 16...最多15次 + /// + public int RetryTimes { get; set; } + } +} diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs index 73db991042..7513a83791 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs @@ -335,7 +335,7 @@ public enum Event /// 点击菜单跳转小程序的事件推送 /// view_miniprogram, - + #region 微信认证事件推送 /// /// 资质认证成功(此时立即获得接口权限) @@ -408,7 +408,7 @@ public enum Event /// submit_invoice_title, #endregion - + #region 订阅通知 /// /// 用户操作订阅通知弹窗 场景:用户在图文等场景内订阅通知的操作 @@ -423,7 +423,24 @@ public enum Event /// /// 发送订阅通知 场景:调用 bizsend 接口发送通知 /// - subscribe_msg_sent_event + subscribe_msg_sent_event, + #endregion + + #region 小程序虚拟支付 + /// + /// 道具发货推送 + /// + xpay_goods_deliver_notify, + + /// + /// 代币支付推送 + /// + xpay_coin_pay_notify, + + /// + /// 退款推送 + /// + xpay_refund_notify, #endregion } diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs index e4575bb076..65aa11e3c1 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs @@ -234,12 +234,24 @@ public virtual async Task OnEventRequestAsync(IRequestMess break; #endregion + #region 微信电子发票 case Event.user_authorize_invoice: responseMessage = await OnEvent_User_Authorize_InvoiceAsync(RequestMessage as RequestMessageEvent_User_Authorize_Invoice).ConfigureAwait(false); break; #endregion + #region 小程序虚拟支付 + case Event.xpay_goods_deliver_notify: + responseMessage = await OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify); + break; + case Event.xpay_coin_pay_notify: + responseMessage = await OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify); + break; + case Event.xpay_refund_notify: + responseMessage = await OnEvent_XPay_Refund_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Refund_Notify); + break; + #endregion default: throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null); @@ -735,6 +747,7 @@ public virtual async Task OnEvent_Submit_Invoice_TitleAsyn return await DefaultAsyncMethod(requestMessage, () => OnEvent_Submit_Invoice_Title(requestMessage)).ConfigureAwait(false); } #endregion + #region 订阅通知 /// /// 用户管理订阅通知 @@ -765,6 +778,21 @@ public virtual async Task OnEvent_Subscribe_Msg_SentReques } #endregion + #region 小程序虚拟支付 + public virtual async Task OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Goods_Deliver_Notify(requestMessage)).ConfigureAwait(false); + } + public virtual async Task OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Coin_Pay_Notify(requestMessage)).ConfigureAwait(false); + } + public virtual async Task OnEvent_XPay_Refund_NotifyAsync(RequestMessageEvent_XPay_Refund_Notify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Refund_Notify(requestMessage)).ConfigureAwait(false); + } + #endregion + #endregion } } \ No newline at end of file diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs index 5a87df499a..fc02ec4d25 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs @@ -189,7 +189,6 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ responseMessage = OnEvent_Subscribe_Msg_SentRequest(RequestMessage as RequestMessageEvent_Subscribe_Msg_Sent); break; - #region 卡券回调 case Event.giftcard_pay_done: @@ -237,6 +236,7 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ // responseMessage = OnEvent_WeAppAuditFailRequest(RequestMessage as RequestMessageEvent_WeAppAuditFail); // break; #endregion + #region 微信电子发票 case Event.user_authorize_invoice: responseMessage = OnEvent_User_Authorize_Invoice(RequestMessage as RequestMessageEvent_User_Authorize_Invoice); @@ -245,6 +245,19 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ responseMessage = OnEvent_Submit_Invoice_Title(RequestMessage as RequestMessageEvent_Submit_Invoice_Title); break; #endregion + + #region 小程序虚拟支付 + case Event.xpay_goods_deliver_notify: + responseMessage = OnEvent_XPay_Goods_Deliver_Notify(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify); + break; + case Event.xpay_coin_pay_notify: + responseMessage = OnEvent_XPay_Coin_Pay_Notify(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify); + break; + case Event.xpay_refund_notify: + responseMessage = OnEvent_XPay_Refund_Notify(RequestMessage as RequestMessageEvent_XPay_Refund_Notify); + break; + #endregion + default: throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null); } @@ -770,6 +783,21 @@ public virtual IResponseMessageBase OnEvent_Subscribe_Msg_SentRequest(RequestMes return DefaultResponseMessage(requestMessage); } #endregion + + #region 小程序虚拟支付 + public virtual IResponseMessageBase OnEvent_XPay_Goods_Deliver_Notify(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + public virtual IResponseMessageBase OnEvent_XPay_Coin_Pay_Notify(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + public virtual IResponseMessageBase OnEvent_XPay_Refund_Notify(RequestMessageEvent_XPay_Refund_Notify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + #endregion #endregion } } diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs index 333488cc9f..6f85d2223f 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs @@ -32,9 +32,7 @@ and limitations under the License. using Senparc.NeuChar; using Senparc.Weixin.CommonAPIs; using Senparc.Weixin.Entities; -using Senparc.Weixin.Open.WxaAPIs.SecOrder; using Senparc.Weixin.Open.XPayAPIs.XPayJson; -using System.Collections.Generic; using System.Threading.Tasks; namespace Senparc.Weixin.Open.XPayAPIs @@ -195,10 +193,397 @@ public static WxJsonResult StartUploadGoods(string accessToken, string pay_sig, var url = string.Format(Config.ApiMpHost + "/xpay/start_upload_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); } + + /// + /// 查询批量上传道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static QueryUploadGoodsJsonResult QueryUploadGoods(string accessToken, string pay_sig, QueryUploadGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_upload_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 启动批量发布道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static WxJsonResult StartPublishGoods(string accessToken, string pay_sig, StartPublishGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/start_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询批量发布道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static QueryPublishGoodsJsonResult QueryPublishGoods(string accessToken, string pay_sig, QueryPublishGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询商家账户里的可提现余额 + /// + /// + /// + /// 0-正式环境 1-沙箱环境(仅作为签名校验,查询的结果都是正式环境的) + /// + /// + public static QueryBizBalanceJsonResult QueryBizBalance(string accessToken, string pay_sig, int env, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + env + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询广告金充值账户 + /// + /// + /// + /// 0-正式环境 1-沙箱环境(仅作为签名校验,查询的结果都是正式环境的) + /// + /// + public static QueryTransferAccountJsonResult QueryTransferAccount(string accessToken, string pay_sig, int env, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_transfer_account?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + env + }; + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询广告金发放记录 + /// + /// + /// + /// 请求参数 + /// + /// + public static QueryAdverFundsJsonResult QueryAdverFunds(string accessToken, string pay_sig, QueryAdverFundsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_adver_funds?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 充值广告金 + /// + /// + /// + /// 请求参数 + /// + /// + public static CreateFundsBillJsonResult CreateFundsBill(string accessToken, string pay_sig, CreateFundsBillRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_funds_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 绑定广告金充值账户 + /// + /// + /// + /// 请求参数 + /// + /// + public static WxJsonResult BindTransferAccout(string accessToken, string pay_sig, BindTransferAccoutRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_funds_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); + } #endregion #region 异步方法 + /// + /// 查询用户代币余额 + /// + /// + /// + /// 用户的openid + /// 0-正式环境 1-沙箱环境 + /// 用户ip,例如:1.1.1.1 + /// + /// + public static async Task QueryUserBalanceAsync(string accessToken, string pay_sig, QueryUserBalanceRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_user_balance?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 扣减代币(一般用于代币支付) + /// + /// + /// + /// 签名 + /// 请求参数 + /// + /// + public static async Task CurrencyPayAsync(string accessToken, string pay_sig, string signature, CurrencyPayRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/currency_pay?access_token={0}&pay_sig={1}&signature={2}", accessToken.AsUrlData(), pay_sig.AsUrlData(), signature.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + /// + /// 查询创建的订单(现金单,非代币单) + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task QueryOrderAsync(string accessToken, string pay_sig, QueryOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 代币支付退款(currency_pay接口的逆操作) + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task CancelCurrencyPayAsync(string accessToken, string pay_sig, CancelCurrencyPayRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/cancel_currency_pay?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 通知已经发货完成(只能通知现金单),正常通过xpay_goods_deliver_notify消息推送返回成功就不需要调用这个api接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task NotifyProvideGoodsAsync(string accessToken, string pay_sig, NotifyProvideGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/notify_provide_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 用于下载小程序账单,第一次调用触发生成下载url,可以间隔轮训来获取最终生成的下载url + /// + /// + /// + /// 起始时间(如20230801) + /// 截止时间(如20230810) + /// + /// + public static async Task DownloadBillAsync(string accessToken, string pay_sig, long begin_ds, long end_ds, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/download_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + begin_ds, + end_ds + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 对使用jsapi接口下的单进行退款,此接口只是启动退款任务成功,启动后需要调用query_order接口来查询退款单状态,等状态变成退款完成后即为最终成功 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task RefundOrderAsync(string accessToken, string pay_sig, RefundOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/refund_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 创建提现单 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task CreateWithdrawOrderAsync(string accessToken, string pay_sig, CreateWithdrawOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_withdraw_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询提现单 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task QueryWithdrawOrderAsync(string accessToken, string pay_sig, QueryWithdrawOrderRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_withdraw_order?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 启动批量上传道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task StartUploadGoodsAsync(string accessToken, string pay_sig, StartUploadGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/start_upload_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询批量上传道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task QueryUploadGoodsAsync(string accessToken, string pay_sig, QueryUploadGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_upload_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 启动批量发布道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task StartPublishGoodsAsync(string accessToken, string pay_sig, StartPublishGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/start_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询批量发布道具任务 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task QueryPublishGoodsAsync(string accessToken, string pay_sig, QueryPublishGoodsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询商家账户里的可提现余额 + /// + /// + /// + /// 0-正式环境 1-沙箱环境(仅作为签名校验,查询的结果都是正式环境的) + /// + /// + public static async Task QueryBizBalanceAsync(string accessToken, string pay_sig, int env, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_publish_goods?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + env + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询广告金充值账户 + /// + /// + /// + /// 0-正式环境 1-沙箱环境(仅作为签名校验,查询的结果都是正式环境的) + /// + /// + public static async Task QueryTransferAccountAsync(string accessToken, string pay_sig, int env, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_transfer_account?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + var data = new + { + env + }; + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 查询广告金发放记录 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task QueryAdverFundsAsync(string accessToken, string pay_sig, QueryAdverFundsRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/query_adver_funds?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 充值广告金 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task CreateFundsBillAsync(string accessToken, string pay_sig, CreateFundsBillRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_funds_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } + + /// + /// 绑定广告金充值账户 + /// + /// + /// + /// 请求参数 + /// + /// + public static async Task BindTransferAccoutAsync(string accessToken, string pay_sig, BindTransferAccoutRequestData data, int timeOut = Config.TIME_OUT) + { + var url = string.Format(Config.ApiMpHost + "/xpay/create_funds_bill?access_token={0}&pay_sig={1}", accessToken.AsUrlData(), pay_sig.AsUrlData()); + return await CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut); + } #endregion } } \ No newline at end of file diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs new file mode 100644 index 0000000000..f2637cbedc --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 绑定广告金充值账户 + /// + public class BindTransferAccoutRequestData + { + /// + /// 充值账户 uid + /// + public long transfer_account_uid { get; set; } + + /// + /// 充值账户主体名称 + /// + public string transfer_account_org_name { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs new file mode 100644 index 0000000000..fc384d7fc7 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs @@ -0,0 +1,20 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class CreateFundsBillJsonResult : WxJsonResult + { + /// + /// 充值单 id + /// + public string bill_id { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs new file mode 100644 index 0000000000..4c90953bcf --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 充值广告金 + /// + public class CreateFundsBillRequestData + { + /// + /// 充值金额,单位分 + /// + public int transfer_amount { get; set; } + + /// + /// 充值账户 uid + /// + public long transfer_account_uid { get; set; } + + /// + /// 充值账户名称 + /// + public string transfer_account_name { get; set; } + + /// + /// 充值账户服务商账号 id + /// + public long transfer_account_agency_id { get; set; } + + /// + /// 用户定义每一次请求的唯一 id,相同 id 的不同请求视为重复请求(不超过 1024 个字符) + /// + public string request_id { get; set; } + + /// + /// 充值所使用的广告金对应的结算周期开始时间,unix秒级时间戳 + /// + public long settle_begin { get; set; } + + /// + /// 充值所使用的广告金对应的结算周期结束时间,unix秒级时间戳 + /// + public long settle_end { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + + /// + /// 是否授权广告数据, 0:否,1:是 + /// + public int authorize_advertise { get; set; } + + /// + /// 广告金发放原因, 0:广告激励,1:通用赠送 + /// + public int fund_type { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs new file mode 100644 index 0000000000..dba65d71e9 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs @@ -0,0 +1,61 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryAdverFundsJsonResult : WxJsonResult + { + /// + /// 广告金发放记录列表 + /// + public List adver_funds_list { get; set; } + + /// + /// 查询命中总的页数 + /// + public int total_page { get; set; } + } + + /// + /// 发布的道具列表 + /// + public class QueryAdverFundsItem + { + /// + /// 结算周期开始时间,unix秒级时间戳 + /// + public long settle_begin { get; set; } + + /// + /// 查算周期结束时间,unix秒级时间戳 + /// + public long settle_end { get; set; } + + /// + /// 发放广告金金额,单位分 + /// + public int total_amount { get; set; } + + /// + /// 剩余可用广告金金额,单位分 + /// + public int remain_amount { get; set; } + + /// + /// 广告金过期时间,unix秒级时间戳 + /// + public long expire_time { get; set; } + + /// + /// 广告金发放原因, 0:广告激励,1:通用赠送 + /// + public int fund_type { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs new file mode 100644 index 0000000000..72353eb67f --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询广告金发放记录 + /// + public class QueryAdverFundsRequestData + { + /// + /// 查询页码,不小于 1 + /// + public int page { get; set; } + + /// + /// 每页记录数量 + /// + public int page_size { get; set; } + + /// + /// 查询过滤条件 + /// + public QueryAdverFundsFilter filter { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } + + /// + /// 发布的商品列表 + /// + public class QueryAdverFundsFilter + { + /// + /// 查询结算周期开始时间,unix秒级时间戳 + /// + public long settle_begin { get; set; } + + /// + /// 查询结算周期结束时间,unix秒级时间戳 + /// + public long settle_end { get; set; } + + /// + /// (可选)广告金发放原因, 0:广告激励,1:通用赠送 + /// + public int fund_type { get; set; } + + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs new file mode 100644 index 0000000000..a7bcc0b304 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs @@ -0,0 +1,36 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryBizBalanceJsonResult : WxJsonResult + { + /// + /// 可提现余额 + /// + public QueryBizBalanceAvailable balance_available { get; set; } + } + + /// + /// 发布的道具列表 + /// + public class QueryBizBalanceAvailable + { + /// + /// 可提现余额,单位元 + /// + public string amount { get; set; } + + /// + /// 币种(一般为CNY) + /// + public string currency_code { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs new file mode 100644 index 0000000000..656b3fb98f --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs @@ -0,0 +1,46 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryPublishGoodsJsonResult : WxJsonResult + { + /// + /// 发布的道具列表 + /// + public List publish_item { get; set; } + + /// + /// 0-无任务在运行 1-任务运行中 2-上传失败或部分失败(上传任务已经完成) 3-上传成功 + /// + public int status { get; set; } + } + + /// + /// 发布的道具列表 + /// + public class QueryPublishGoodsItem + { + /// + /// 道具id + /// + public string id { get; set; } + + /// + /// 0-上传中 1-id已经存在 2-发布成功 3-发布失败 + /// + public int publish_status { get; set; } + + /// + /// 上传失败的原因 + /// + public string errmsg { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs new file mode 100644 index 0000000000..5997e24431 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询批量发布道具任务 + /// + public class QueryPublishGoodsRequestData + { + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs new file mode 100644 index 0000000000..a35b9a1d9e --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs @@ -0,0 +1,46 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryTransferAccountJsonResult : WxJsonResult + { + /// + /// 可提现余额 + /// + public List acct_list { get; set; } + } + + /// + /// 发布的道具列表 + /// + public class QueryTransferAccountItem + { + /// + /// 充值账户名称 + /// + public string transfer_account_name { get; set; } + + /// + /// 充值账户 uid + /// + public long transfer_account_uid { get; set; } + + /// + /// 充值账户服务商账号 id + /// + public long transfer_account_agency_id { get; set; } + + /// + /// 充值账户服务商账号名称 + /// + public string transfer_account_agency_name { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs new file mode 100644 index 0000000000..1798783e28 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs @@ -0,0 +1,66 @@ +using Senparc.Weixin.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// + /// + public class QueryUploadGoodsJsonResult : WxJsonResult + { + /// + /// 上传的道具列表 + /// + public List upload_item { get; set; } + + /// + /// 0-无任务在运行 1-任务运行中 2-上传失败或部分失败(上传任务已经完成) 3-上传成功 + /// + public int status { get; set; } + } + + /// + /// 上传的商品列表 + /// + public class QueryUploadGoodsItem + { + /// + /// 道具id,长度(0,64],字符只允许使用字母、数字、'_'、'-' + /// + public string id { get; set; } + + /// + /// 道具名称,长度(0,1024] + /// + public string name { get; set; } + + /// + /// 道具单价,单位分,需要大于0 + /// + public int price { get; set; } + + /// + /// 道具备注,长度(0,1024] + /// + public string remark { get; set; } + + /// + /// 道具图片的url地址,当前仅支持jpg,png等格式 + /// + public string item_url { get; set; } + + /// + /// 0-上传中 1-id已经存在 2-上传成功 3-上传失败 + /// + public int upload_status { get; set; } + + /// + /// 上传失败的原因 + /// + public string errmsg { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs new file mode 100644 index 0000000000..beeffc9726 --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 查询批量上传道具任务 + /// + public class QueryUploadGoodsRequestData + { + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } +} diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs new file mode 100644 index 0000000000..aeec5a6bcd --- /dev/null +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +{ + /// + /// 启动批量发布道具任务 + /// + public class StartPublishGoodsRequestData + { + /// + /// 发布的商品列表 + /// + public List publish_item { get; set; } + + /// + /// 0-正式环境 1-沙箱环境 + /// + public int env { get; set; } + } + + /// + /// 发布的商品列表 + /// + public class StartPublishGoodsItem + { + /// + /// 道具id,添加到开发环境时传的道具id + /// + public string id { get; set; } + } +} From 87f89898e9ad7a5266e993b2969e9a83fba95721 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Thu, 30 Nov 2023 20:01:34 +0800 Subject: [PATCH 05/13] =?UTF-8?q?Open=20v4.17.1=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E2=80=9C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=BE=AE=E4=BF=A1=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E2=80=9D=E5=8A=9F=E8=83=BD=20#2957=20=E6=84=9F?= =?UTF-8?q?=E8=B0=A2=20@mojinxun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj index f37de2d46c..25380e8db5 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 4.17.0 + 4.17.1 Senparc.Weixin.Open Senparc.Weixin.Open true @@ -219,7 +219,8 @@ v4.16.0 1、处理三方推送消息枚举 2、添加“小程序发货信息管理服务” - + v4.17.1 新增“小程序微信认证”功能 + https://github.com/JeffreySu/WeiXinMPSDK From 6e0b4a13fba0509defaa11f589842e61a3783627 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Thu, 30 Nov 2023 20:13:57 +0800 Subject: [PATCH 06/13] =?UTF-8?q?MP=20v16.20.2=20#2958=20=E6=84=9F?= =?UTF-8?q?=E8=B0=A2=20@mojinxun=20=20#2951=20=E6=84=9F=E8=B0=A2=20@Wander?= =?UTF-8?q?ingGrass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...equestMessageEvent_XPay_Coin_Pay_Notify.cs | 16 +++++++++++++- ...tMessageEvent_XPay_Goods_Deliver_Notify.cs | 13 +++++++++++- .../RequestMessageEvent_XPay_Refund_Notify.cs | 13 +++++++++++- .../Senparc.Weixin.MP/Enums.cs | 3 +++ .../Async/MessageHandlerAsync.Event.cs | 21 +++++++++++++++++++ .../MessageHandlers/MessageHandler.Event.cs | 3 +++ .../Senparc.Weixin.MP.net8.csproj | 3 ++- 7 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs index 6473f39ca6..ed8be80ee9 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs @@ -1,5 +1,19 @@ -namespace Senparc.Weixin.MP.Entities +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:RequestMessageEvent_XPay_Coin_Pay_Notify.cs + 文件功能描述:小程序虚拟支付 - 代币支付推送 + + + 创建标识:Senparc - 20231130 + +----------------------------------------------------------------*/ + +namespace Senparc.Weixin.MP.Entities { + /// + /// 代币支付推送 + /// public class RequestMessageEvent_XPay_Coin_Pay_Notify : RequestMessageEventBase, IRequestMessageEventBase { public override Event Event diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs index ef38a49852..4a02823cec 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs @@ -1,4 +1,15 @@ -namespace Senparc.Weixin.MP.Entities +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:RequestMessageEvent_XPay_Goods_Deliver_Notify.cs + 文件功能描述:小程序虚拟支付 - 道具发货推送 + + + 创建标识:Senparc - 20231130 + +----------------------------------------------------------------*/ + +namespace Senparc.Weixin.MP.Entities { public class RequestMessageEvent_XPay_Goods_Deliver_Notify : RequestMessageEventBase, IRequestMessageEventBase { diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs index 63a8b4bdc5..9aef12db8c 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs @@ -1,4 +1,15 @@ -namespace Senparc.Weixin.MP.Entities +/*---------------------------------------------------------------- + Copyright (C) 2023 Senparc + + 文件名:RequestMessageEvent_XPay_Refund_Notify.cs + 文件功能描述:小程序虚拟支付 - 退款推送 + + + 创建标识:Senparc - 20231130 + +----------------------------------------------------------------*/ + +namespace Senparc.Weixin.MP.Entities { public class RequestMessageEvent_XPay_Refund_Notify : RequestMessageEventBase, IRequestMessageEventBase { diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs index 7513a83791..174e619027 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs @@ -102,6 +102,9 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 Event.submit_invoice_title + 修改标识:Senparc - 20231130 + 修改描述:v16.20.2 Event 添加“小程序虚拟支付”相关枚举 + ----------------------------------------------------------------*/ using System; diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs index 65aa11e3c1..f7bfe0223b 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs @@ -33,6 +33,9 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 OnEvent_Submit_Invoice_TitleAsync() 方法 + 修改标识:Senparc - 20231130 + 修改描述:v16.20.2 添加“小程序虚拟支付”相关事件 + ----------------------------------------------------------------*/ using Senparc.NeuChar.Entities; @@ -779,14 +782,32 @@ public virtual async Task OnEvent_Subscribe_Msg_SentReques #endregion #region 小程序虚拟支付 + + /// + /// 小程序虚拟支付 - 道具发货推送 + /// + /// + /// public virtual async Task OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage) { return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Goods_Deliver_Notify(requestMessage)).ConfigureAwait(false); } + + /// + /// 小程序虚拟支付 - 代币支付推送 + /// + /// + /// public virtual async Task OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage) { return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Coin_Pay_Notify(requestMessage)).ConfigureAwait(false); } + + /// + /// 小程序虚拟支付 - 退款推送 + /// + /// + /// public virtual async Task OnEvent_XPay_Refund_NotifyAsync(RequestMessageEvent_XPay_Refund_Notify requestMessage) { return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Refund_Notify(requestMessage)).ConfigureAwait(false); diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs index fc02ec4d25..2a1f0855d3 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs @@ -36,6 +36,9 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 OnEvent_Submit_Invoice_Title() 方法 + 修改标识:Senparc - 20231130 + 修改描述:v16.20.2 添加“小程序虚拟支付”相关事件 + ----------------------------------------------------------------*/ using Senparc.NeuChar.Entities; diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj index e2c03ea90e..b46bee0ff1 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 16.20.1 + 16.20.2 Senparc.Weixin.MP Senparc.Weixin.MP true @@ -527,6 +527,7 @@ v16.18.14 JSSDKHelper.GetNoncestr() 弃用 MD5 加密方法 v16.19.0 MessageHandler 和客服接口支持长文本自动切割后连续发送 v16.20.1 添加 TemplateApi.AddTemplate() 参数 + v16.20.2 添加“小程序虚拟支付 ”功能 https://github.com/JeffreySu/WeiXinMPSDK From bb5dd66fba349dbc9673b8abc4168d5d1519111d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Fri, 1 Dec 2023 09:42:33 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=94=AF=E4=BB=98=20=E8=BF=81=E7=A7=BB=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.MP/Enums.cs | 17 ----- .../Async/MessageHandlerAsync.Event.cs | 45 ----------- .../MessageHandlers/MessageHandler.Event.cs | 27 ------- .../AdvancedAPIs/XPay}/XPayApi.cs | 5 +- .../XPayJson/BindTransferAccoutRequestData.cs | 2 +- .../XPayJson/CancelCurrencyPayJsonResult.cs | 2 +- .../XPayJson/CancelCurrencyPayRequestData.cs | 2 +- .../XPayJson/CreateFundsBillJsonResult.cs | 2 +- .../XPayJson/CreateFundsBillRequestData.cs | 2 +- .../XPayJson/CreateWithdrawOrderJsonResult.cs | 2 +- .../CreateWithdrawOrderRequestData.cs | 2 +- .../XPay}/XPayJson/CurrencyPayJsonResult.cs | 2 +- .../XPay}/XPayJson/CurrencyPayRequestData.cs | 2 +- .../XPay}/XPayJson/DownloadBillJsonResult.cs | 2 +- .../XPayJson/NotifyProvideGoodsRequestData.cs | 2 +- .../XPayJson/QueryAdverFundsJsonResult.cs | 2 +- .../XPayJson/QueryAdverFundsRequestData.cs | 2 +- .../XPayJson/QueryBizBalanceJsonResult.cs | 2 +- .../XPay}/XPayJson/QueryOrderJsonResult.cs | 2 +- .../XPay}/XPayJson/QueryOrderRequestData.cs | 2 +- .../XPayJson/QueryPublishGoodsJsonResult.cs | 2 +- .../XPayJson/QueryPublishGoodsRequestData.cs | 2 +- .../QueryTransferAccountJsonResult.cs | 2 +- .../XPayJson/QueryUploadGoodsJsonResult.cs | 2 +- .../XPayJson/QueryUploadGoodsRequestData.cs | 2 +- .../XPayJson/QueryUserBalanceJsonResult.cs | 2 +- .../XPayJson/QueryUserBalanceRequestData.cs | 2 +- .../XPayJson/QueryWithdrawOrderJsonResult.cs | 2 +- .../XPayJson/QueryWithdrawOrderRequestData.cs | 2 +- .../XPay}/XPayJson/RefundOrderJsonResult.cs | 2 +- .../XPay}/XPayJson/RefundOrderRequestData.cs | 2 +- .../XPayJson/StartPublishGoodsRequestData.cs | 2 +- .../XPayJson/StartUploadGoodsRequestData.cs | 2 +- .../RequestMessageEvent_XPayCoinPayNotify.cs} | 4 +- ...estMessageEvent_XPayGoodsDeliverNotify.cs} | 4 +- .../RequestMessageEvent_XPayRefundNotify.cs} | 4 +- .../Senparc.Weixin.WxOpen/Enums.cs | 20 ++++- .../WxOpenMessageHandler.Event.cs | 74 +++++++++++++++++++ 38 files changed, 130 insertions(+), 128 deletions(-) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayApi.cs (99%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/BindTransferAccoutRequestData.cs (91%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CancelCurrencyPayJsonResult.cs (89%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CancelCurrencyPayRequestData.cs (95%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CreateFundsBillJsonResult.cs (88%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CreateFundsBillRequestData.cs (97%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CreateWithdrawOrderJsonResult.cs (91%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CreateWithdrawOrderRequestData.cs (94%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CurrencyPayJsonResult.cs (93%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/CurrencyPayRequestData.cs (96%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/DownloadBillJsonResult.cs (88%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/NotifyProvideGoodsRequestData.cs (94%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryAdverFundsJsonResult.cs (96%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryAdverFundsRequestData.cs (96%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryBizBalanceJsonResult.cs (94%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryOrderJsonResult.cs (98%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryOrderRequestData.cs (93%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryPublishGoodsJsonResult.cs (95%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryPublishGoodsRequestData.cs (88%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryTransferAccountJsonResult.cs (95%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryUploadGoodsJsonResult.cs (97%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryUploadGoodsRequestData.cs (88%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryUserBalanceJsonResult.cs (96%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryUserBalanceRequestData.cs (92%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryWithdrawOrderJsonResult.cs (96%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/QueryWithdrawOrderRequestData.cs (91%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/RefundOrderJsonResult.cs (94%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/RefundOrderRequestData.cs (97%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/StartPublishGoodsRequestData.cs (93%) rename src/{Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay}/XPayJson/StartUploadGoodsRequestData.cs (96%) rename src/{Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayCoinPayNotify.cs} (92%) rename src/{Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayGoodsDeliverNotify.cs} (94%) rename src/{Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs => Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayRefundNotify.cs} (93%) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs index 174e619027..33e0c39199 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs @@ -428,23 +428,6 @@ public enum Event /// subscribe_msg_sent_event, #endregion - - #region 小程序虚拟支付 - /// - /// 道具发货推送 - /// - xpay_goods_deliver_notify, - - /// - /// 代币支付推送 - /// - xpay_coin_pay_notify, - - /// - /// 退款推送 - /// - xpay_refund_notify, - #endregion } diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs index f7bfe0223b..79fbb95db4 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs @@ -244,18 +244,6 @@ public virtual async Task OnEventRequestAsync(IRequestMess break; #endregion - #region 小程序虚拟支付 - case Event.xpay_goods_deliver_notify: - responseMessage = await OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify); - break; - case Event.xpay_coin_pay_notify: - responseMessage = await OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify); - break; - case Event.xpay_refund_notify: - responseMessage = await OnEvent_XPay_Refund_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Refund_Notify); - break; - #endregion - default: throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null); } @@ -781,39 +769,6 @@ public virtual async Task OnEvent_Subscribe_Msg_SentReques } #endregion - #region 小程序虚拟支付 - - /// - /// 小程序虚拟支付 - 道具发货推送 - /// - /// - /// - public virtual async Task OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage) - { - return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Goods_Deliver_Notify(requestMessage)).ConfigureAwait(false); - } - - /// - /// 小程序虚拟支付 - 代币支付推送 - /// - /// - /// - public virtual async Task OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage) - { - return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Coin_Pay_Notify(requestMessage)).ConfigureAwait(false); - } - - /// - /// 小程序虚拟支付 - 退款推送 - /// - /// - /// - public virtual async Task OnEvent_XPay_Refund_NotifyAsync(RequestMessageEvent_XPay_Refund_Notify requestMessage) - { - return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Refund_Notify(requestMessage)).ConfigureAwait(false); - } - #endregion - #endregion } } \ No newline at end of file diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs index 2a1f0855d3..7635baa2b6 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs @@ -249,18 +249,6 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ break; #endregion - #region 小程序虚拟支付 - case Event.xpay_goods_deliver_notify: - responseMessage = OnEvent_XPay_Goods_Deliver_Notify(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify); - break; - case Event.xpay_coin_pay_notify: - responseMessage = OnEvent_XPay_Coin_Pay_Notify(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify); - break; - case Event.xpay_refund_notify: - responseMessage = OnEvent_XPay_Refund_Notify(RequestMessage as RequestMessageEvent_XPay_Refund_Notify); - break; - #endregion - default: throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null); } @@ -786,21 +774,6 @@ public virtual IResponseMessageBase OnEvent_Subscribe_Msg_SentRequest(RequestMes return DefaultResponseMessage(requestMessage); } #endregion - - #region 小程序虚拟支付 - public virtual IResponseMessageBase OnEvent_XPay_Goods_Deliver_Notify(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage) - { - return DefaultResponseMessage(requestMessage); - } - public virtual IResponseMessageBase OnEvent_XPay_Coin_Pay_Notify(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage) - { - return DefaultResponseMessage(requestMessage); - } - public virtual IResponseMessageBase OnEvent_XPay_Refund_Notify(RequestMessageEvent_XPay_Refund_Notify requestMessage) - { - return DefaultResponseMessage(requestMessage); - } - #endregion #endregion } } diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs similarity index 99% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs index 6f85d2223f..f9e11144ed 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayApi.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayApi.cs @@ -32,16 +32,15 @@ and limitations under the License. using Senparc.NeuChar; using Senparc.Weixin.CommonAPIs; using Senparc.Weixin.Entities; -using Senparc.Weixin.Open.XPayAPIs.XPayJson; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 小程序虚拟支付 /// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html#_2-3-%E6%9C%8D%E5%8A%A1%E5%99%A8API /// - [NcApiBind(NeuChar.PlatformType.WeChat_Open, true)] + [NcApiBind(NeuChar.PlatformType.WeChat_MiniProgram, true)] public class XPayApi { #region 同步方法 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/BindTransferAccoutRequestData.cs similarity index 91% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/BindTransferAccoutRequestData.cs index f2637cbedc..c0468bd491 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/BindTransferAccoutRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/BindTransferAccoutRequestData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 绑定广告金充值账户 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayJsonResult.cs similarity index 89% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayJsonResult.cs index 76173fee29..59a8bcfb46 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 代币支付退款(currency_pay接口的逆操作) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayRequestData.cs similarity index 95% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayRequestData.cs index 83c0bccde9..f40cadaa80 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CancelCurrencyPayRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CancelCurrencyPayRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 代币支付退款(currency_pay接口的逆操作) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillJsonResult.cs similarity index 88% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillJsonResult.cs index fc384d7fc7..743a913380 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillRequestData.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillRequestData.cs index 4c90953bcf..f230a9a7d0 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateFundsBillRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateFundsBillRequestData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 充值广告金 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderJsonResult.cs similarity index 91% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderJsonResult.cs index 27c0951537..ef93102e07 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderRequestData.cs similarity index 94% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderRequestData.cs index 36fc8c0573..06aa0a25d7 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CreateWithdrawOrderRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CreateWithdrawOrderRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 创建提现单 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayJsonResult.cs similarity index 93% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayJsonResult.cs index 68fee1448a..d1a9aeafcd 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 扣减代币(一般用于代币支付) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayRequestData.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayRequestData.cs index df19d890a0..95b575149f 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/CurrencyPayRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/CurrencyPayRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 扣减代币(一般用于代币支付) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/DownloadBillJsonResult.cs similarity index 88% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/DownloadBillJsonResult.cs index 379a2ff496..ae24384aee 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/DownloadBillJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/DownloadBillJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/NotifyProvideGoodsRequestData.cs similarity index 94% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/NotifyProvideGoodsRequestData.cs index b869638b96..84b92b8449 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/NotifyProvideGoodsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/NotifyProvideGoodsRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 通知已经发货完成(只能通知现金单),正常通过xpay_goods_deliver_notify消息推送返回成功就不需要调用这个api接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsJsonResult.cs index dba65d71e9..e888ba6cd6 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsRequestData.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsRequestData.cs index 72353eb67f..dde37d81ec 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryAdverFundsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryAdverFundsRequestData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询广告金发放记录 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryBizBalanceJsonResult.cs similarity index 94% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryBizBalanceJsonResult.cs index a7bcc0b304..ed69973640 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryBizBalanceJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryBizBalanceJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderJsonResult.cs similarity index 98% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderJsonResult.cs index 344283b4e2..04b172202d 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderJsonResult.cs @@ -1,6 +1,6 @@ using Senparc.Weixin.Entities; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderRequestData.cs similarity index 93% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderRequestData.cs index f98de1c342..7ac28ce76d 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryOrderRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryOrderRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询创建的订单(现金单,非代币单) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsJsonResult.cs similarity index 95% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsJsonResult.cs index 656b3fb98f..f980600e97 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsRequestData.cs similarity index 88% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsRequestData.cs index 5997e24431..621498324e 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryPublishGoodsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryPublishGoodsRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询批量发布道具任务 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryTransferAccountJsonResult.cs similarity index 95% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryTransferAccountJsonResult.cs index a35b9a1d9e..09cbe70c82 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryTransferAccountJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryTransferAccountJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsJsonResult.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsJsonResult.cs index 1798783e28..d8dd27ebed 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsRequestData.cs similarity index 88% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsRequestData.cs index beeffc9726..7dc37790af 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUploadGoodsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUploadGoodsRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询批量上传道具任务 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceJsonResult.cs index 0f78c07178..7c389e4a2f 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceRequestData.cs similarity index 92% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceRequestData.cs index 6938489bd4..db72c5d492 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryUserBalanceRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryUserBalanceRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询用户代币余额 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderJsonResult.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderJsonResult.cs index 137accac88..5b03e0eedf 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderRequestData.cs similarity index 91% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderRequestData.cs index 1f97f41fb9..6f72257ee5 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/QueryWithdrawOrderRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/QueryWithdrawOrderRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 查询提现单 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderJsonResult.cs similarity index 94% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderJsonResult.cs index 5fb7b9e34d..97d78a903f 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderJsonResult.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderRequestData.cs similarity index 97% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderRequestData.cs index e2da38a2b1..dd8a92b12f 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/RefundOrderRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/RefundOrderRequestData.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 对使用jsapi接口下的单进行退款,此接口只是启动退款任务成功,启动后需要调用query_order接口来查询退款单状态,等状态变成退款完成后即为最终成功 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartPublishGoodsRequestData.cs similarity index 93% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartPublishGoodsRequestData.cs index aeec5a6bcd..b10c0cddd7 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartPublishGoodsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartPublishGoodsRequestData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 启动批量发布道具任务 diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartUploadGoodsRequestData.cs similarity index 96% rename from src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartUploadGoodsRequestData.cs index 26d07e2466..771c2ab096 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/XPayAPIs/XPayJson/StartUploadGoodsRequestData.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/XPay/XPayJson/StartUploadGoodsRequestData.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Senparc.Weixin.Open.XPayAPIs.XPayJson +namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay { /// /// 启动批量上传道具任务 diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayCoinPayNotify.cs similarity index 92% rename from src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayCoinPayNotify.cs index ed8be80ee9..22a6756639 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Coin_Pay_Notify.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayCoinPayNotify.cs @@ -9,12 +9,12 @@ ----------------------------------------------------------------*/ -namespace Senparc.Weixin.MP.Entities +namespace Senparc.Weixin.WxOpen.Entities { /// /// 代币支付推送 /// - public class RequestMessageEvent_XPay_Coin_Pay_Notify : RequestMessageEventBase, IRequestMessageEventBase + public class RequestMessageEvent_XPayCoinPayNotify : RequestMessageEventBase, IRequestMessageEventBase { public override Event Event { diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayGoodsDeliverNotify.cs similarity index 94% rename from src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayGoodsDeliverNotify.cs index 4a02823cec..1b8826d1c3 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Goods_Deliver_Notify.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayGoodsDeliverNotify.cs @@ -9,9 +9,9 @@ ----------------------------------------------------------------*/ -namespace Senparc.Weixin.MP.Entities +namespace Senparc.Weixin.WxOpen.Entities { - public class RequestMessageEvent_XPay_Goods_Deliver_Notify : RequestMessageEventBase, IRequestMessageEventBase + public class RequestMessageEvent_XPayGoodsDeliverNotify : RequestMessageEventBase, IRequestMessageEventBase { public override Event Event { diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayRefundNotify.cs similarity index 93% rename from src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs rename to src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayRefundNotify.cs index 9aef12db8c..d564a1ae3a 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/XPay/RequestMessageEvent_XPay_Refund_Notify.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/XPay/RequestMessageEvent_XPayRefundNotify.cs @@ -9,9 +9,9 @@ ----------------------------------------------------------------*/ -namespace Senparc.Weixin.MP.Entities +namespace Senparc.Weixin.WxOpen.Entities { - public class RequestMessageEvent_XPay_Refund_Notify : RequestMessageEventBase, IRequestMessageEventBase + public class RequestMessageEvent_XPayRefundNotify : RequestMessageEventBase, IRequestMessageEventBase { public override Event Event { diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs index af20bcefed..d2ffb534c0 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs @@ -94,7 +94,25 @@ public enum Event /// /// 订单将要结算或已经结算事件 /// - trade_manage_order_settlement + trade_manage_order_settlement, + + + #region 小程序虚拟支付 + /// + /// 道具发货推送 + /// + xpay_goods_deliver_notify, + + /// + /// 代币支付推送 + /// + xpay_coin_pay_notify, + + /// + /// 退款推送 + /// + xpay_refund_notify, + #endregion } ///// diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs index ee2f974cd1..aa725d7352 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs @@ -127,6 +127,19 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ case Event.trade_manage_remind_shipping: responseMessage = OnEvent_TradeManageRemindShipping(RequestMessage as RequestMessageEvent_TradeManageRemindShipping); break; + + #region 小程序虚拟支付 + case Event.xpay_goods_deliver_notify: + responseMessage = OnEvent_XPayGoodsDeliverNotify(RequestMessage as RequestMessageEvent_XPayGoodsDeliverNotify); + break; + case Event.xpay_coin_pay_notify: + responseMessage = OnEvent_XPayCoinPayNotify(RequestMessage as RequestMessageEvent_XPayCoinPayNotify); + break; + case Event.xpay_refund_notify: + responseMessage = OnEvent_XPayRefundNotify(RequestMessage as RequestMessageEvent_XPayRefundNotify); + break; + #endregion + default: throw new UnknownRequestMsgTypeException("未知的Event下属请求信息", null); } @@ -297,6 +310,21 @@ public virtual IResponseMessageBase OnEvent_MediaCheckRequest(RequestMessageEven return DefaultResponseMessage(requestMessage); } + #region 小程序虚拟支付 + public virtual IResponseMessageBase OnEvent_XPayGoodsDeliverNotify(RequestMessageEvent_XPayGoodsDeliverNotify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + public virtual IResponseMessageBase OnEvent_XPayCoinPayNotify(RequestMessageEvent_XPayCoinPayNotify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + public virtual IResponseMessageBase OnEvent_XPayRefundNotify(RequestMessageEvent_XPayRefundNotify requestMessage) + { + return DefaultResponseMessage(requestMessage); + } + #endregion + #endregion #endregion @@ -361,6 +389,19 @@ public virtual async Task OnEventRequestAsync(IRequestMess case Event.trade_manage_remind_shipping: responseMessage = await OnEvent_TradeManageRemindShippingAsync(RequestMessage as RequestMessageEvent_TradeManageRemindShipping); break; + + #region 小程序虚拟支付 + case Event.xpay_goods_deliver_notify: + responseMessage = await OnEvent_XPayGoodsDeliverNotifyAsync(RequestMessage as RequestMessageEvent_XPayGoodsDeliverNotify); + break; + case Event.xpay_coin_pay_notify: + responseMessage = await OnEvent_XPayCoinPayNotifyAsync(RequestMessage as RequestMessageEvent_XPayCoinPayNotify); + break; + case Event.xpay_refund_notify: + responseMessage = await OnEvent_XPayRefundNotifyAsync(RequestMessage as RequestMessageEvent_XPayRefundNotify); + break; + #endregion + default: throw new UnknownRequestMsgTypeException("未知的Event下属请求信息", null); } @@ -531,6 +572,39 @@ public virtual async Task OnEvent_MediaCheckRequestAsync(R return await DefaultAsyncMethod(requestMessage, () => OnEvent_MediaCheckRequest(requestMessage)).ConfigureAwait(false); } + #region 小程序虚拟支付 + + /// + /// 小程序虚拟支付 - 道具发货推送 + /// + /// + /// + public virtual async Task OnEvent_XPayGoodsDeliverNotifyAsync(RequestMessageEvent_XPayGoodsDeliverNotify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPayGoodsDeliverNotify(requestMessage)).ConfigureAwait(false); + } + + /// + /// 小程序虚拟支付 - 代币支付推送 + /// + /// + /// + public virtual async Task OnEvent_XPayCoinPayNotifyAsync(RequestMessageEvent_XPayCoinPayNotify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPayCoinPayNotify(requestMessage)).ConfigureAwait(false); + } + + /// + /// 小程序虚拟支付 - 退款推送 + /// + /// + /// + public virtual async Task OnEvent_XPayRefundNotifyAsync(RequestMessageEvent_XPayRefundNotify requestMessage) + { + return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPayRefundNotify(requestMessage)).ConfigureAwait(false); + } + #endregion + #endregion #endregion From 6cf0729a77d1617a267b800a92e9611aa9feca54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Fri, 1 Dec 2023 14:39:19 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=95=86=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=20V3=E9=80=80=E6=AC=BE=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20=E6=8F=90=E7=A4=BA=E7=BC=BA=E5=B0=91sub=5Fmchid=20#?= =?UTF-8?q?2954?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs | 2 +- .../Apis/BasePay/Entities/RequestData/RefundQueryRequestData.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs index 21ff1b3955..2349c0706f 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs @@ -598,7 +598,7 @@ public async Task RefundAsync(RefundRequestData data, int time /// /// 查询单笔退款接口 /// - /// 商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。示例值:1217752501201407033233368018 + /// 请求数据 /// 超时时间,单位为ms /// public async Task RefundQueryAsync(RefundQueryRequestData data, int timeOut = Config.TIME_OUT) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundQueryRequestData.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundQueryRequestData.cs index d5a59247f1..399f97d538 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundQueryRequestData.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/Entities/RequestData/RefundQueryRequestData.cs @@ -73,7 +73,6 @@ public RefundQueryRequestData(string sub_mchid, string out_refund_no) /// 子商户的商户号,由微信支付生成并下发。 /// 示例值:1900000109 /// - [JsonIgnore] public string sub_mchid { get; set; } #endregion From 07244170a1469e8bb8d47777992601bc324d2dc1 Mon Sep 17 00:00:00 2001 From: ConanYao Date: Sat, 2 Dec 2023 05:33:14 +0800 Subject: [PATCH 09/13] update SelfMenuFull_ButtonGroup model for SelfMenuConfigResult --- .../JsonResult/Menu/GetMenuResultFull.cs | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs index c12590cffb..f84208e749 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs @@ -84,7 +84,9 @@ public class MenuFull_RootButton public List sub_button { get; set; } + } + #endregion #region Conditional(个性化菜单)相关 @@ -93,6 +95,38 @@ public class MenuTryMatchResult : WxJsonResult public List button { get; set; } } + public class SelfMenuFull_ButtonGroup + { + public List button { get; set; } + } + public class SelfMenuFull_RootButton + { + public string type { get; set; } + public string key { get; set; } + public string name { get; set; } + public string url { get; set; } + + public NewsInfo news_info { get; set; } + + #region 小程序 + + public string appid { get; set; } + public string pagepath { get; set; } + + #endregion + + public string media_id { get; set; } + + public string article_id { get; set; } + + + public Sub_Button sub_button { get; set; } + + } + public class Sub_Button + { + public List list { get; set; } + } /// /// 自定义菜单配置 /// @@ -106,7 +140,7 @@ public class SelfMenuConfigResult : WxJsonResult /// /// 菜单信息 /// - public MenuFull_ButtonGroup selfmenu_info { get; set; } + public SelfMenuFull_ButtonGroup selfmenu_info { get; set; } } From a494239d70f2be091900685d6cc4f2960a08c387 Mon Sep 17 00:00:00 2001 From: ConanYao Date: Sat, 2 Dec 2023 05:44:27 +0800 Subject: [PATCH 10/13] Add GetCurrentSelfMenuInfoTest TestMethod --- .../CommonApis/CommonJsonSendTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs index f083d2b758..57b4e0c3f0 100644 --- a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs +++ b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs @@ -1,4 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; +using Senparc.Weixin.MP.CommonAPIs; using System; using System.Collections.Generic; using System.Text; @@ -33,5 +34,18 @@ public void SendThrowTest() Senparc.Weixin.Config.ThrownWhenJsonResultFaild = true;//还原 } + + [TestMethod] + public void GetCurrentSelfMenuInfoTest() + { + var result = CommonApi.GetCurrentSelfMenuInfo("75_eGhUgdbNzwM8IcroXssnKN4sP9QSWPcMJUJe5Ka3UTTisGP_UorAZYLb1UCZyQtdsp798EwLdbURX-cfdbacKB-IuDJ_QHMnjTHYANlch3h8_YRAw_oyfZ4mwf8LODdACAUXM"); + + Console.WriteLine(result); + if (result.ErrorCodeValue == 0) + { + Assert.IsTrue(true); + } + Assert.IsTrue(false); + } } } From 503e2e06eddb0578165d754cb133c8fa2d7a379f Mon Sep 17 00:00:00 2001 From: ConanYao Date: Sat, 2 Dec 2023 05:50:43 +0800 Subject: [PATCH 11/13] update TestMethod --- .../CommonApis/CommonJsonSendTests.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs index 57b4e0c3f0..2a7004f30a 100644 --- a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs +++ b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs @@ -1,4 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; +using Senparc.Weixin.MP; using Senparc.Weixin.MP.CommonAPIs; using System; using System.Collections.Generic; @@ -45,7 +46,23 @@ public void GetCurrentSelfMenuInfoTest() { Assert.IsTrue(true); } - Assert.IsTrue(false); + else + { + Assert.IsTrue(false); + } + + string json = "{\"is_menu_open\":1,\"selfmenu_info\":{\"button\":[{\"type\":\"click\",\"name\":\"今日歌曲\",\"key\":\"V1001_TODAY_MUSIC\"},{\"name\":\"菜单\",\"sub_button\":{\"list\":[{\"type\":\"view\",\"name\":\"搜索\",\"url\":\"http:\\/\\/www.soso.com\\/\"},{\"type\":\"click\",\"name\":\"赞一下我们\",\"key\":\"V1001_GOOD\"}]}}]}}"; + try + { + var test = Newtonsoft.Json.JsonConvert.DeserializeObject(json); + Console.WriteLine(test); + Assert.IsTrue(true); + } + catch (Exception) + { + Assert.IsTrue(false); + throw; + } } } } From a3f015a4a6cea998fa6b84ce11b215320e80848c Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Sat, 2 Dec 2023 23:01:20 +0800 Subject: [PATCH 12/13] =?UTF-8?q?WxOpen=20v3.17.2=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E2=80=9C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=99=9A=E6=8B=9F=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E2=80=9D=E5=8A=9F=E8=83=BD=20PR=20#2961=20/=20Issue?= =?UTF-8?q?=20#2951=20=E6=84=9F=E8=B0=A2=20@mojinxun=20@WanderingGrass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs | 3 --- .../MessageHandlers/Async/MessageHandlerAsync.Event.cs | 3 --- .../Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs | 3 --- .../src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs | 3 +++ .../MessageHandlers/WxOpenMessageHandler.Event.cs | 3 +++ .../Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj | 3 ++- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs index 33e0c39199..5a54469863 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs @@ -102,9 +102,6 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 Event.submit_invoice_title - 修改标识:Senparc - 20231130 - 修改描述:v16.20.2 Event 添加“小程序虚拟支付”相关枚举 - ----------------------------------------------------------------*/ using System; diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs index 79fbb95db4..91a73dedf3 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async/MessageHandlerAsync.Event.cs @@ -33,9 +33,6 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 OnEvent_Submit_Invoice_TitleAsync() 方法 - 修改标识:Senparc - 20231130 - 修改描述:v16.20.2 添加“小程序虚拟支付”相关事件 - ----------------------------------------------------------------*/ using Senparc.NeuChar.Entities; diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs index 7635baa2b6..f55587894a 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/MessageHandler.Event.cs @@ -36,9 +36,6 @@ and limitations under the License. 修改标识:lishewen - 20210809 修改描述:v16.14.2 添加 OnEvent_Submit_Invoice_Title() 方法 - 修改标识:Senparc - 20231130 - 修改描述:v16.20.2 添加“小程序虚拟支付”相关事件 - ----------------------------------------------------------------*/ using Senparc.NeuChar.Entities; diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs index d2ffb534c0..4d9ca3e88f 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Enums.cs @@ -36,6 +36,9 @@ and limitations under the License. 修改标识:chinanhb - 20230529 修改描述:运单轨迹更新事件推送,增加 Event.add_express_path 枚举值 + 修改标识:Senparc - 20231202 + 修改描述:v3.17.2 Event 添加“小程序虚拟支付”相关枚举 + ----------------------------------------------------------------*/ using System.ComponentModel; diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs index aa725d7352..c36b79abf2 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.Event.cs @@ -53,6 +53,9 @@ and limitations under the License. 修改标识:mc7246 - 20230831 修改描述:添加小程序发货信息管理服务事件推送 添加OnEvent_TradeManageRemindAccessApi()、OnEvent_TradeManageOrderSettlement()、OnEvent_TradeManageRemindShipping()方法 + 修改标识:Senparc - 20231130 + 修改描述:v3.17.2 添加“小程序虚拟支付”相关事件 + ----------------------------------------------------------------*/ using Senparc.NeuChar.Entities; diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj index 403323090b..b9c9f21d40 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 3.17.1 + 3.17.2 9.0 Senparc.Weixin.WxOpen Senparc.Weixin.WxOpen @@ -176,6 +176,7 @@ v3.16.0 客服接口支持长文本自动切割后连续发送 v3.16.4 微信已于2023 年 9 月 20 日收回下发统一消息接口,标注过时 PR #2921 v3.17.1 添加 CodeApi.RevertCodeRelease() 方法的 appVersion 参数 + v3.17.2 添加“小程序虚拟支付”功能 PR #2961 / Issue #2951 https://github.com/JeffreySu/WeiXinMPSDK From 5ed4239196378da5819f6cfa7c48dc06907361e9 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Sat, 2 Dec 2023 23:17:39 +0800 Subject: [PATCH 13/13] =?UTF-8?q?MP=20v16.20.2=20fix=20bug:=20self=20menu?= =?UTF-8?q?=20onfig=20result.=20PR=20#2963=20/=20Issue=20#2804=20=E6=84=9F?= =?UTF-8?q?=E8=B0=A2=20@JaneConan=20@funvh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommonAPIs/CommonApiTest.Menu.cs | 32 ++++++++++++++ .../JsonResult/Menu/GetMenuResultFull.cs | 3 ++ .../Senparc.Weixin.MP.net8.csproj | 2 +- .../Senparc.WeixinTests/BaseTest.cs | 8 ++-- .../CommonApis/CommonJsonSendTests.cs | 43 +++---------------- 5 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CommonAPIs/CommonApiTest.Menu.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CommonAPIs/CommonApiTest.Menu.cs index 5ee08bff78..6c31da96d2 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CommonAPIs/CommonApiTest.Menu.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP.Test/CommonAPIs/CommonApiTest.Menu.cs @@ -150,5 +150,37 @@ public void DeleteMenuTest() Assert.IsNotNull(result); Assert.AreEqual("ok", result.errmsg); } + + + [TestMethod] + public void GetCurrentSelfMenuInfoTest() + { + var appIdOrFackAccessToken = base._senparcWeixinSetting.WeixinAppId;// "75_eGhUgdbNzwM8IcroXssnKN4sP9QSWPcMJUJe5Ka3UTTisGP_UorAZYLb1UCZyQtdsp798EwLdbURX-cfdbacKB-IuDJ_QHMnjTHYANlch3h8_YRAw_oyfZ4mwf8LODdACAUXM";//错误的AccessToken + + var result = CommonApi.GetCurrentSelfMenuInfo(appIdOrFackAccessToken); + + Console.WriteLine(result); + if (result.ErrorCodeValue == 0) + { + Assert.IsTrue(true); + } + else + { + Assert.IsTrue(false); + } + + string json = "{\"is_menu_open\":1,\"selfmenu_info\":{\"button\":[{\"type\":\"click\",\"name\":\"今日歌曲\",\"key\":\"V1001_TODAY_MUSIC\"},{\"name\":\"菜单\",\"sub_button\":{\"list\":[{\"type\":\"view\",\"name\":\"搜索\",\"url\":\"http:\\/\\/www.soso.com\\/\"},{\"type\":\"click\",\"name\":\"赞一下我们\",\"key\":\"V1001_GOOD\"}]}}]}}"; + try + { + var test = Newtonsoft.Json.JsonConvert.DeserializeObject(json); + Console.WriteLine(test); + Assert.IsTrue(true); + } + catch (Exception) + { + Assert.IsTrue(false); + throw; + } + } } } diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs index f84208e749..ad616b5569 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu/GetMenuResultFull.cs @@ -33,6 +33,9 @@ and limitations under the License. 修改标识:JaneConan - 20230417 修改描述:v16.18.10.7 修复自定义菜单实体问题 + 修改标识:Senparc - 20231202 + 修改描述:v16.20.2 fix bug: self menu onfig result. PR #2963 / Issue #2804 + ----------------------------------------------------------------*/ using System.Collections.Generic; diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj index b46bee0ff1..3a89e17c92 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj @@ -527,7 +527,7 @@ v16.18.14 JSSDKHelper.GetNoncestr() 弃用 MD5 加密方法 v16.19.0 MessageHandler 和客服接口支持长文本自动切割后连续发送 v16.20.1 添加 TemplateApi.AddTemplate() 参数 - v16.20.2 添加“小程序虚拟支付 ”功能 + v16.20.2 fix bug: self menu onfig result. PR #2963 / Issue #2804 https://github.com/JeffreySu/WeiXinMPSDK diff --git a/src/Senparc.Weixin.MP/Senparc.WeixinTests/BaseTest.cs b/src/Senparc.Weixin.MP/Senparc.WeixinTests/BaseTest.cs index 0bde60e25d..f9d36d51e8 100644 --- a/src/Senparc.Weixin.MP/Senparc.WeixinTests/BaseTest.cs +++ b/src/Senparc.Weixin.MP/Senparc.WeixinTests/BaseTest.cs @@ -26,9 +26,9 @@ namespace Senparc.WeixinTests /// public class BaseTest { - protected static IServiceProvider _serviceProvider; - protected static SenparcSetting _senparcSetting; - protected static SenparcWeixinSetting _senparcWeixinSetting; + protected IServiceProvider _serviceProvider; + protected SenparcSetting _senparcSetting; + protected SenparcWeixinSetting _senparcWeixinSetting; public BaseTest() { @@ -85,7 +85,7 @@ protected void RegisterStart() /// /// 注册 IServiceCollection 和 MemoryCache /// - public static void RegisterServiceCollection() + public void RegisterServiceCollection() { var serviceCollection = new ServiceCollection(); var configBuilder = new ConfigurationBuilder(); diff --git a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs index 2a7004f30a..ddd853b8d9 100644 --- a/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs +++ b/src/Senparc.Weixin.MP/Senparc.WeixinTests/CommonApis/CommonJsonSendTests.cs @@ -1,9 +1,5 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Senparc.Weixin.MP; -using Senparc.Weixin.MP.CommonAPIs; -using System; -using System.Collections.Generic; -using System.Text; +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Senparc.WeixinTests.vs2017.CommonApis { @@ -13,11 +9,12 @@ public class CommonJsonSendTests : BaseTest [TestMethod] public void SendThrowTest() { - var fakeAccessToken = "22_q1nIlrqQ1brYqvp-8xPV3eIWWSJ9LU_qCxs3AaTMVjv74WyD1XDovWi4SkMX6xfykOCMoobaVpzu-lspCsCWIo5u6DGw31tS3ZmFw4q7wEDkXOmBaTtCeQuhlvhsalkenoRCKTLckTnVCkXbTWZlCJANQT1";//错误的AccessToken + var appIdOrFackAccessToken = base._senparcWeixinSetting.WeixinAppId;// "22_q1nIlrqQ1brYqvp-8xPV3eIWWSJ9LU_qCxs3AaTMVjv74WyD1XDovWi4SkMX6xfykOCMoobaVpzu-lspCsCWIo5u6DGw31tS3ZmFw4q7wEDkXOmBaTtCeQuhlvhsalkenoRCKTLckTnVCkXbTWZlCJANQT1";//错误的AccessToken + try { //Senparc.Weixin.Config.ThrownWhenJsonResultFaild = true;//抛出异常(默认就是true) - var result = Senparc.Weixin.MP.AdvancedAPIs.UrlApi.ShortUrl(fakeAccessToken, "long2short", "https://sdk.weixin.senparc.com"); + var result = Senparc.Weixin.MP.AdvancedAPIs.UrlApi.ShortUrl(appIdOrFackAccessToken, "long2short", "https://sdk.weixin.senparc.com"); Console.WriteLine("不应该到达这里"); Assert.Fail();//不应该到达这里 } @@ -30,39 +27,11 @@ public void SendThrowTest() Senparc.Weixin.Config.ThrownWhenJsonResultFaild = false;//不抛出异常 - var result2 = Senparc.Weixin.MP.AdvancedAPIs.UrlApi.ShortUrl(fakeAccessToken, "long2short", "https://sdk.weixin.senparc.com"); + var result2 = Senparc.Weixin.MP.AdvancedAPIs.UrlApi.ShortUrl(appIdOrFackAccessToken, "long2short", "https://sdk.weixin.senparc.com"); Console.WriteLine(result2); Senparc.Weixin.Config.ThrownWhenJsonResultFaild = true;//还原 } - [TestMethod] - public void GetCurrentSelfMenuInfoTest() - { - var result = CommonApi.GetCurrentSelfMenuInfo("75_eGhUgdbNzwM8IcroXssnKN4sP9QSWPcMJUJe5Ka3UTTisGP_UorAZYLb1UCZyQtdsp798EwLdbURX-cfdbacKB-IuDJ_QHMnjTHYANlch3h8_YRAw_oyfZ4mwf8LODdACAUXM"); - - Console.WriteLine(result); - if (result.ErrorCodeValue == 0) - { - Assert.IsTrue(true); - } - else - { - Assert.IsTrue(false); - } - - string json = "{\"is_menu_open\":1,\"selfmenu_info\":{\"button\":[{\"type\":\"click\",\"name\":\"今日歌曲\",\"key\":\"V1001_TODAY_MUSIC\"},{\"name\":\"菜单\",\"sub_button\":{\"list\":[{\"type\":\"view\",\"name\":\"搜索\",\"url\":\"http:\\/\\/www.soso.com\\/\"},{\"type\":\"click\",\"name\":\"赞一下我们\",\"key\":\"V1001_GOOD\"}]}}]}}"; - try - { - var test = Newtonsoft.Json.JsonConvert.DeserializeObject(json); - Console.WriteLine(test); - Assert.IsTrue(true); - } - catch (Exception) - { - Assert.IsTrue(false); - throw; - } - } } }