mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-02 20:02:37 +08:00
🐛 #2734 【微信支付】商家批量转账参数加密异常修复
This commit is contained in:
parent
27bccb3a7e
commit
c68f2d2f36
@ -9,6 +9,9 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商家转账到零钱
|
||||
*
|
||||
@ -24,7 +27,11 @@ public class TransferServiceImpl implements TransferService {
|
||||
@Override
|
||||
public TransferBatchesResult transferBatches(TransferBatchesRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/transfer/batches", this.payService.getPayBaseUrl());
|
||||
RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate());
|
||||
List<TransferBatchesRequest.TransferDetail> transferDetailList = request.getTransferDetailList();
|
||||
X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
|
||||
for (TransferBatchesRequest.TransferDetail detail : transferDetailList) {
|
||||
RsaCryptoUtil.encryptFields(detail, validCertificate);
|
||||
}
|
||||
String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
|
||||
return GSON.fromJson(result, TransferBatchesResult.class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user