mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
处理 WxCpAgentWorkBench 代码冲突
Signed-off-by: 谈笑 <2300064869@qq.com>
This commit is contained in:
commit
b90f5624b9
@ -28,7 +28,7 @@ $ git push
|
|||||||
* 定期使用项目仓库内容更新自己仓库内容。
|
* 定期使用项目仓库内容更新自己仓库内容。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git remote add upstream https://github.com/Wechat-Group/WxJava
|
$ git remote add upstream https://github.com/binarywang/WxJava
|
||||||
$ git fetch upstream
|
$ git fetch upstream
|
||||||
$ git checkout develop
|
$ git checkout develop
|
||||||
$ git rebase upstream/develop
|
$ git rebase upstream/develop
|
||||||
|
@ -59,7 +59,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
|
|||||||
* 设置为负数是使用系统默认设置(非3000ms的默认值,而是httpClient的默认设置).
|
* 设置为负数是使用系统默认设置(非3000ms的默认值,而是httpClient的默认设置).
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
private int connectionRequestTimeout = -1;
|
private int connectionRequestTimeout = 3000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建立链接的超时时间,默认为5000ms.由于是在链接池获取链接,此设置应该并不起什么作用
|
* 建立链接的超时时间,默认为5000ms.由于是在链接池获取链接,此设置应该并不起什么作用
|
||||||
|
@ -13,7 +13,6 @@ import me.chanjar.weixin.cp.constant.WxCpConsts;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type Wx cp agent work bench.
|
* The type Wx cp agent work bench.
|
||||||
|
@ -250,6 +250,12 @@ public class WxPayUnifiedOrderV3Request implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@SerializedName(value = "openid")
|
@SerializedName(value = "openid")
|
||||||
private String openid;
|
private String openid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实名支付用户身份标识
|
||||||
|
*/
|
||||||
|
@SerializedName(value = "identity")
|
||||||
|
private Identity identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -572,4 +578,36 @@ public class WxPayUnifiedOrderV3Request implements Serializable {
|
|||||||
@SerializedName(value = "profit_sharing")
|
@SerializedName(value = "profit_sharing")
|
||||||
private Boolean profitSharing;
|
private Boolean profitSharing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class Identity implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证件类型
|
||||||
|
* IDCARD:身份证
|
||||||
|
* HONGKONG_MACAO:港澳回乡证
|
||||||
|
* HONGKONG_MACAO_RESIDENT:港澳居住证
|
||||||
|
* TAIWAN_RESIDENT:台湾居住证
|
||||||
|
* FOREIGN_RESIDENT:外国人永居证
|
||||||
|
* OVERSEA_PASSPORT:护照
|
||||||
|
*/
|
||||||
|
@SerializedName(value = "type")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 证件号
|
||||||
|
* 证件号,如身份证号。
|
||||||
|
* 示例值:43102119910910512X
|
||||||
|
*/
|
||||||
|
@SerializedName(value = "number")
|
||||||
|
private String number;
|
||||||
|
/**
|
||||||
|
* 证件姓名。
|
||||||
|
* 示例值:周星星
|
||||||
|
*/
|
||||||
|
@SerializedName(value = "name")
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,10 +347,14 @@ public class WxPayConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
|
private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
|
||||||
Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
|
Verifier certificatesVerifier = null;
|
||||||
new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
|
// 如果配置了平台证书,则初始化验证器以备v2版本接口验签(公钥灰度实现)
|
||||||
this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
|
if (this.getPrivateCertPath() != null && this.getPrivateKeyPath() != null) {
|
||||||
this.getPayBaseUrl(), wxPayHttpProxy);
|
certificatesVerifier = new AutoUpdateCertificatesVerifier(
|
||||||
|
new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
|
||||||
|
this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
|
||||||
|
this.getPayBaseUrl(), wxPayHttpProxy);
|
||||||
|
}
|
||||||
if (publicKey != null) {
|
if (publicKey != null) {
|
||||||
Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
|
Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
|
||||||
publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
|
publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
|
||||||
|
@ -323,14 +323,13 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
log.debug("微信支付异步通知请求参数:{}", xmlData);
|
log.debug("微信支付异步通知请求参数:{}", xmlData);
|
||||||
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
|
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
|
||||||
if (signType == null) {
|
if (signType == null) {
|
||||||
String configKey = this.getConfigKey(result.getMchId(), result.getAppid());
|
this.switchover(result.getMchId(), result.getAppid());
|
||||||
if (result.getSignType() != null) {
|
if (result.getSignType() != null) {
|
||||||
// 如果解析的通知对象中signType有值,则使用它进行验签
|
// 如果解析的通知对象中signType有值,则使用它进行验签
|
||||||
signType = result.getSignType();
|
signType = result.getSignType();
|
||||||
} else if (configMap.get(configKey).getSignType() != null) {
|
} else if (this.getConfig().getSignType() != null) {
|
||||||
// 如果配置中signType有值,则使用它进行验签
|
// 如果配置中signType有值,则使用它进行验签
|
||||||
signType = configMap.get(configKey).getSignType();
|
signType = this.getConfig().getSignType();
|
||||||
this.switchover(result.getMchId(), result.getAppid());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class PublicCertificateVerifier implements Verifier{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean verify(String serialNumber, byte[] message, String signature) {
|
public boolean verify(String serialNumber, byte[] message, String signature) {
|
||||||
if (!serialNumber.contains("PUB_KEY_ID")) {
|
if (!serialNumber.contains("PUB_KEY_ID") && this.certificateVerifier != null) {
|
||||||
return this.certificateVerifier.verify(serialNumber, message, signature);
|
return this.certificateVerifier.verify(serialNumber, message, signature);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user