From 07e5a1a03aff35ec5f7751cf814e7d29980d7de5 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Jun 2022 22:27:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=AE=A2=E5=8D=95=E5=BD=92=E5=9B=A0=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=9B=9E=E8=B0=83=E9=80=9A=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenProductOrderAnalyzeEvent.cs | 47 +++++++++++++++++++ .../OpenProductOrderAnalyzeEvent.xml | 12 +++++ 2 files changed, 59 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductOrderAnalyzeEvent.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductOrderAnalyzeEvent.xml diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductOrderAnalyzeEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductOrderAnalyzeEvent.cs new file mode 100644 index 00000000..e7373df0 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductOrderAnalyzeEvent.cs @@ -0,0 +1,47 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.open_product_order_analyze 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/order_analyze.html + /// + public class OpenProductOrderAnalyzeEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class EventData + { + /// + /// 获取或设置商家自定义订单号。 + /// + [Newtonsoft.Json.JsonProperty("out_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_order_id")] + [System.Xml.Serialization.XmlElement("out_order_id")] + public string OutOrderId { get; set; } = default!; + + /// + /// 获取或设置订单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + [System.Xml.Serialization.XmlElement("order_id")] + public long OrderId { get; set; } + + /// + /// 获取或设置用户的 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + [System.Xml.Serialization.XmlElement("openid")] + public string OpenId { get; set; } = default!; + } + } + + /// + /// 获取或设置事件数据。 + /// + [Newtonsoft.Json.JsonProperty("order_info")] + [System.Text.Json.Serialization.JsonPropertyName("order_info")] + [System.Xml.Serialization.XmlElement("order_info")] + public Types.EventData EventData { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductOrderAnalyzeEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductOrderAnalyzeEvent.xml new file mode 100644 index 00000000..1f2f01e1 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductOrderAnalyzeEvent.xml @@ -0,0 +1,12 @@ + + + + 1651145445 + + + + 3302922000692805632 + + + +