|
@@ -7,7 +7,6 @@ import java.io.InputStream;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import com.kede.sdk.IWXPayDomain;
|
|
import com.kede.sdk.IWXPayDomain;
|
|
@@ -26,20 +25,20 @@ public class IWxPayConfig extends WXPayConfig {
|
|
|
private String wx_pay_key;
|
|
private String wx_pay_key;
|
|
|
|
|
|
|
|
private String wx_pay_mch_id;
|
|
private String wx_pay_mch_id;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
public IWxPayConfig(String appid,String mchid,String apiKey) throws Exception {
|
|
public IWxPayConfig(String appid,String mchid,String apiKey) throws Exception {
|
|
|
this.app_id=appid;
|
|
this.app_id=appid;
|
|
|
this.wx_pay_mch_id=mchid;
|
|
this.wx_pay_mch_id=mchid;
|
|
|
this.wx_pay_key=apiKey;
|
|
this.wx_pay_key=apiKey;
|
|
|
-// String s=getSandboxSignKey();
|
|
|
|
|
new IWxPayConfig();
|
|
new IWxPayConfig();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public IWxPayConfig() throws Exception {
|
|
public IWxPayConfig() throws Exception {
|
|
|
// 构造方法读取证书, 通过getCertStream 可以使sdk获取到证书
|
|
// 构造方法读取证书, 通过getCertStream 可以使sdk获取到证书
|
|
|
-// String certPath = "F:/project/ztest/src/main/resources/apiclient_cert.p12";
|
|
|
|
|
- String certPath = "/data/apiclient_cert.p12";
|
|
|
|
|
- File file = new File(certPath);
|
|
|
|
|
|
|
+// File file = new File("F:/project/ztest/src/main/resources/apiclient_cert.p12");
|
|
|
|
|
+ File file = new File("/data/apiclient_cert.p12");
|
|
|
InputStream certStream = new FileInputStream(file);
|
|
InputStream certStream = new FileInputStream(file);
|
|
|
this.certData = new byte[(int) file.length()];
|
|
this.certData = new byte[(int) file.length()];
|
|
|
certStream.read(this.certData);
|
|
certStream.read(this.certData);
|
|
@@ -104,4 +103,6 @@ public class IWxPayConfig extends WXPayConfig {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|