|  | @@ -9,6 +9,7 @@ import com.yonge.toolset.payment.core.service.SysConfigPaymentService;
 | 
	
		
			
				|  |  |  import com.yonge.toolset.payment.original.wx.constant.WxpayConstant;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  |  import org.springframework.context.annotation.Bean;
 | 
	
		
			
				|  |  |  import org.springframework.context.annotation.Configuration;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -23,6 +24,8 @@ import java.security.PrivateKey;
 | 
	
		
			
				|  |  |  public class WxpayConfiguration {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysConfigPaymentService configPaymentService;
 | 
	
		
			
				|  |  | +    @Value("${spring.profiles.active}")
 | 
	
		
			
				|  |  | +    private String profile;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Bean(name = "studentWxService")
 | 
	
		
			
				|  |  |      public WxPayService studentWxService() {
 | 
	
	
		
			
				|  | @@ -44,8 +47,14 @@ public class WxpayConfiguration {
 | 
	
		
			
				|  |  |          payConfig.setMchKey(merchantPrivateKey);
 | 
	
		
			
				|  |  |          payConfig.setCertSerialNo(merchantSerialNumber);
 | 
	
		
			
				|  |  |          payConfig.setApiV3Key(apiV3Key);
 | 
	
		
			
				|  |  | -        payConfig.setPrivateCertPath(privateCertPath);
 | 
	
		
			
				|  |  | -        payConfig.setPrivateKeyPath(privateKeyPath);
 | 
	
		
			
				|  |  | +        if("local".equals(profile)){
 | 
	
		
			
				|  |  | +            payConfig.setPrivateCertPath("D:\\env\\license\\wxpay\\apiclient_cert.pem");
 | 
	
		
			
				|  |  | +            payConfig.setPrivateKeyPath("D:\\env\\license\\wxpay\\apiclient_key.pem");
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            payConfig.setPrivateCertPath(privateCertPath);
 | 
	
		
			
				|  |  | +            payConfig.setPrivateKeyPath(privateKeyPath);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          // 可以指定是否使用沙箱环境
 | 
	
		
			
				|  |  |          payConfig.setUseSandboxEnv(false);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -75,8 +84,14 @@ public class WxpayConfiguration {
 | 
	
		
			
				|  |  |          payConfig.setMchKey(merchantPrivateKey);
 | 
	
		
			
				|  |  |          payConfig.setCertSerialNo(merchantSerialNumber);
 | 
	
		
			
				|  |  |          payConfig.setApiV3Key(apiV3Key);
 | 
	
		
			
				|  |  | -        payConfig.setPrivateCertPath(privateCertPath);
 | 
	
		
			
				|  |  | -        payConfig.setPrivateKeyPath(privateKeyPath);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if("local".equals(profile)){
 | 
	
		
			
				|  |  | +            payConfig.setPrivateCertPath("D:\\env\\license\\wxpay\\apiclient_cert.pem");
 | 
	
		
			
				|  |  | +            payConfig.setPrivateKeyPath("D:\\env\\license\\wxpay\\apiclient_key.pem");
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            payConfig.setPrivateCertPath(privateCertPath);
 | 
	
		
			
				|  |  | +            payConfig.setPrivateKeyPath(privateKeyPath);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          // 可以指定是否使用沙箱环境
 | 
	
		
			
				|  |  |          payConfig.setUseSandboxEnv(false);
 | 
	
		
			
				|  |  |  
 |