Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

微信支付付款码支付接口添加服务商模式支持#3686

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intodevelop
base:develop
Choose a base branch
Loading
fromcopilot/fix-3676

Conversation

Copy link
Contributor

CopilotAI commentedAug 31, 2025
edited
Loading

当前WxPayCodepayRequest 类仅支持直连商户模式,缺少服务商模式支持,服务商模式需要sub_mch_id 参数。在服务商模式下使用付款码支付接口时,用户会遇到以下错误:

受理机构必须传入sub_mch_id

本PR所做的更改:

  1. WxPayCodepayRequest 添加服务商模式字段:

    • sp_appid - 服务商应用ID
    • sp_mchid - 服务商商户号
    • sub_appid - 子商户应用ID
    • sub_mchid - 子商户号(解决问题的关键字段)
  2. 更新服务实现以支持两种模式:

    • 当设置了sp_appidsp_mchidsub_mchid 中的任意一个时,自动检测为服务商模式
    • 服务商模式使用合作伙伴API端点/v3/pay/partner/transactions/codepay
    • 直连商户模式使用直连API端点/v3/pay/transactions/codepay
    • 自动从WxPayConfig 填充缺失的字段

向后兼容性

本实现保持向后兼容性 - 现有的直连商户模式用法保持不变。服务商模式的使用示例:

WxPayCodepayRequestrequest =newWxPayCodepayRequest();request.setSpMchid("17085xxxxx");request.setSubMchid("1230000109");// 这是之前缺失的导致错误的字段request.setDescription("订单支付");request.setOutTradeNo("1234567890");// ... 其他字段WxPayCodepayResultresult =wxPayService.codepay(request);

修复#3676


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
CopilotAI changed the title[WIP] 微信支付在服务商模式下使用codepay接口时,会报缺少sub_mch_id参数错误Add service provider mode support for WeChat Pay codepay interfaceAug 31, 2025
CopilotAI requested a review frombinarywangAugust 31, 2025 14:59
@binarywangbinarywang added this to the4.7.9 milestoneSep 24, 2025
@binarywangbinarywang modified the milestones:4.7.9,4.8.0Nov 27, 2025
@binarywang
Copy link
Owner

@copilot 请用中文改下描述文字,包括PR的标题

Copy link
ContributorAuthor

@copilot 请用中文改下描述文字,包括PR的标题

已将PR描述更新为中文。关于PR标题,由于工具限制无法直接修改,需要您手动将标题改为:「微信支付付款码支付接口添加服务商模式支持」

CopilotAI changed the titleAdd service provider mode support for WeChat Pay codepay interface微信支付付款码支付接口添加服务商模式支持Nov 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@binarywangbinarywangAwaiting requested review from binarywang

Labels

None yet

Projects

None yet

Milestone

4.8.0

Development

Successfully merging this pull request may close these issues.

2 participants

@binarywang

[8]ページ先頭

©2009-2025 Movatter.jp