支付宝sdk升级4.22.22.ALL,支付宝转账修改

This commit is contained in:
xiaoyu 2022-01-19 17:02:23 +08:00
parent 7341c3cd2f
commit 6251980b4a
2 changed files with 16 additions and 12 deletions

View File

@ -15,10 +15,10 @@
*/ */
package com.jeequan.jeepay.pay.channel.alipay; package com.jeequan.jeepay.pay.channel.alipay;
import com.alipay.api.domain.AlipayFundTransToaccountTransferModel; import com.alipay.api.domain.AlipayFundTransUniTransferModel;
import com.alipay.api.request.AlipayFundTransToaccountTransferRequest; import com.alipay.api.domain.Participant;
import com.alipay.api.response.AlipayFundTransToaccountTransferResponse; import com.alipay.api.request.AlipayFundTransUniTransferRequest;
import com.alipay.api.response.AlipayTradeRefundResponse; import com.alipay.api.response.AlipayFundTransUniTransferResponse;
import com.jeequan.jeepay.core.constants.CS; import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.entity.TransferOrder; import com.jeequan.jeepay.core.entity.TransferOrder;
import com.jeequan.jeepay.core.utils.AmountUtil; import com.jeequan.jeepay.core.utils.AmountUtil;
@ -69,21 +69,25 @@ public class AlipayTransferService implements ITransferService {
@Override @Override
public ChannelRetMsg transfer(TransferOrderRQ bizRQ, TransferOrder transferOrder, MchAppConfigContext mchAppConfigContext){ public ChannelRetMsg transfer(TransferOrderRQ bizRQ, TransferOrder transferOrder, MchAppConfigContext mchAppConfigContext){
AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest(); AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
AlipayFundTransToaccountTransferModel model = new AlipayFundTransToaccountTransferModel(); AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
model.setAmount(AmountUtil.convertCent2Dollar(transferOrder.getAmount())); //转账金额单位 model.setTransAmount(AmountUtil.convertCent2Dollar(transferOrder.getAmount())); //转账金额单位
model.setOutBizNo(transferOrder.getTransferId()); //商户转账唯一订单号 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()); //转账备注 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); request.setBizModel(model);
//统一放置 isv接口必传信息 //统一放置 isv接口必传信息
AlipayKit.putApiIsvInfo(mchAppConfigContext, request, model); AlipayKit.putApiIsvInfo(mchAppConfigContext, request, model);
// 调起支付宝接口 // 调起支付宝接口
AlipayFundTransToaccountTransferResponse response = configContextQueryService.getAlipayClientWrapper(mchAppConfigContext).execute(request); AlipayFundTransUniTransferResponse response = configContextQueryService.getAlipayClientWrapper(mchAppConfigContext).execute(request);
ChannelRetMsg channelRetMsg = new ChannelRetMsg(); ChannelRetMsg channelRetMsg = new ChannelRetMsg();
channelRetMsg.setChannelAttach(response.getBody()); channelRetMsg.setChannelAttach(response.getBody());

View File

@ -151,7 +151,7 @@
<dependency> <dependency>
<groupId>com.alipay.sdk</groupId> <groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId> <artifactId>alipay-sdk-java</artifactId>
<version>4.16.11.ALL</version> <version>4.22.22.ALL</version>
</dependency> </dependency>
<!-- 阿里云oss组件 --> <!-- 阿里云oss组件 -->