Commit dae2d4a6 authored by terrfly's avatar terrfly
Browse files

微信apiV2方式 支持证书配置项;

parent d0622259
......@@ -46,6 +46,7 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -378,6 +379,11 @@ public class ConfigContextService {
if (CS.PAY_IF_VERSION.WX_V2.equals(apiVersion)) { // 微信API V2
wxPayConfig.setSignType(WxPayConstants.SignType.MD5);
// api证书。
if(StringUtils.isNotBlank(cert)){
wxPayConfig.setKeyPath(channelCertConfigKitBean.getCertFilePath(cert));
}
} else if (CS.PAY_IF_VERSION.WX_V3.equals(apiVersion)) { // 微信API V3
wxPayConfig.setApiV3Key(apiV3Key);
wxPayConfig.setCertSerialNo(serialNo);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment