Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

变更内容

实现了微信商户转账的"免确认收款授权模式"功能,解决了issue中关于高频转账场景下用户体验优化的需求。

核心实现

TransferBillsRequest 中新增了 receiptAuthorizationMode 字段,支持两种模式:

  • CONFIRM_RECEIPT_AUTHORIZATION(默认):需确认收款授权模式,用户需手动确认才能收款
  • NO_CONFIRM_RECEIPT_AUTHORIZATION:免确认收款授权模式,用户事先授权后转账直接到账
// 使用免确认授权模式提升用户体验
TransferBillsRequest request = TransferBillsRequest.newBuilder()
    .appid("wx1234567890123456")
    .outBillNo("TRANSFER_001")
    .transferSceneId("1005")
    .openid("user_openid")
    .transferAmount(200)
    .receiptAuthorizationMode(WxPayConstants.ReceiptAuthorizationMode.NO_CONFIRM_RECEIPT_AUTHORIZATION)
    .build();

类型安全 & 常量定义

新增 WxPayConstants.ReceiptAuthorizationMode 常量类,提供编译时类型检查,防止无效的授权模式值。

文档 & 示例增强

  • 更新 NewTransferApiExample.java,添加了完整的使用示例
  • 增加了授权失败的错误处理模式
  • 完善了API文档,详细说明了两种模式的对比
  • 更新了转账API使用指南

功能优势

适用高频场景:消除佣金发放、奖励、返现等场景中的用户确认步骤,显著提升转化率和用户体验。

完全兼容:现有代码无需修改即可继续运行,新字段为可选字段,默认使用传统的需确认模式。

生产就绪:所有变更已通过编译验证、代码风格检查和测试。

API参考

该功能遵循微信官方API规范,文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4014399293

Fixes #3716

Fixes #3716


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

Copilot AI changed the title [WIP] 微信商户转账新增了免确认收款授权模式 Add support for WeChat merchant transfer confirmation-free receipt authorization mode Sep 24, 2025
Copilot AI requested a review from binarywang September 24, 2025 13:58
Copilot finished work on behalf of binarywang September 24, 2025 13:58
@binarywang binarywang added this to the 4.7.9 milestone Sep 24, 2025
@binarywang binarywang marked this pull request as ready for review September 25, 2025 08:20
@binarywang binarywang modified the milestones: 4.7.9, 4.8.0 Nov 27, 2025
@binarywang
Copy link
Owner

@copilot 请用中文改下描述文字

Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot 请用中文改下描述文字

已将PR描述改为中文。

Copilot AI changed the title Add support for WeChat merchant transfer confirmation-free receipt authorization mode 微信商户转账新增免确认收款授权模式支持 Nov 28, 2025
Copilot finished work on behalf of binarywang November 28, 2025 03:39
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