-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'dev' and 'master' of https://github.com/egzosn/pay-ja…
- Loading branch information
Showing
81 changed files
with
6,167 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
<dependency> | ||
<groupId>com.egzosn</groupId> | ||
<artifactId>{module-name}</artifactId> | ||
<version>2.13.2</version> | ||
<version>2.13.3</version> | ||
</dependency> | ||
|
||
``` | ||
|
@@ -63,8 +63,12 @@ android 例子 [pay-java-android](https://gitee.com/egzosn/pay-java-android) | |
|
||
非常欢迎和感谢对本项目发起Pull Request的同学,不过本项目基于git flow开发流程,因此在发起Pull Request的时候请选择develop分支。 | ||
|
||
作者公众号(每周输出) | ||
![公众号](https://egzosn.gitee.io/pay-java-parent/gzh.png "gzh.png") | ||
|
||
E-Mail:[email protected] | ||
|
||
QQ群:542193977 | ||
|
||
微信群: ![微信群](https://www.egzosn.com/images/wx.jpg "wx.jpg") | ||
微信群: | ||
![微信群](https://egzosn.gitee.io/pay-java-parent/wx.jpg "wx.jpg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
package com.egzosn.pay.ali.api; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import com.egzosn.pay.ali.bean.CertEnvironment; | ||
import com.egzosn.pay.common.api.BasePayConfigStorage; | ||
import com.egzosn.pay.common.api.CertStore; | ||
import com.egzosn.pay.common.bean.result.PayException; | ||
import com.egzosn.pay.common.exception.PayErrorException; | ||
|
||
/** | ||
* 支付配置存储 | ||
* | ||
* @author egan | ||
* <p> | ||
* email [email protected] | ||
* date 2016-5-18 14:09:01 | ||
* <p> | ||
* email [email protected] | ||
* date 2016-5-18 14:09:01 | ||
* </p> | ||
* 以下证书签名相关触发前提是 {@link BasePayConfigStorage#isCertSign}等于true的情况。不然走的就是普通的方式 | ||
*/ | ||
public class AliPayConfigStorage extends BasePayConfigStorage { | ||
|
||
/** | ||
* ISV代商户代用,指定appAuthToken | ||
*/ | ||
private String appAuthToken; | ||
/** | ||
* 商户应用id | ||
*/ | ||
|
@@ -27,6 +40,39 @@ public class AliPayConfigStorage extends BasePayConfigStorage { | |
private String seller; | ||
|
||
|
||
/** | ||
* 应用公钥证书 | ||
*/ | ||
private Object merchantCert; | ||
|
||
/** | ||
* 支付宝公钥证书 | ||
*/ | ||
private Object aliPayCert; | ||
/** | ||
* 支付宝CA证书,根证书 | ||
*/ | ||
private Object aliPayRootCert; | ||
|
||
/** | ||
* 证书存储类型 | ||
*/ | ||
private CertStore certStoreType; | ||
|
||
/** | ||
* 证书信息 | ||
*/ | ||
private CertEnvironment certEnvironment; | ||
|
||
|
||
public String getAppAuthToken() { | ||
return appAuthToken; | ||
} | ||
|
||
public void setAppAuthToken(String appAuthToken) { | ||
this.appAuthToken = appAuthToken; | ||
} | ||
|
||
public void setAppid(String appid) { | ||
this.appid = appid; | ||
} | ||
|
@@ -55,5 +101,61 @@ public void setSeller(String seller) { | |
this.seller = seller; | ||
} | ||
|
||
public Object getMerchantCert() { | ||
return merchantCert; | ||
} | ||
|
||
public void setMerchantCert(Object merchantCert) { | ||
this.merchantCert = merchantCert; | ||
} | ||
|
||
public Object getAliPayCert() { | ||
return aliPayCert; | ||
} | ||
|
||
public void setAliPayCert(Object aliPayCert) { | ||
this.aliPayCert = aliPayCert; | ||
} | ||
|
||
public Object getAliPayRootCert() { | ||
return aliPayRootCert; | ||
} | ||
|
||
public void setAliPayRootCert(Object aliPayRootCert) { | ||
this.aliPayRootCert = aliPayRootCert; | ||
} | ||
|
||
public CertStore getCertStoreType() { | ||
return certStoreType; | ||
} | ||
|
||
public void setCertStoreType(CertStore certStoreType) { | ||
this.certStoreType = certStoreType; | ||
} | ||
|
||
public CertEnvironment getCertEnvironment() { | ||
return certEnvironment; | ||
} | ||
|
||
public void setCertEnvironment(CertEnvironment certEnvironment) { | ||
this.certEnvironment = certEnvironment; | ||
} | ||
|
||
/** | ||
* 初始化证书信息 | ||
*/ | ||
public void loadCertEnvironment() { | ||
if (!isCertSign() || null != this.certEnvironment) { | ||
return; | ||
} | ||
try (InputStream merchantCertStream = certStoreType.getInputStream(merchantCert); | ||
InputStream aliPayCertStream = certStoreType.getInputStream(aliPayCert); | ||
InputStream aliPayRootCertStream = certStoreType.getInputStream(aliPayRootCert)) { | ||
this.certEnvironment = new CertEnvironment(merchantCertStream, aliPayCertStream, aliPayRootCertStream); | ||
} catch (IOException e) { | ||
throw new PayErrorException(new PayException("读取证书异常", e.getMessage())); | ||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.