Closed egosodv closed 1 year ago
应当考虑sdk使用者存在单实例运行,没有将下单和回调分成多个服务的情况
在一个服务中,同时构造支付config和回调通知config抛出异常
对notificationconfig和config分别处理,不抛出异常
protected AbstractAutoCertificateProvider( String requestUrl, CertificateHandler certificateHandler, AeadCipher aeadCipher, HttpClient httpClient, String merchantId, Map<String, Map<String, X509Certificate>> wechatPayCertificateMap, int updateInterval) { this.merchantId = merchantId; synchronized (AbstractAutoCertificateProvider.class) { if (!wechatPayCertificateMap.containsKey(merchantId)) { wechatPayCertificateMap.put(merchantId, new HashMap<>()); } else { throw new IllegalStateException( "The corresponding provider for the merchant already exists."); } }
Windows 10
Java 8
v0.2.7
No response
有看到之前同样有人提出困惑,但好像没有就单实例同时处理下单和回调给出解决方案,https://github.com/wechatpay-apiv3/wechatpay-java/issues/92
错误描述
应当考虑sdk使用者存在单实例运行,没有将下单和回调分成多个服务的情况
重现bug的步骤
在一个服务中,同时构造支付config和回调通知config抛出异常
预期行为
对notificationconfig和config分别处理,不抛出异常
导致错误的代码片段
操作系统
Windows 10
Java 版本
Java 8
wechatpay-java 版本
v0.2.7
其他信息
No response