-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
feat(miniapp): Add xpay_subscribe_ios_refund_query_notify event support #3974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -464,6 +464,80 @@ public class WxMaMessage implements Serializable { | |||||||
| @XStreamConverter(value = XStreamCDataConverter.class) | ||||||||
| private String requestId; | ||||||||
|
|
||||||||
| // xpay_subscribe_ios_refund_query_notify iOS退款查询通知字段 | ||||||||
|
|
||||||||
| /** | ||||||||
| * 问询时间,Unix时间戳. | ||||||||
| * xpay_subscribe_ios_refund_query_notify | ||||||||
| */ | ||||||||
| @SerializedName("refund_time") | ||||||||
| @XStreamAlias("refund_time") | ||||||||
| @XStreamConverter(value = XStreamCDataConverter.class) | ||||||||
| private String refundTime; | ||||||||
|
Comment on lines
+475
to
+476
|
||||||||
| @XStreamConverter(value = XStreamCDataConverter.class) | |
| private String refundTime; | |
| private Long refundTime; |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order_time 同样是 Unix 时间戳字段,目前用 String 表达会弱化类型信息且与本类既有的 Long 时间戳字段不一致。建议将 orderTime 改为 Long,并去掉 XStreamCDataConverter(如果需要兼容字符串/数值两种 JSON 表达,可保留 Long 并依赖 Gson/XStream 的数值解析能力),同时调整对应测试。
| @XStreamConverter(value = XStreamCDataConverter.class) | |
| private String orderTime; | |
| private Long orderTime; |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p_count 是数量字段(数值语义),目前用 String 建模不利于后续做数值比较/计算,也与本类中类似字段(如 RefundFee/RetryTimes 等 Integer)不一致。建议将 pCount 改为 Integer,并移除 XStreamCDataConverter,同时更新解析测试断言。
| @XStreamConverter(value = XStreamCDataConverter.class) | |
| private String pCount; | |
| private Integer pCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WxMaMessage.java:539 — The WeChat spec for WxaVirtualPayIosRefundQueryNotifyEvent also includes pay_order_id (退款对应支付订单号), but there’s no corresponding field here, so callers can’t read that value.
Severity: medium
Other Locations
weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaMessageTest.java:479weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaMessageTest.java:504weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaMessageTest.java:516
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provide_status 表示枚举状态(0/1/2),建议用 Integer 而不是 String 来建模,避免调用方自行解析且与本类其它状态字段(如 retCode/teamType 等 Integer)保持一致;相应可移除 XStreamCDataConverter 并更新测试断言。
| @XStreamConverter(value = XStreamCDataConverter.class) | |
| private String provideStatus; | |
| private Integer provideStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
仓库里小程序虚拟支付通知事件名已在 WxMaConstants.XPayNotifyEvent 中集中维护(含 xpay_refund_notify/xpay_complaint_notify 等)。这里单独在 WxConsts.EventType 新增一个 XPAY_* 常量会造成事件常量来源分散;建议要么把该事件也补充到 WxMaConstants.XPayNotifyEvent 并在 miniapp 场景统一使用它,要么在 WxConsts 中补齐同类 XPAY 通知常量以保持一致。