Преглед изворни кода

chore: 清理if(true)和log中的mode三元判断

alphaH пре 1 дан
родитељ
комит
79fb597f5d

+ 5 - 9
java/src/main/java/com/payment/platform/core/alipay/AlipayClientFactory.java

@@ -202,19 +202,15 @@ public class AlipayClientFactory {
                 profile.getAppId(), profile.getAppPrivateKey(), profile.getAlipayPublicKey(),
                 profile.getServerUrl(), profile.getFormat(), profile.getCharset(), profile.getSignType());
 
-        // 证书模式: 若有证书内容则设置(优先级高于公钥)
         // 资金类接口统一使用公钥证书模式
-        if (true) {
-            config.setAppCertContent(profile.getAppCertContent());
-            config.setAlipayPublicCertContent(profile.getAlipayPublicCertContent());
-            config.setRootCertContent(profile.getRootCertContent());
-        }
+        config.setAppCertContent(profile.getAppCertContent());
+        config.setAlipayPublicCertContent(profile.getAlipayPublicCertContent());
+        config.setRootCertContent(profile.getRootCertContent());
 
         try {
             AlipayClient client = new DefaultAlipayClient(config);
-            log.info("服务商[{}]业务[{}]客户端创建成功, appId={}, mode={}",
-                    profile.getServiceProviderId(), profile.getBizType(), profile.getAppId(),
-                    profile.getAppCertContent() != null ? "cert" : "key");
+            log.info("服务商[{}]业务[{}]客户端创建成功, appId={}, mode=cert",
+                    profile.getServiceProviderId(), profile.getBizType(), profile.getAppId());
             return client;
         } catch (AlipayApiException e) {
             log.error("服务商[{}]业务[{}]客户端创建失败", profile.getServiceProviderId(), profile.getBizType(), e);