|
|
@@ -63,15 +63,15 @@ public class TransferServiceImpl implements TransferService {
|
|
|
public TransferToUser.TransferToUserResponse transferBills(WithdrawBo withdrawBo) {
|
|
|
|
|
|
TransferToUser client = new TransferToUser(
|
|
|
- newWxPayProperties.getMchId(), // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/merchant/4013070756
|
|
|
- newWxPayProperties.getCertSerialNo(), // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/merchant/4013053053
|
|
|
- newWxPayProperties.getPrivateKeyPath(), // 商户API证书私钥文件路径,本地文件路径
|
|
|
- newWxPayProperties.getPublicKeyId(), // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/merchant/4013038816
|
|
|
- newWxPayProperties.getPublicKeyPath() // 微信支付公钥文件路径,本地文件路径
|
|
|
+ newWxPayProperties.getMerchant().getMchId(), // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/merchant/4013070756
|
|
|
+ newWxPayProperties.getMerchant().getCertSerialNo(), // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/merchant/4013053053
|
|
|
+ newWxPayProperties.getMerchant().getPrivateKeyPath(), // 商户API证书私钥文件路径,本地文件路径
|
|
|
+ newWxPayProperties.getMerchant().getPublicKeyId(), // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/merchant/4013038816
|
|
|
+ newWxPayProperties.getMerchant().getPublicKeyPath() // 微信支付公钥文件路径,本地文件路径
|
|
|
);
|
|
|
|
|
|
TransferToUser.TransferToUserRequest request = new TransferToUser.TransferToUserRequest();
|
|
|
- request.appid = newWxPayProperties.getAppId();
|
|
|
+ request.appid = newWxPayProperties.getMerchant().getAppId();
|
|
|
request.outBillNo = withdrawBo.getBusinessCode();
|
|
|
request.transferSceneId = "1005";
|
|
|
request.openid = withdrawBo.getOpenid();
|
|
|
@@ -79,7 +79,7 @@ public class TransferServiceImpl implements TransferService {
|
|
|
BigDecimal amount = withdrawBo.getMoney();
|
|
|
request.transferAmount = amount.multiply(new BigDecimal("100")).longValue();
|
|
|
request.transferRemark = "佣金报酬";
|
|
|
- request.notifyUrl = newWxPayProperties.getTransferNotifyUrl();
|
|
|
+ request.notifyUrl = newWxPayProperties.getMerchant().getTransferNotifyUrl();
|
|
|
request.transferSceneReportInfos = new ArrayList<>();
|
|
|
{
|
|
|
TransferToUser.TransferSceneReportInfo transferSceneReportInfosItem0 = new TransferToUser.TransferSceneReportInfo();
|
|
|
@@ -94,8 +94,8 @@ public class TransferServiceImpl implements TransferService {
|
|
|
try {
|
|
|
TransferToUser.TransferToUserResponse response = client.run(request);
|
|
|
// TODO: 请求成功,继续业务逻辑
|
|
|
- response.appid = newWxPayProperties.getAppId();
|
|
|
- response.mchid = newWxPayProperties.getMchId();
|
|
|
+ response.appid = newWxPayProperties.getMerchant().getAppId();
|
|
|
+ response.mchid = newWxPayProperties.getMerchant().getMchId();
|
|
|
return response;
|
|
|
} catch (WXPayUtility.ApiException e) {
|
|
|
// TODO: 请求失败,根据状态码执行不同的逻辑
|
|
|
@@ -136,7 +136,7 @@ public class TransferServiceImpl implements TransferService {
|
|
|
WxCallbackResourceDTO resource = callbackDTO.getResource();
|
|
|
log.info("商家转账到用户零钱回调 resource={}",JSONObject.toJSONString(resource));
|
|
|
|
|
|
- AesUtil aesUtil = new AesUtil(newWxPayProperties.getApiv3().getBytes(StandardCharsets.UTF_8));
|
|
|
+ AesUtil aesUtil = new AesUtil(newWxPayProperties.getMerchant().getApiv3().getBytes(StandardCharsets.UTF_8));
|
|
|
String plainText = aesUtil.decryptToString(
|
|
|
resource.getAssociatedData().getBytes(),
|
|
|
resource.getNonce().getBytes(),
|