fix(pppay): 修复非缓存模式下 PayPal 回调 PaypalWrapper 为 null#112
Open
DCmaple11 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
标题:fix(pppay): 修复非缓存模式下 PayPal 回调 PaypalWrapper 为 null
描述:
问题
当
cache-config: false(非缓存模式)时,PayPal 支付回调(同步跳转和异步通知)均会抛出 NPE,导致 Capture 未执行,用户已授权但实际未扣款。
根因:
PppayChannelNoticeService和PppayChannelRefundNoticeService中直接通过
mchAppConfigContext.getPaypalWrapper()获取 PayPal 客户端,而
ConfigContextQueryService.queryMchInfoAndAppInfo()在非缓存模式下构建的
MchAppConfigContext未初始化paypalWrapper,导致返回 null。修复
改为与微信通道一致的写法,通过
configContextQueryService.getPaypalWrapper(mchAppConfigContext)获取,该方法内部兼容了缓存和非缓存两种模式。
影响范围
PppayChannelNoticeService:doReturn / doNotify 两处PppayChannelRefundNoticeService:doNotice 一处测试
PayPal Sandbox 环境测试通过,同步回调正常触发 Capture,订单状态正确更新为支付成功。