package com.kidgrow.oprationcenter.weixin;
|
|
import java.io.ByteArrayInputStream;
|
import java.io.InputStream;
|
|
public class MyConfig extends WXPayConfig{
|
|
public MyConfig(WeiXinOfficPayProperties weiXinOfficPayProperties) {
|
this.weiXinOfficPayProperties = weiXinOfficPayProperties;
|
}
|
|
private WeiXinOfficPayProperties weiXinOfficPayProperties;
|
|
private byte[] certData;
|
|
public MyConfig() {
|
|
}
|
// public MyConfig() throws Exception {
|
// String certPath = "D:\\develop\\chengxu\\houtai\\3cc.txt";
|
// File file = new File(certPath);
|
// InputStream certStream = new FileInputStream(file);
|
// this.certData = new byte[(int) file.length()];
|
// certStream.read(this.certData);
|
// certStream.close();
|
// }
|
//wx84c77dcda51c612c
|
@Override
|
public String getAppID() {
|
return weiXinOfficPayProperties.getAppID();
|
// return "wx84c77dcda51c612c";
|
}
|
@Override
|
//"1386873502"
|
public String getMchID() {
|
return weiXinOfficPayProperties.getMchID();
|
// return "1386873502";
|
}
|
@Override
|
//"GSFcX6WdgRTAS6154EW14WE3SGBSER49"
|
public String getKey() {
|
return weiXinOfficPayProperties.getKey();
|
// return "GSFcX6WdgRTAS6154EW14WE3SGBSER49";
|
}
|
@Override
|
public InputStream getCertStream() {
|
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
|
return certBis;
|
}
|
@Override
|
public int getHttpConnectTimeoutMs() {
|
return 8000;
|
}
|
@Override
|
public int getHttpReadTimeoutMs() {
|
return 10000;
|
}
|
|
@Override
|
IWXPayDomain getWXPayDomain() throws Exception {
|
MyIWXPayDomain myIWXPayDomain=new MyIWXPayDomain();
|
MyConfig myConfig = new MyConfig();
|
System.out.println(myConfig.getDomain());
|
myIWXPayDomain.getDomain(myConfig);
|
return myIWXPayDomain;
|
}
|
|
@Override
|
public String getDomain() {
|
return "api.mch.weixin.qq.com";
|
}
|
|
public String getPayNotifyUrl() {return weiXinOfficPayProperties.getPayNotifyUrl();}
|
}
|