Skip to content

Add missing sub_mchid and sub_appid fields to CombineCloseRequest.SubOrders #3656

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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 24, 2025

The CombineCloseRequest.SubOrders class was missing two required fields for WeChat Pay Combined Payment Close Order API, causing 403 NOAUTH errors when calling the API.

Problem

When using the Combined Payment Close Order API (合单支付 - 关闭订单), the request was failing with a 403 error code "NOAUTH" (商户无权限) because the SubOrders class was missing the required sub_mchid and sub_appid fields.

Changes Made

Added the missing fields to CombineCloseRequest.SubOrders:

  • sub_mchid (二级商户号) - Required field for service provider sub-merchant ID
  • sub_appid (子商户应用ID) - Required field for sub-merchant application ID

Both fields include:

  • Proper @SerializedName annotations for JSON serialization
  • Complete documentation following existing code patterns
  • Field validation rules matching WeChat Pay API requirements

Verification

  • Manual testing confirms JSON serialization works correctly:
{
  "combine_appid": "wxd678efh567hg6787",
  "sub_orders": [{
    "mchid": "1900000109",
    "out_trade_no": "20150806125346",
    "sub_mchid": "1230000109",
    "sub_appid": "wxd678efh567hg6999"
  }]
}
  • Added comprehensive test case for serialization/deserialization
  • All builds pass successfully
  • Zero impact on existing functionality

This fix resolves the WeChat Pay API authentication issue by providing the required merchant identification fields.

Fixes #3611.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…Orders

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 微信支付 - 平台收付通 - 合单支付 - 关闭订单 Add missing sub_mchid and sub_appid fields to CombineCloseRequest.SubOrders Jul 24, 2025
@Copilot Copilot AI requested a review from binarywang July 24, 2025 08:08
Copilot finished work on behalf of binarywang July 24, 2025 08:08
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