1、发票抬头管理、可开票列表部分接口完善;2、微信支付发起和回调测试;

This commit is contained in:
gaoqr
2025-08-22 15:52:41 +08:00
parent 8cc23e8e43
commit 20f7fde7cd
31 changed files with 748 additions and 59 deletions
@@ -19,6 +19,11 @@ public class ChenfengWechatPayConfig extends WxPayConfig {
@Value("${chenfeng.encrypt.publicKey:}")
private String publicKey;
/**
* 给微信支付的回调地址
*/
private String notifyUrl;
@Override
public void setAppId(String appId) {
if (StringUtils.isNotEmpty(publicKey)) {
@@ -47,13 +52,56 @@ public class ChenfengWechatPayConfig extends WxPayConfig {
}
@Override
public void setKeyContent(byte[] keyContent) {
public void setApiV3Key(String apiV3Key) {
if (StringUtils.isNotEmpty(publicKey)) {
String encrypted = new String(keyContent, StandardCharsets.UTF_8);
String decrypted = AesUtils.decrypt(encrypted, publicKey);
super.setKeyContent(decrypted.getBytes(StandardCharsets.UTF_8));
super.setApiV3Key(AesUtils.decrypt(apiV3Key, publicKey));
} else {
super.setKeyContent(keyContent);
super.setApiV3Key(apiV3Key);
}
}
@Override
public void setCertSerialNo(String certSerialNo) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setCertSerialNo(AesUtils.decrypt(certSerialNo, publicKey));
} else {
super.setCertSerialNo(certSerialNo);
}
}
@Override
public void setPublicKeyId(String publicKeyId) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setPublicKeyId(AesUtils.decrypt(publicKeyId, publicKey));
} else {
super.setPublicKeyId(publicKeyId);
}
}
@Override
public void setNotifyUrl(String notifyUrl) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setNotifyUrl(AesUtils.decrypt(notifyUrl, publicKey));
} else {
super.setNotifyUrl(notifyUrl);
}
}
@Override
public void setPublicKeyString(String publicKeyString) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setPublicKeyContent(AesUtils.decrypt(publicKeyString, publicKey).getBytes(StandardCharsets.UTF_8));
} else {
super.setPublicKeyContent(publicKeyString.getBytes(StandardCharsets.UTF_8));
}
}
@Override
public void setPrivateKeyString(String privateKeyString) {
if (StringUtils.isNotEmpty(publicKey)) {
super.setPrivateKeyContent(AesUtils.decrypt(privateKeyString, publicKey).getBytes(StandardCharsets.UTF_8));
} else {
super.setPrivateKeyContent(privateKeyString.getBytes(StandardCharsets.UTF_8));
}
}
}