Skip to content

Commit

Permalink
fix bug binarywang#2734 商家批量转账参数加密异常
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjun96 committed Jul 12, 2022
1 parent 188d1e1 commit 4d3a2e4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import com.google.gson.GsonBuilder;
import lombok.RequiredArgsConstructor;

import java.security.cert.X509Certificate;
import java.util.List;

/**
* 商家转账到零钱
*
Expand All @@ -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);
}
Expand Down

0 comments on commit 4d3a2e4

Please sign in to comment.