运营端充值
This commit is contained in:
@@ -34,6 +34,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Base64;
|
||||
@@ -101,7 +102,7 @@ public class WxServiceImpl implements WxService {
|
||||
private static String platformCertPath;
|
||||
private static String platformCertNo;
|
||||
private static String mchId;
|
||||
private static String apiV3Key;
|
||||
public static String apiV3Key;
|
||||
private static String apiV2Key;
|
||||
private static String notifyUrl;
|
||||
private static String refundNotifyUrl;
|
||||
@@ -322,6 +323,20 @@ public class WxServiceImpl implements WxService {
|
||||
log.info(publicKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decryptToString(String associatedData, String nonceStr, String ciphertext) {
|
||||
AesUtil aesUtil = new AesUtil(apiV3Key.getBytes(StandardCharsets.UTF_8));
|
||||
try {
|
||||
return aesUtil.decryptToString(
|
||||
associatedData.getBytes(StandardCharsets.UTF_8),
|
||||
nonceStr.getBytes(StandardCharsets.UTF_8),
|
||||
ciphertext
|
||||
);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> v3Pay(String openId, BigDecimal amount, String desc, String tradeNo, String type) {
|
||||
if (desc == null) desc = "订单支付";
|
||||
@@ -338,7 +353,7 @@ public class WxServiceImpl implements WxService {
|
||||
String payInfo = JSONObject.toJSONString(model);
|
||||
log.info("统一下单参数: {}", payInfo);
|
||||
|
||||
IJPayHttpResponse resp = null;
|
||||
IJPayHttpResponse resp;
|
||||
try {
|
||||
resp = WxPayApi.v3(
|
||||
RequestMethodEnum.POST,
|
||||
|
||||
Reference in New Issue
Block a user