Add support for WeChat merchant transfer confirmation-free receipt authorization mode #3717
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toTransferBillsRequest
with two supported modes:CONFIRM_RECEIPT_AUTHORIZATION
(default): Traditional mode requiring user confirmationNO_CONFIRM_RECEIPT_AUTHORIZATION
: Streamlined mode for pre-authorized usersType Safety & Constants
Added
WxPayConstants.ReceiptAuthorizationMode
class with compile-time constants to prevent invalid authorization mode values and improve code reliability.Enhanced Documentation & Examples
NewTransferApiExample.java
with comprehensive usage examplesBenefits
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.