Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 24, 2025

Implements WeChat's new "免确认收款授权模式" (confirmation-free receipt authorization mode) for merchant transfers, addressing the requirement in issue for enhanced user experience in high-frequency transfer scenarios.

What's Changed

Core Implementation

Added receiptAuthorizationMode field to TransferBillsRequest with two supported modes:

  • CONFIRM_RECEIPT_AUTHORIZATION (default): Traditional mode requiring user confirmation
  • NO_CONFIRM_RECEIPT_AUTHORIZATION: Streamlined mode for pre-authorized users
// Enable no-confirmation mode for better UX
TransferBillsRequest request = TransferBillsRequest.newBuilder()
    .appid("wx1234567890123456")
    .outBillNo("TRANSFER_001")
    .transferSceneId("1005")
    .openid("user_openid")
    .transferAmount(200)
    .receiptAuthorizationMode(WxPayConstants.ReceiptAuthorizationMode.NO_CONFIRM_RECEIPT_AUTHORIZATION)
    .build();

Type Safety & Constants

Added WxPayConstants.ReceiptAuthorizationMode class with compile-time constants to prevent invalid authorization mode values and improve code reliability.

Enhanced Documentation & Examples

  • Updated NewTransferApiExample.java with comprehensive usage examples
  • Added error handling patterns for authorization failures
  • Enhanced API documentation with detailed mode comparisons
  • Updated transfer API support guides with new feature information

Benefits

For High-Frequency Scenarios: Eliminates user confirmation steps in commission payments, rewards, and cashback scenarios, significantly improving conversion rates and user experience.

Backward Compatibility: Existing code continues to work unchanged - the new field is optional and defaults to the traditional confirmation mode.

Production Ready: All changes validated with successful compilation, checkstyle compliance, and comprehensive testing.

API Reference

The feature follows WeChat's official API specification documented at https://pay.weixin.qq.com/doc/v3/merchant/4014399293 and maintains full compatibility with existing transfer workflows while enabling enhanced user experiences for authorized scenarios.

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 and others added 2 commits September 24, 2025 13:54
…mode support

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 微信商户转账新增了免确认收款授权模式 Add support for WeChat merchant transfer confirmation-free receipt authorization mode Sep 24, 2025
@Copilot 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
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