补充小程序虚拟支付 xpay_complaint_notify 投诉推送事件支持#3963
Conversation
|
@copilot 主要是解决这个问题:#3961 (comment) |
Agent-Logs-Url: https://github.com/binarywang/WxJava/sessions/b157a484-8781-4f33-9556-a608aef37d78 Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Agent-Logs-Url: https://github.com/binarywang/WxJava/sessions/b157a484-8781-4f33-9556-a608aef37d78 Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
已确认签名大小写问题在本 PR 中已修复:
|
🤖 Augment PR SummarySummary: This PR adds missing parsing support for the Miniapp virtual payment complaint notification event. Changes:
Technical Notes: The change is primarily about wire-format compatibility (JSON/XML key casing + new event fields) and is validated via new JUnit tests. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
为小程序虚拟支付的 xpay_complaint_notify(用户投诉推送)事件补齐消息解析能力,完善 XML/JSON 两种推送格式下的字段映射,并通过单元测试覆盖关键字段解析。
Changes:
- 在
WxMaConstants.XPayNotifyEvent中新增COMPLAINT = "xpay_complaint_notify"事件常量 - 在
WxMaMessage中新增投诉推送相关字段,并增强openId对OpenId/OpenID的 JSON 兼容解析 - 在
XStreamTransformer中补充OpenId的 XML 别名映射,并新增对应 XML/JSON 解析测试用例
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaConstants.java | 增加投诉推送事件常量,便于事件路由/判断 |
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java | 增加投诉推送字段并增强 openId 的 JSON 反序列化兼容性 |
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/util/xml/XStreamTransformer.java | 为 XML 推送补充 OpenId -> openId 别名映射 |
| weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaMessageTest.java | 新增投诉推送 XML/JSON 解析测试,覆盖新增字段与 OpenId 映射 |
…stant/WxMaConstants.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
WxMaXPayService服务端 API 已完整实现,但xpay_complaint_notify(用户投诉推送)消息事件的解析支持缺失。变更内容
WxMaConstants.XPayNotifyEvent— 新增COMPLAINT = "xpay_complaint_notify"常量,与COIN_PAY、GOODS_DELIVER、REFUND对齐WxMaMessage— 新增投诉推送专用字段:complaintTransactionIdTransactionId)complaintIdComplaintId)complaintDetailComplaintDetail)complaintTimeComplaintTime)requestIdRequestId)同时将
openId的@SerializedName改为支持OpenId/OpenID两种大小写形式(JSON),修复 xpay 事件中大小写不一致导致的解析缺陷。XStreamTransformer— 注册OpenIdXML 别名,使 XML 格式推送中的OpenId也能正确映射到openId字段(与已有的MsgID/MsgId处理方式一致)WxMaMessageTest— 新增testXPayComplaintNotifyFromXml()和testXPayComplaintNotifyFromJson(),覆盖全字段解析