Skip to content

fix(pppay): 修复非缓存模式下 PayPal 回调 PaypalWrapper 为 null#112

Open
DCmaple11 wants to merge 1 commit into
jeequan:masterfrom
DCmaple11:fix/pppay-notice-paypal-wrapper-null
Open

fix(pppay): 修复非缓存模式下 PayPal 回调 PaypalWrapper 为 null#112
DCmaple11 wants to merge 1 commit into
jeequan:masterfrom
DCmaple11:fix/pppay-notice-paypal-wrapper-null

Conversation

@DCmaple11
Copy link
Copy Markdown

标题:fix(pppay): 修复非缓存模式下 PayPal 回调 PaypalWrapper 为 null

描述:

问题

cache-config: false(非缓存模式)时,PayPal 支付回调(同步跳转和异步通知)均会抛出 NPE,
导致 Capture 未执行,用户已授权但实际未扣款。

根因:PppayChannelNoticeServicePppayChannelRefundNoticeService
直接通过 mchAppConfigContext.getPaypalWrapper() 获取 PayPal 客户端,
ConfigContextQueryService.queryMchInfoAndAppInfo() 在非缓存模式下
构建的 MchAppConfigContext 未初始化 paypalWrapper,导致返回 null。

修复

改为与微信通道一致的写法,通过 configContextQueryService.getPaypalWrapper(mchAppConfigContext)
获取,该方法内部兼容了缓存和非缓存两种模式。

影响范围

  • PppayChannelNoticeService:doReturn / doNotify 两处
  • PppayChannelRefundNoticeService:doNotice 一处

测试

PayPal Sandbox 环境测试通过,同步回调正常触发 Capture,订单状态正确更新为支付成功。

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.

1 participant