private HttpClient buildHttpClientAutoUpdateCertificate() {
AutoUpdateCertificatesVerifier verifier =
new AutoUpdateCertificatesVerifier(
new WechatPay2Credentials(
wxConfig.getMchId(), new PrivateKeySigner(wxConfig.getSerialNo(), getPrivateKey())),
wxConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
return WechatPayHttpClientBuilder.create()
.withMerchant(wxConfig.getMchId(), wxConfig.getSerialNo(), getPrivateKey())
.withValidator(new WechatPay2Validator(verifier))
.build();
}
接口返回200 但提示WechatPay2Validator : For input string: "PUB"
如果返回的Wechatpay-Serial为pub开头的平台公钥id,那么你就需要使用对应的平台公钥进行验证签名,报错说明你给的验证签名的平台公钥不对