mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-13 21:33:41 +08:00
@@ -20,9 +20,9 @@ package cn.felord.payment.wechat;
|
|||||||
import cn.felord.payment.wechat.v3.KeyPairFactory;
|
import cn.felord.payment.wechat.v3.KeyPairFactory;
|
||||||
import cn.felord.payment.wechat.v3.WechatMetaBean;
|
import cn.felord.payment.wechat.v3.WechatMetaBean;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.core.io.ResourceLoader;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -37,7 +37,7 @@ import java.util.stream.Collectors;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class InMemoryWechatTenantService implements WechatTenantService {
|
public class InMemoryWechatTenantService implements WechatTenantService {
|
||||||
private final WechatPayProperties wechatPayProperties;
|
private final WechatPayProperties wechatPayProperties;
|
||||||
|
private final ResourceLoader resourceLoader;
|
||||||
@Override
|
@Override
|
||||||
public Set<WechatMetaBean> loadTenants() {
|
public Set<WechatMetaBean> loadTenants() {
|
||||||
Map<String, WechatPayProperties.V3> v3Map = wechatPayProperties.getV3();
|
Map<String, WechatPayProperties.V3> v3Map = wechatPayProperties.getV3();
|
||||||
@@ -51,7 +51,7 @@ public class InMemoryWechatTenantService implements WechatTenantService {
|
|||||||
String certAbsolutePath = v3.getCertAbsolutePath();
|
String certAbsolutePath = v3.getCertAbsolutePath();
|
||||||
String mchId = v3.getMchId();
|
String mchId = v3.getMchId();
|
||||||
Resource resource = certAbsolutePath != null ? new FileSystemResource(certAbsolutePath) :
|
Resource resource = certAbsolutePath != null ? new FileSystemResource(certAbsolutePath) :
|
||||||
new ClassPathResource(certPath == null ? "wechat/apiclient_cert.p12" : certPath);
|
resourceLoader.getResource(certPath == null ? "wechat/apiclient_cert.p12" : certPath);
|
||||||
WechatMetaBean wechatMetaBean = keyPairFactory.initWechatMetaBean(resource, mchId);
|
WechatMetaBean wechatMetaBean = keyPairFactory.initWechatMetaBean(resource, mchId);
|
||||||
wechatMetaBean.setV3(v3);
|
wechatMetaBean.setV3(v3);
|
||||||
wechatMetaBean.setTenantId(tenantId);
|
wechatMetaBean.setTenantId(tenantId);
|
||||||
|
|||||||
Reference in New Issue
Block a user