wechatpay-apiv3 / wechatpay-java

微信支付 APIv3 的官方 Java Library
Apache License 2.0
959 stars 209 forks source link

文档回调通知代码错误 #261

Open edxspark opened 6 months ago

edxspark commented 6 months ago

错误描述

文档回调代码NotificationParser对象 // 初始化 NotificationParser NotificationParser parser = new NotificationParser(config);

重现bug的步骤

文档未填写

预期行为

修正文档

导致错误的代码片段

No response

操作系统

macOS

Java 版本

Java 17

wechatpay-java 版本

v0.2.12

其他信息

No response

edxspark commented 6 months ago
// 问题排查,同一个RSAAutoCertificateConfig.Builder() 返回不同对象造成混淆
Config config =
    new RSAAutoCertificateConfig.Builder()
        .merchantId(merchantId)
        .privateKeyFromPath(privateKeyPath)
        .merchantSerialNumber(merchantSerialNumber)
        .apiV3Key(apiV3Key)
        .build();

NotificationConfig config = new RSAAutoCertificateConfig.Builder()
        .merchantId(merchantId)
        .privateKeyFromPath(privateKeyPath)
        .merchantSerialNumber(merchantSerialNumber)
        .apiV3Key(apiV3Key)
        .build();