Commit c9339a81 by Wangmin

微信支付配置

parent 3bd77a48
...@@ -286,6 +286,10 @@ wechat: ...@@ -286,6 +286,10 @@ wechat:
token: #微信小程序消息服务器配置的token token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON msgDataFormat: JSON
pay:
mch-id: 1640662528
mch-key: FogyUzGHMnsoUU3exYyDO8DEKEtNjsSx
key-path: classpath:/apiclient_cert.p12
--- # 文件上传设置 --- # 文件上传设置
file: file:
#upload-path: /www/wwwroot/pz/upload #upload-path: /www/wwwroot/pz/upload
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<artifactId>weixin-java-miniapp</artifactId> <artifactId>weixin-java-miniapp</artifactId>
<version>4.5.5.B</version> <version>4.5.5.B</version>
</dependency> </dependency>
<!--微信支付-->
</dependencies> </dependencies>
......
...@@ -3,8 +3,6 @@ package com.pz.common.config; ...@@ -3,8 +3,6 @@ package com.pz.common.config;
import lombok.Data; import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.List;
/** /**
* 微信小程序配置属性 * 微信小程序配置属性
* *
...@@ -12,7 +10,7 @@ import java.util.List; ...@@ -12,7 +10,7 @@ import java.util.List;
*/ */
@Data @Data
@ConfigurationProperties(prefix = "wechat.applet") @ConfigurationProperties(prefix = "wechat.applet")
public class WechatProperties { public class WechatAppletProperties {
/** /**
* 设置微信小程序的appid * 设置微信小程序的appid
......
...@@ -27,14 +27,14 @@ import java.io.File; ...@@ -27,14 +27,14 @@ import java.io.File;
*/ */
@Slf4j @Slf4j
@Configuration @Configuration
@EnableConfigurationProperties(WechatProperties.class) @EnableConfigurationProperties({WechatAppletProperties.class, WechatPayProperties.class})
public class WechatConfiguration { public class WechatConfiguration {
private final WechatProperties properties; private final WechatAppletProperties properties;
private static WxMaMessageRouter router; private static WxMaMessageRouter router;
private static WxMaService maServices; private static WxMaService maServices;
@Autowired @Autowired
public WechatConfiguration(WechatProperties properties) { public WechatConfiguration(WechatAppletProperties properties) {
this.properties = properties; this.properties = properties;
} }
...@@ -54,7 +54,7 @@ public class WechatConfiguration { ...@@ -54,7 +54,7 @@ public class WechatConfiguration {
@PostConstruct @PostConstruct
public void init() { public void init() {
WechatProperties properties = this.properties; WechatAppletProperties properties = this.properties;
if (properties == null) { if (properties == null) {
throw new WxRuntimeException("未检测到合法微信配置属性"); throw new WxRuntimeException("未检测到合法微信配置属性");
} }
......
package com.pz.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 微信小程序配置属性
*
* @author Wangmin
*/
@Data
@ConfigurationProperties(prefix = "wechat.pay")
public class WechatPayProperties {
/**
* 微信支付商户号
*/
private String mchId;
/**
* 微信支付商户密钥
*/
private String mchKey;
/**
* P12 证书位置
*/
private String keyPath;
}
Markdown is supported
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