Skip to content

fix issue #4050: 处理codepay接口返回202状态码导致响应异常#4054

Open
wdmic wants to merge 1 commit into
binarywang:developfrom
wdmic:develop
Open

fix issue #4050: 处理codepay接口返回202状态码导致响应异常#4054
wdmic wants to merge 1 commit into
binarywang:developfrom
wdmic:develop

Conversation

@wdmic

@wdmic wdmic commented Jun 13, 2026

Copy link
Copy Markdown

No description provided.

@binarywang

Copy link
Copy Markdown
Owner

@codex auggie review

@augmentcode

augmentcode Bot commented Jun 13, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: 修复 issue #4050:codepay 接口返回 202(Accepted)时被当作异常处理的问题。

Changes: 在 Apache HttpClient 与 HttpComponents 两个实现中,将 /codepay 的 202 状态码纳入成功分支并直接返回响应内容,避免抛出异常。

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode
|| (HttpStatus.SC_ACCEPTED == statusCode && url.endsWith("/codepay"))) {

@augmentcode augmentcode Bot Jun 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WxPayServiceApacheHttpImpl.java:179 这里通过 url.endsWith("/codepay") 判断 codepay,若调用方传入的 URL 末尾带 / 或携带 query 参数,条件可能不命中从而 202 仍会被当作异常处理。可以确认下 postV3WithWechatpaySerialurl 是否在所有调用路径上都保证规范化到不含 query/尾斜杠。

Severity: low

Other Locations
  • weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceHttpComponentsImpl.java:176

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: d0623a460f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants