mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、发票抬头管理、可开票列表部分接口完善;2、微信支付发起和回调测试;
This commit is contained in:
+53
-5
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user