|
@@ -1,7 +1,6 @@
|
|
|
package com.miaxis.common.config;
|
|
|
|
|
|
import com.github.wxpay.sdk.WXPayConfig;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
@@ -9,27 +8,22 @@ import java.io.ByteArrayOutputStream;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
-
|
|
|
public class WxPayConfigImpl implements WXPayConfig {
|
|
|
- public static String url = "你设置的回调接口";
|
|
|
- private static WxPayConfigImpl wxPayConfig;
|
|
|
+ // public static String url = "你设置的回调接口";
|
|
|
+ // private static WxPayConfigImpl wxPayConfig;
|
|
|
private byte[] certData = null;
|
|
|
+ private static WxPayConfigImpl wxPayConfig;
|
|
|
|
|
|
+ private static String v3url = "https://api.mch.weixin.qq.com/v3/pay/transactions/app";
|
|
|
+ private static String v3urlRefund = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"; //退款
|
|
|
+ private static String merchantId = "1611324484"; //商户id
|
|
|
+ private static String serialNumber = "53EBF541F383371B121D7B57B25305FC0BB04F42";
|
|
|
+ private static String v3key = "7hM14893GvG3JK05575jk1l6P4tF042B";
|
|
|
+ private static String notifyUrl = "http://218.85.55.253:8888/open-api/wx/notify/wxpay";
|
|
|
+ private static String notifyUrlRefund = "http://218.85.55.253:8888/open-api/wx/notify/refund"; //退款回调
|
|
|
+ private static String appId = "wx606fa102dbc4b8ab";
|
|
|
|
|
|
-// @Resource
|
|
|
-// private WxpayConfig wxpayConfigBean;
|
|
|
|
|
|
- @Value("${app.appid}")
|
|
|
- private String appid;
|
|
|
-
|
|
|
- public static WxPayConfigImpl getInstance() {
|
|
|
- if (wxPayConfig == null) {
|
|
|
- synchronized (WxPayConfigImpl.class) {
|
|
|
- wxPayConfig = new WxPayConfigImpl();
|
|
|
- }
|
|
|
- }
|
|
|
- return wxPayConfig;
|
|
|
- }
|
|
|
|
|
|
public WxPayConfigImpl() {
|
|
|
try {
|
|
@@ -49,21 +43,35 @@ public class WxPayConfigImpl implements WXPayConfig {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public static WxPayConfigImpl getInstance() {
|
|
|
+ if (wxPayConfig == null) {
|
|
|
+ synchronized (WxPayConfigImpl.class) {
|
|
|
+ wxPayConfig = new WxPayConfigImpl();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return wxPayConfig;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public String getAppID() {
|
|
|
- return "wx67ca1b8c9816ef28";
|
|
|
+ return appId;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getMchID() {
|
|
|
- return "1615410794";
|
|
|
+ return merchantId;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getKey() {
|
|
|
- return "12345678123456781234567812345678";
|
|
|
+ return v3key;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public InputStream getCertStream() {
|
|
|
ByteArrayInputStream certBis;
|
|
@@ -73,13 +81,11 @@ public class WxPayConfigImpl implements WXPayConfig {
|
|
|
|
|
|
@Override
|
|
|
public int getHttpConnectTimeoutMs() {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return 8000;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int getHttpReadTimeoutMs() {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return 10000;
|
|
|
}
|
|
|
|
|
@@ -89,6 +95,6 @@ public class WxPayConfigImpl implements WXPayConfig {
|
|
|
}
|
|
|
|
|
|
public String getNotifyUrl(){
|
|
|
- return url;
|
|
|
+ return notifyUrl;
|
|
|
}
|
|
|
}
|