From 6251980b4a1c15e41d0f88c2cfae163263884ce2 Mon Sep 17 00:00:00 2001 From: xiaoyu <17601026937@163.com> Date: Wed, 19 Jan 2022 17:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9Dsdk=E5=8D=87?= =?UTF-8?q?=E7=BA=A74.22.22.ALL=EF=BC=8C=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E8=BD=AC=E8=B4=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channel/alipay/AlipayTransferService.java | 26 +++++++++++-------- pom.xml | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/AlipayTransferService.java b/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/AlipayTransferService.java index 8710486..03aa80f 100644 --- a/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/AlipayTransferService.java +++ b/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/AlipayTransferService.java @@ -15,10 +15,10 @@ */ package com.jeequan.jeepay.pay.channel.alipay; -import com.alipay.api.domain.AlipayFundTransToaccountTransferModel; -import com.alipay.api.request.AlipayFundTransToaccountTransferRequest; -import com.alipay.api.response.AlipayFundTransToaccountTransferResponse; -import com.alipay.api.response.AlipayTradeRefundResponse; +import com.alipay.api.domain.AlipayFundTransUniTransferModel; +import com.alipay.api.domain.Participant; +import com.alipay.api.request.AlipayFundTransUniTransferRequest; +import com.alipay.api.response.AlipayFundTransUniTransferResponse; import com.jeequan.jeepay.core.constants.CS; import com.jeequan.jeepay.core.entity.TransferOrder; import com.jeequan.jeepay.core.utils.AmountUtil; @@ -69,21 +69,25 @@ public class AlipayTransferService implements ITransferService { @Override public ChannelRetMsg transfer(TransferOrderRQ bizRQ, TransferOrder transferOrder, MchAppConfigContext mchAppConfigContext){ - AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest(); - AlipayFundTransToaccountTransferModel model = new AlipayFundTransToaccountTransferModel(); - model.setAmount(AmountUtil.convertCent2Dollar(transferOrder.getAmount())); //转账金额,单位:元。 + AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest(); + AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel(); + model.setTransAmount(AmountUtil.convertCent2Dollar(transferOrder.getAmount())); //转账金额,单位:元。 model.setOutBizNo(transferOrder.getTransferId()); //商户转账唯一订单号 - model.setPayeeType("ALIPAY_LOGONID"); //ALIPAY_USERID: 支付宝用户ID ALIPAY_LOGONID:支付宝登录账号 - model.setPayeeAccount(transferOrder.getAccountNo()); //收款方账户 - model.setPayeeRealName(StringUtils.defaultString(transferOrder.getAccountName(), null)); //收款方真实姓名 model.setRemark(transferOrder.getTransferDesc()); //转账备注 + + Participant accPayeeInfo = new Participant(); + accPayeeInfo.setName(StringUtils.defaultString(transferOrder.getAccountName(), null)); //收款方真实姓名 + accPayeeInfo.setIdentityType("ALIPAY_LOGONID"); //ALIPAY_USERID: 支付宝用户ID ALIPAY_LOGONID:支付宝登录账号 + accPayeeInfo.setIdentity(transferOrder.getAccountNo()); //收款方账户 + model.setPayeeInfo(accPayeeInfo); + request.setBizModel(model); //统一放置 isv接口必传信息 AlipayKit.putApiIsvInfo(mchAppConfigContext, request, model); // 调起支付宝接口 - AlipayFundTransToaccountTransferResponse response = configContextQueryService.getAlipayClientWrapper(mchAppConfigContext).execute(request); + AlipayFundTransUniTransferResponse response = configContextQueryService.getAlipayClientWrapper(mchAppConfigContext).execute(request); ChannelRetMsg channelRetMsg = new ChannelRetMsg(); channelRetMsg.setChannelAttach(response.getBody()); diff --git a/pom.xml b/pom.xml index d5eb3f0..6550ee9 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ com.alipay.sdk alipay-sdk-java - 4.16.11.ALL + 4.22.22.ALL