fixed payment bug.....
This commit is contained in:
parent
7a870343b9
commit
72514a8433
@ -1,165 +1,158 @@
|
|||||||
package com.foxinmy.weixin4j.util;
|
package com.foxinmy.weixin4j.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.foxinmy.weixin4j.http.HttpParams;
|
import com.foxinmy.weixin4j.http.HttpParams;
|
||||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
import com.foxinmy.weixin4j.model.WeixinAccount;
|
||||||
import com.foxinmy.weixin4j.model.WeixinPayAccount;
|
import com.foxinmy.weixin4j.model.WeixinPayAccount;
|
||||||
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
||||||
import com.foxinmy.weixin4j.token.TokenStorager;
|
import com.foxinmy.weixin4j.token.TokenStorager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信配置相关
|
* 微信配置相关
|
||||||
*
|
*
|
||||||
* @className Weixin4jSettings
|
* @className Weixin4jSettings
|
||||||
* @author jy
|
* @author jy
|
||||||
* @date 2016年1月28日
|
* @date 2016年1月28日
|
||||||
* @since JDK 1.6
|
* @since JDK 1.6
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
public class Weixin4jSettings {
|
public class Weixin4jSettings {
|
||||||
/**
|
/**
|
||||||
* 微信支付账号信息
|
* 微信支付账号信息
|
||||||
*/
|
*/
|
||||||
private WeixinPayAccount weixinPayAccount;
|
private WeixinPayAccount weixinPayAccount;
|
||||||
/**
|
/**
|
||||||
* 微信账号信息
|
* 微信账号信息
|
||||||
*/
|
*/
|
||||||
private WeixinAccount weixinAccount;
|
private WeixinAccount weixinAccount;
|
||||||
/**
|
/**
|
||||||
* Http参数
|
* Http参数
|
||||||
*/
|
*/
|
||||||
private HttpParams httpParams;
|
private HttpParams httpParams;
|
||||||
/**
|
/**
|
||||||
* token存储方式 默认为FileTokenStorager
|
* token存储方式 默认为FileTokenStorager
|
||||||
*/
|
*/
|
||||||
private TokenStorager tokenStorager;
|
private TokenStorager tokenStorager;
|
||||||
/**
|
/**
|
||||||
* 系统临时目录
|
* 系统临时目录
|
||||||
*/
|
*/
|
||||||
private String tmpdir;
|
private String tmpdir;
|
||||||
/**
|
/**
|
||||||
* 支付接口需要的证书文件(*.p12)
|
* 支付接口需要的证书文件(*.p12)
|
||||||
*/
|
*/
|
||||||
private String certificateFile;
|
private String certificateFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认使用weixin4j.properties配置的信息
|
* 默认使用weixin4j.properties配置的信息
|
||||||
*/
|
*/
|
||||||
public Weixin4jSettings() {
|
public Weixin4jSettings() {
|
||||||
this(JSON.parseObject(Weixin4jConfigUtil.getValue("account"),
|
this(JSON.parseObject(Weixin4jConfigUtil.getValue("account"), WeixinPayAccount.class), null);
|
||||||
WeixinPayAccount.class), "classpath:ca.p12");
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* 支付代理接口
|
||||||
* 支付代理接口
|
*
|
||||||
*
|
* @param weixinPayAccount
|
||||||
* @param weixinPayAccount
|
* 商户信息
|
||||||
* 商户信息
|
* @param certificateFile
|
||||||
* @param certificateFile
|
* 支付接口需要的证书文件(*.p12),比如退款接口
|
||||||
* 支付接口需要的证书文件(*.p12),比如退款接口
|
*/
|
||||||
*/
|
public Weixin4jSettings(WeixinPayAccount weixinPayAccount, String certificateFile) {
|
||||||
public Weixin4jSettings(WeixinPayAccount weixinPayAccount,
|
this(weixinPayAccount);
|
||||||
String certificateFile) {
|
this.certificateFile = certificateFile;
|
||||||
this(weixinPayAccount);
|
}
|
||||||
this.certificateFile = certificateFile;
|
|
||||||
}
|
/**
|
||||||
|
* 支付代理接口
|
||||||
/**
|
*
|
||||||
* 支付代理接口
|
* @param weixinPayAccount
|
||||||
*
|
* 商户信息
|
||||||
* @param weixinPayAccount
|
*/
|
||||||
* 商户信息
|
public Weixin4jSettings(WeixinPayAccount weixinPayAccount) {
|
||||||
*/
|
this.weixinPayAccount = weixinPayAccount;
|
||||||
public Weixin4jSettings(WeixinPayAccount weixinPayAccount) {
|
this.weixinAccount = new WeixinAccount(weixinPayAccount.getId(), weixinPayAccount.getSecret());
|
||||||
this.weixinPayAccount = weixinPayAccount;
|
}
|
||||||
this.weixinAccount = new WeixinAccount(weixinPayAccount.getId(),
|
|
||||||
weixinPayAccount.getSecret());
|
/**
|
||||||
}
|
* 普通代理接口
|
||||||
|
*
|
||||||
/**
|
* @param weixinAccount
|
||||||
* 普通代理接口
|
*/
|
||||||
*
|
public Weixin4jSettings(WeixinAccount weixinAccount) {
|
||||||
* @param weixinAccount
|
this.weixinAccount = weixinAccount;
|
||||||
*/
|
}
|
||||||
public Weixin4jSettings(WeixinAccount weixinAccount) {
|
|
||||||
this.weixinAccount = weixinAccount;
|
public WeixinPayAccount getWeixinPayAccount() {
|
||||||
}
|
return weixinPayAccount;
|
||||||
|
}
|
||||||
public WeixinPayAccount getWeixinPayAccount() {
|
|
||||||
return weixinPayAccount;
|
public WeixinAccount getWeixinAccount() {
|
||||||
}
|
return weixinAccount;
|
||||||
|
}
|
||||||
public WeixinAccount getWeixinAccount() {
|
|
||||||
return weixinAccount;
|
public HttpParams getHttpParams() {
|
||||||
}
|
return httpParams;
|
||||||
|
}
|
||||||
public HttpParams getHttpParams() {
|
|
||||||
return httpParams;
|
public HttpParams getHttpParams0() {
|
||||||
}
|
if (httpParams == null) {
|
||||||
|
return new HttpParams();
|
||||||
public HttpParams getHttpParams0() {
|
}
|
||||||
if (httpParams == null) {
|
return httpParams;
|
||||||
return new HttpParams();
|
}
|
||||||
}
|
|
||||||
return httpParams;
|
public String getTmpdir() {
|
||||||
}
|
return tmpdir;
|
||||||
|
}
|
||||||
public String getTmpdir() {
|
|
||||||
return tmpdir;
|
public String getTmpdir0() {
|
||||||
}
|
if (StringUtil.isBlank(tmpdir)) {
|
||||||
|
return Weixin4jConfigUtil.getClassPathValue("weixin4j.tmpdir", System.getProperty("java.io.tmpdir"));
|
||||||
public String getTmpdir0() {
|
}
|
||||||
if (StringUtil.isBlank(tmpdir)) {
|
return tmpdir;
|
||||||
return Weixin4jConfigUtil.getClassPathValue("weixin4j.tmpdir",
|
}
|
||||||
System.getProperty("java.io.tmpdir"));
|
|
||||||
}
|
public TokenStorager getTokenStorager() {
|
||||||
return tmpdir;
|
return tokenStorager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenStorager getTokenStorager() {
|
public TokenStorager getTokenStorager0() {
|
||||||
return tokenStorager;
|
if (tokenStorager == null) {
|
||||||
}
|
return new FileTokenStorager(getTmpdir0());
|
||||||
|
}
|
||||||
public TokenStorager getTokenStorager0() {
|
return tokenStorager;
|
||||||
if (tokenStorager == null) {
|
}
|
||||||
return new FileTokenStorager(getTmpdir0());
|
|
||||||
}
|
public String getCertificateFile() {
|
||||||
return tokenStorager;
|
return certificateFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCertificateFile() {
|
public String getCertificateFile0() {
|
||||||
return certificateFile;
|
if (StringUtil.isBlank(certificateFile)) {
|
||||||
}
|
return Weixin4jConfigUtil.getClassPathValue("weixin4j.certificate.file", "classpath:ca.p12");
|
||||||
|
}
|
||||||
public String getCertificateFile0() {
|
return certificateFile;
|
||||||
if (StringUtil.isBlank(certificateFile)) {
|
}
|
||||||
return Weixin4jConfigUtil.getClassPathValue(
|
|
||||||
"weixin4j.certificate.file", "classpath:ca.p12");
|
public void setHttpParams(HttpParams httpParams) {
|
||||||
}
|
this.httpParams = httpParams;
|
||||||
return certificateFile;
|
}
|
||||||
}
|
|
||||||
|
public void setTmpdir(String tmpdir) {
|
||||||
public void setHttpParams(HttpParams httpParams) {
|
this.tmpdir = tmpdir;
|
||||||
this.httpParams = httpParams;
|
}
|
||||||
}
|
|
||||||
|
public void setTokenStorager(TokenStorager tokenStorager) {
|
||||||
public void setTmpdir(String tmpdir) {
|
this.tokenStorager = tokenStorager;
|
||||||
this.tmpdir = tmpdir;
|
}
|
||||||
}
|
|
||||||
|
public void setCertificateFile(String certificateFile) {
|
||||||
public void setTokenStorager(TokenStorager tokenStorager) {
|
this.certificateFile = certificateFile;
|
||||||
this.tokenStorager = tokenStorager;
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
public void setCertificateFile(String certificateFile) {
|
public String toString() {
|
||||||
this.certificateFile = certificateFile;
|
return "Weixin4jSettings [weixinAccount=" + weixinAccount + ", httpParams=" + httpParams + ",tokenStorager="
|
||||||
}
|
+ tokenStorager + ", tmpdir=" + tmpdir + ", certificateFile= " + certificateFile + "]";
|
||||||
|
}
|
||||||
@Override
|
}
|
||||||
public String toString() {
|
|
||||||
return "Weixin4jSettings [weixinAccount=" + weixinAccount
|
|
||||||
+ ", httpParams=" + httpParams + ",tokenStorager="
|
|
||||||
+ tokenStorager + ", tmpdir=" + tmpdir + ", certificateFile= "
|
|
||||||
+ certificateFile + "]";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user