Skip to content

Commit c21bad9

Browse files
committed
增加设置方法,方便设置是否使用微信支付仿真测试环境 binarywang#224
1 parent a6d29d9 commit c21bad9

File tree

1 file changed

+9
-1
lines changed
  • weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config

1 file changed

+9
-1
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class WxPayConfig {
2222
private String tradeType;
2323
private SSLContext sslContext;
2424
private String keyPath;
25+
private boolean useSandboxEnv = false;
2526

2627
public void setNotifyUrl(String notifyUrl) {
2728
this.notifyUrl = notifyUrl;
@@ -130,7 +131,14 @@ public SSLContext getSslContext() {
130131
* 默认不使用
131132
*/
132133
public boolean useSandbox() {
133-
return false;
134+
return this.useSandboxEnv;
135+
}
136+
137+
/**
138+
* 设置是否使用沙箱仿真测试环境
139+
*/
140+
public void setUseSandboxEnv(boolean useSandboxEnv) {
141+
this.useSandboxEnv = useSandboxEnv;
134142
}
135143

136144
public SSLContext initSSLContext() {

0 commit comments

Comments
 (0)