补充小程序发货信息消息推送字段 - #3799
Conversation
There was a problem hiding this comment.
Pull request overview
此 PR 为微信小程序发货信息管理功能补充消息推送字段,支持订单发货和结算事件的完整信息接收。实现了微信官方文档中定义的发货信息推送协议,使开发者能够接收订单发货提醒和结算通知。
主要变更:
- 在 WxMaMessage 类中新增 11 个发货相关字段,包括支付订单信息、商户信息、发货时间、结算时间等
- 在 WxConsts.EventType 中新增两个事件类型常量:发货提醒事件和订单结算事件
- 修正了部分代码格式问题,统一了常量声明的空格风格
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java | 新增 11 个字段支持发货信息消息推送,包括交易订单号、商户信息、支付/发货/结算时间等字段 |
| weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java | 新增 TRADE_MANAGE_REMIND_SHIPPING 和 TRADE_MANAGE_ORDER_SETTLEMENT 两个事件类型常量,并修正部分格式问题 |
| /** | ||
| * 微信支付订单号 | ||
| */ | ||
| @XStreamAlias("transaction_id") | ||
| private String transactionId; | ||
| /** | ||
| * 商户号 | ||
| */ | ||
| @XStreamAlias("merchant_id") | ||
| private String merchantId; | ||
| /** | ||
| * 子商户号 | ||
| */ | ||
| @XStreamAlias("sub_merchant_id") | ||
| private String subMerchantId; | ||
| /** | ||
| * 商户订单号 | ||
| */ | ||
| @XStreamAlias("merchant_trade_no") | ||
| private String merchantTradeNo; | ||
| /** | ||
| * 支付成功时间,秒级时间戳 | ||
| */ | ||
| @XStreamAlias("pay_time") | ||
| private Long payTime; | ||
| /** | ||
| * 消息文本内容 | ||
| */ | ||
| @XStreamAlias("msg") | ||
| private String msg; | ||
| /** | ||
| * 支付成功时间,秒级时间戳 | ||
| */ | ||
| @XStreamAlias("shipped_time") | ||
| private Long shippedTime; | ||
| /** | ||
| * 预计结算时间,秒级时间戳。发货时推送才有该字段 | ||
| */ | ||
| @XStreamAlias("estimated_settlement_time") | ||
| private Long estimatedSettlementTime; | ||
| /** | ||
| * 确认收货方式:1. 手动确认收货;2. 自动确认收货。结算时推送才有该字段 | ||
| */ | ||
| @XStreamAlias("confirm_receive_method") | ||
| private Integer confirmReceiveMethod; | ||
| /** | ||
| * 确认收货时间,秒级时间戳。结算时推送才有该字段 | ||
| */ | ||
| @XStreamAlias("confirm_receive_time") | ||
| private Long confirmReceiveTime; | ||
| /** | ||
| * 订单结算时间,秒级时间戳。结算时推送才有该字段 | ||
| */ | ||
| @XStreamAlias("settlement_time") | ||
| private Long settlementTime; |
There was a problem hiding this comment.
缺少对新增发货信息字段的测试覆盖。建议在 WxMaMessageTest.java 中添加针对 TRADE_MANAGE_REMIND_SHIPPING 和 TRADE_MANAGE_ORDER_SETTLEMENT 事件的测试用例,验证这些新字段(transactionId, merchantId, subMerchantId, merchantTradeNo, payTime, msg, shippedTime, estimatedSettlementTime, confirmReceiveMethod, confirmReceiveTime, settlementTime)能够正确解析。可以参考现有的 testSubscribeMsgPopupEvent() 和 testFromXmlForOpenProductOrderPayEvent() 方法的测试模式。
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…WxConsts.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html