...
|
...
|
@@ -8,24 +8,20 @@ import com.yoho.error.exception.ServiceException; |
|
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.Payment;
|
|
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.HttpClient;
|
|
|
import com.yohoufo.common.utils.MD5Utils;
|
|
|
import com.yohoufo.common.utils.RSAUtils;
|
|
|
import com.yohoufo.common.utils.WXUtil;
|
|
|
import com.yohoufo.common.utils.*;
|
|
|
import com.yohoufo.dal.order.OrdersPayHbfqMapper;
|
|
|
import com.yohoufo.dal.order.model.OrdersPayHbfq;
|
|
|
import com.yohoufo.dal.order.model.TradeBills;
|
|
|
import com.yohoufo.order.common.HbfqEnum;
|
|
|
import com.yohoufo.order.config.AlipayConfig;
|
|
|
import com.yohoufo.order.constants.RefundContant;
|
|
|
import com.yohoufo.order.model.*;
|
|
|
import com.yohoufo.order.model.PayQueryBo;
|
|
|
import com.yohoufo.order.model.PayRefundBo;
|
|
|
import com.yohoufo.order.model.PaymentData;
|
|
|
import com.yohoufo.order.model.TransferData;
|
|
|
import com.yohoufo.order.service.pay.AbstractPayService;
|
|
|
import com.yohoufo.order.service.transfer.TransferChannel;
|
|
|
import com.yohoufo.order.service.transfer.TransferResult;
|
|
|
import com.yohoufo.order.utils.AlipayExceedMillionTransferErrors;
|
|
|
import lombok.Builder;
|
|
|
import lombok.Data;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -39,7 +35,6 @@ import java.nio.charset.StandardCharsets; |
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.function.BiConsumer;
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
public abstract class AlipayServiceAbstract extends AbstractPayService {
|
|
|
|
...
|
...
|
@@ -200,7 +195,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
|
String alipayUid;
|
|
|
String alipayAccount;
|
|
|
BigDecimal transferAmount;
|
|
|
BiConsumer<Integer, String> rishWatcherConsumer;
|
|
|
BiConsumer<Integer, AuthorizeResultRespVO> rishWatcherConsumer;
|
|
|
|
|
|
private AlipayTransfer(int uid){
|
|
|
this.uid = uid;
|
...
|
...
|
@@ -226,14 +221,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public AlipayTransfer riskWatcher(BiConsumer<Integer, String> rishWatcherConsumer){
|
|
|
public AlipayTransfer riskWatcher(BiConsumer<Integer, AuthorizeResultRespVO> rishWatcherConsumer){
|
|
|
this.rishWatcherConsumer = rishWatcherConsumer;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public TransferResult transfer() {
|
|
|
rishWatcherConsumer.accept(uid, alipayUid);
|
|
|
AuthorizeResultRespVO aar = AuthorizeResultRespVO.builder().alipayId(alipayUid)
|
|
|
.alipayAccount(alipayAccount).build();
|
|
|
rishWatcherConsumer.accept(uid, aar);
|
|
|
Map<String, String> queryParams = buildTransferParams(transferOrderCode, alipayUid, alipayAccount, transferAmount);
|
|
|
String respTxt;
|
|
|
try {
|
...
|
...
|
@@ -324,7 +321,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
|
BigDecimal transferAmount;
|
|
|
String businessId;
|
|
|
String userName;
|
|
|
BiConsumer<Integer, String> riskWatcher;
|
|
|
BiConsumer<Integer, AuthorizeResultRespVO> riskWatcher;
|
|
|
private AlipayExceedMillionTransferChannel(int uid){
|
|
|
this.uid = uid;
|
|
|
}
|
...
|
...
|
@@ -359,14 +356,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public AlipayExceedMillionTransferChannel riskWatcher(BiConsumer<Integer, String> riskWatcher){
|
|
|
public AlipayExceedMillionTransferChannel riskWatcher(BiConsumer<Integer, AuthorizeResultRespVO> riskWatcher){
|
|
|
this.riskWatcher = riskWatcher;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public TransferResult transfer() {
|
|
|
riskWatcher.accept(uid, alipayUid);
|
|
|
AuthorizeResultRespVO aar = AuthorizeResultRespVO.builder().alipayId(alipayUid)
|
|
|
.alipayAccount(alipayAccount).build();
|
|
|
riskWatcher.accept(uid, aar);
|
|
|
Map<String, String> queryParams = buildTransferParamsWhenExceedMillion(transferOrderCode, businessId, alipayUid, alipayAccount, userName, transferAmount);
|
|
|
String respTxt;
|
|
|
try {
|
...
|
...
|
|