支付宝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;
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());

View File

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