Skip to content

feat(virtualpayment): ✨ 添加 postJSONBytesContext 函数并更新相关调用 解决body签名不一致问题 - #886

Merged
silenceper merged 11 commits into
silenceper:v2from
wwek:v2
Jun 3, 2026
Merged

silenceper merged 11 commits into
silenceper:v2from
wwek:v2

Conversation

@wwek

@wwek wwek commented May 22, 2026

Copy link
Copy Markdown
Contributor

feat(virtualpayment): ✨ 添加 postJSONBytesContext 函数并更新相关调用 解决body签名不一致问题
fix #884
71be7e6
5904211

@wwek wwek closed this May 22, 2026
@wwek wwek reopened this May 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本次 PR 针对 miniprogram/virtualpayment 模块中“请求 body 的签名内容与实际发送 body 不一致”问题进行修复:将原先由 util.PostJSONContext(ctx, ..., in) 在内部重新编码 JSON 的方式,替换为直接发送已用于签名的 jsonByte,从而保证签名与请求体字节级一致,解决虚拟支付部分接口(如退款)出现签名异常/pay_sig 为空的问题(关联 #884)。

Changes:

  • 新增 postJSONBytesContext:以固定 Content-Type 直接 POST 已生成的 JSON bytes。
  • 将 virtualpayment 相关接口的请求发送逻辑从 util.PostJSONContext(..., in) 统一替换为 postJSONBytesContext(..., jsonByte),确保签名与 body 一致。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

将 ShowSplashAd 从 bool 改为 *bool,解决 omitempty 导致 false 值
被当作零值省略的问题。微信 API 默认值为 true(展示广告),传 false
无法关闭封面广告。

Closes silenceper#882
@silenceper
silenceper merged commit d34af7a into silenceper:v2 Jun 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 虚拟支付退款pay_sig为空

3 participants