Skip to content

Conversation

@unsafe-ptr
Copy link

问题描述: 当商户切换到公钥,废弃平台证书,导致报错无可用平台证书的问题
原因: BeanUtil.copyProperties忽略了publicKeyContent字段,当切换为公钥模式时,需要手动设置该值

}
// 兼容微信支付公钥模式(BeanUtil.copyProperties忽略了该字段,当切换为公钥模式时,需要手动设置该值)
// 解决当商户切换到公钥,废弃平台证书,导致报错无可用平台证书的问题
if (StrUtil.isNotBlank(config.getPublicKeyId()) && StrUtil.startWith(config.getPublicKeyId(), "PUB_KEY_ID")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要加 PUB_KEY_ID 判断呀?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PUB_KEY_ID是新版公鑰模式的唯一標識,可以作爲判斷是新模式,而不是平臺證書模式

@YunaiV
Copy link
Owner

YunaiV commented Nov 25, 2025

想了下,暂时还是不加这个判断。
如果不需要,删除掉更明确一点。

非常感谢 pull request 哈。

@YunaiV YunaiV closed this Nov 25, 2025
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